diff .shell.d/50.vcs_functions.sh @ 67:9f8bd97da0d4

hg-svn-rebase-all: improved rebasing so that merges no longer abort rebasing other branches.
author Augie Fackler <durin42@gmail.com>
date Wed, 01 Apr 2009 14:50:38 -0500
parents 1b4067cc97ca
children 5232fa3d7ad3
line wrap: on
line diff
--- a/.shell.d/50.vcs_functions.sh
+++ b/.shell.d/50.vcs_functions.sh
@@ -57,7 +57,18 @@ function hg-svn-merge-branch() {
 function hg-svn-rebase-all() {
     for b in `hg llog -u 'Augie Fackler <durin42@gmail.com>' --template '{branches}\n' | sort | uniq`
     do
-        hg co $b && hg svn rebase || return
+        echo "rebase $b"
+        hg co $b
+        if [[ "$?" != "0" ]] ; then
+            echo "abort: could not checkout $b"
+            return
+        fi
+        hg parent --svn > /dev/null
+        if [[ "$?" == "0" ]] ; then
+            hg svn rebase || return
+        else
+            echo "Skip $b since it has a merge."
+        fi
     done
 }