changeset 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 31a11febd751
children e4aa44f30f2c
files .shell.d/50.vcs_functions.sh
diffstat 1 files changed, 12 insertions(+), 1 deletions(-) [+]
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
 }