comparison .shell.d/50.hg_functions.sh @ 309:74990ae54bd2

hg-rebase-all: defend against no bookmarks being set
author Augie Fackler <raf@durin42.com>
date Tue, 29 Jan 2013 16:01:40 -0500
parents d9cc862e6308
children 2b129f63d910
comparison
equal deleted inserted replaced
308:029b0442413b 309:74990ae54bd2
20 fi 20 fi
21 if [ "$1" = "tip" ] ; then 21 if [ "$1" = "tip" ] ; then
22 echo 'abort: tip is essentially never what you mean here' 22 echo 'abort: tip is essentially never what you mean here'
23 return 2 23 return 2
24 fi 24 fi
25 for b in $(hg book | sed 's/^ \*/ /' | awk '{ print $1 }') ; do 25 marks=$(hg book | sed 's/^ \*/ /' | awk '{ print $1 }')
26 if [ "$marks" = "no bookmarks set" ] ; then
27 echo "no bookmarks set, nothing to rebase"
28 fi
29 for b in $(echo $marks) ; do
26 echo "About to rebase $b" 30 echo "About to rebase $b"
27 hg co --clean $b 31 hg co --clean $b
28 out=$(hg rebase -d "$1") 32 out=$(hg rebase -d "$1")
29 code=$? 33 code=$?
30 grep "nothing to rebase" <(echo $out) 34 grep "nothing to rebase" <(echo $out)