comparison .shell.d/50.hg_functions.sh @ 228:0c8939baa35c

hg-rebase-all: new function to rebase all bookmarked revisions
author Augie Fackler <durin42@gmail.com>
date Sat, 09 Oct 2010 15:21:50 -0500
parents 0590f34b92a0
children 6da5a4729bc7
comparison
equal deleted inserted replaced
227:e8170eba88cd 228:0c8939baa35c
8 } 8 }
9 9
10 function mq-snapshot () { 10 function mq-snapshot () {
11 mq ci -m "Applied on $(hg log -r qparent --template '{node|short}\n')" 11 mq ci -m "Applied on $(hg log -r qparent --template '{node|short}\n')"
12 } 12 }
13
14 function hg_rebase_all () {
15 hg sum | grep 'commit: .* (clean)$' || (echo 'abort: wc not clean' ; return 1) || return 1
16 if [ "x$1" = "x" ] ; then
17 echo 'abort: give destination for rebase'
18 return 2
19 fi
20 if [ "$1" = "tip" ] ; then
21 echo 'abort: tip is essentially never what you mean here'
22 return 2
23 fi
24 for b in $(hg book | sed 's/^ \*/ /' | awk '{ print $1 }') ; do
25 hg co --clean $book
26 hg rebase -d "$1"
27 done
28 }
29 alias hg-rebase-all=hg_rebase_all
13 30
14 function hgsvnmergebranch() { 31 function hgsvnmergebranch() {
15 local targetrev 32 local targetrev
16 local striprev 33 local striprev
17 targetrev=$(hg id | cut -d ' ' -f 1) 34 targetrev=$(hg id | cut -d ' ' -f 1)