comparison .shell.d/50.vcs_functions.sh @ 61:79c2c3932362

Add hg-svn-merge-branch which does all the steps of merging an hg branch for me.
author Augie Fackler <durin42@gmail.com>
date Tue, 03 Mar 2009 11:32:17 -0600
parents 87b2ccf6ec44
children f9e826bd1f1b
comparison
equal deleted inserted replaced
60:87b2ccf6ec44 61:79c2c3932362
25 fi 25 fi
26 if [ x"$url" = "x" ] ; then 26 if [ x"$url" = "x" ] ; then
27 echo -n 'No repo found (tried svn, git-svn, hgsvnclient)' 27 echo -n 'No repo found (tried svn, git-svn, hgsvnclient)'
28 fi 28 fi
29 echo $url 29 echo $url
30 }
31
32 function hg-svn-merge-branch() {
33 local targetrev
34 local striprev
35 targetrev=$(hg id | cut -d ' ' -f 1)
36 hg merge $1
37 hg ci -m "Merging $1"
38 striprev=$(hg id | cut -d ' ' -f 1)
39 hg co $targetrev
40 hg diff -r$targetrev:$striprev | hg import - -m "Merged branch $1."
41 hg strip $striprev
30 } 42 }
31 43
32 function hg-svn-rebase-all() { 44 function hg-svn-rebase-all() {
33 for b in `hg llog -u 'Augie Fackler <durin42@gmail.com>' --template '{branches}\n' | sort | uniq` 45 for b in `hg llog -u 'Augie Fackler <durin42@gmail.com>' --template '{branches}\n' | sort | uniq`
34 do 46 do