2011-11-02 59 views
0

我正在编写svn存储库内的代码,但我真的不想测试从代码库中运行我的代码。 (我有一个../computations目录以外的回购)。理想情况下,计算目录将是回购的单向符号链接,这样每个对源代码(在回购中)的编辑都将立即可用于../computations目录。从存储库到编译目录的单向符号链接

问题是,没有单向符号链接这样的事情。一个rsync shell脚本尽可能接近回购的单向镜像,但我试图尽量减少我忘记(或已经厌倦)更新../computations目录的机会。

我在这里有什么选择?

更多详细信息:我正在使用跨越多个 - 但少于十个 - 目录的C++和Python代码,并在vim中进行编辑。

+0

告诉我们更多。什么OS?什么发展环境?你如何构建你的代码?你在用什么语言? –

回答

0

好吧,这里有云:

我们在/usr/local/bin名为snk的rsync的脚本,看起来像:节省的rsync:

#! /bin/bash 
# this script will rsync -a the ../repo directory 
# with the ../computations directory on various architectures. 
# leave this script here (in the repo!) and create a symlink to it from someplace in your $PATH 

# get this host 
HOST=${HOSTNAME} 

# define various hosts in order to dictate specific rsync commands 
hostA="someHost" 
hostB="someOtherHost" 


if [ "$HOST" = "$hostA" ] 
then 
    rsync -zvai --exclude=.svn /full/path/to/repo/on/hostA/ /full/path/to/computations 

elif [ "$HOST" = "$hostB" ] 
then 
rsync -zvai --exclude=.svn /full/path/to/repo/on/hostB/ /full/path/to/computations 
fi 

然后,我们去了谷歌和发现:this qeustion关于“VIM '并给了它一个镜头。看看我的新.vimrc文件的这一部分:

:if system('pwd') =~ "/full/path/to/base/of/repo" 
: au BufWritePost * !snk 
:endif 

这是一阶近似一个解决我的问题,我希望它能帮助!

谢谢vipraptor