Commits

Augie Fackler committed 74990ae

hg-rebase-all: defend against no bookmarks being set

Comments (0)

Files changed (1)

.shell.d/50.hg_functions.sh

         echo 'abort: tip is essentially never what you mean here'
         return 2
     fi
-    for b in $(hg book | sed 's/^ \*/  /' | awk '{ print $1 }') ; do
+    marks=$(hg book | sed 's/^ \*/  /' | awk '{ print $1 }')
+    if [ "$marks" = "no bookmarks set" ] ; then
+      echo "no bookmarks set, nothing to rebase"
+    fi
+    for b in $(echo $marks) ; do
         echo "About to rebase $b"
         hg co --clean $b
         out=$(hg rebase -d "$1")