2011-11-02 55 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