# HG changeset patch # User Augie Fackler # Date 1264528119 21600 # Node ID efa2bfc73d2da79646679974fb57740f394b45d5 # Parent fe810e9731f05b49d318f4006f6c2520c2028402 update-source-trees: recurse to find all VCS working copies diff --git a/.shell.d/50.vcs_functions.sh b/.shell.d/50.vcs_functions.sh --- a/.shell.d/50.vcs_functions.sh +++ b/.shell.d/50.vcs_functions.sh @@ -125,6 +125,11 @@ function clean_svn_source_trees() { # Function to update source trees of known VCS tools in the working dir. # "known" means ones I'm forced to use on a regular basis function update_source_trees() { + if ! ls -l | egrep ^d > /dev/null ; then + ls -l | egrep ^d + return + fi + local hgpath for aa in */ ; do pushd $aa > /dev/null || continue if [ -e .svn ] ; then @@ -140,21 +145,22 @@ function update_source_trees() { elif [ -e .git/svn ] ; then echo $aa 'is a git-svn checkout, updating' git svn fetch - git repack - git gc elif [ -e .git ] ; then echo $aa 'is a git checkout, updating' git pull origin master - git repack - git gc elif [ -e .hg ] ; then - echo $aa 'is an hg checkout, updating' && hg pull && hg up + echo $aa 'is an hg checkout, updating' + for hgpath in $(HGRCPATH=/dev/null hg paths | sed 's/.* = //g' | sort | uniq ) ; do + hg pull --update $hgpath + done if [ -e .hg/patches/.hg ] ; then echo $aa 'has an mq, updating that too...' hg -R .hg/patches pull -u fi elif [ -e _MTN ] ; then echo $aa "is an mtn co, updating" && mtn pull && mtn up + else + update_source_trees fi popd > /dev/null done