2013-07-08 21 views

回答

2

什麼在您的「做某事」問題中被視爲「某事」?

如果你的意思是「新的變更到了」你可以很容易地通過做測試,在推進:

if hg incoming ; then 
    hg pull 
    hg update 
    ... other stuff here. 
fi 

如果你的意思是「在工作目錄中的文件發生了改變」,那麼你需要檢查輸出hg更新:

hg pull 
if test "$(hg update)" != "0 files updated, 0 files merged, 0 files removed, 0 files unresolved" ; then 
    ... other stuff here ... 

fi 
相關問題