# HG changeset patch # User Augie Fackler # Date 1359493300 18000 # Node ID 74990ae54bd2e733bbc940f278ee781dbc808bd2 # Parent 029b0442413b742e9ae00c695c3674635d0d20d7 hg-rebase-all: defend against no bookmarks being set diff --git a/.shell.d/50.hg_functions.sh b/.shell.d/50.hg_functions.sh --- a/.shell.d/50.hg_functions.sh +++ b/.shell.d/50.hg_functions.sh @@ -22,7 +22,11 @@ function hg_rebase_all () { 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")