diff .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
line wrap: on
line diff
--- a/.shell.d/50.vcs_functions.sh
+++ b/.shell.d/50.vcs_functions.sh
@@ -29,6 +29,18 @@ function svnurlof() {
     echo $url
 }
 
+function hg-svn-merge-branch() {
+    local targetrev
+    local striprev
+    targetrev=$(hg id | cut -d ' ' -f 1)
+    hg merge $1
+    hg ci -m "Merging $1"
+    striprev=$(hg id | cut -d ' ' -f 1)
+    hg co $targetrev
+    hg diff -r$targetrev:$striprev | hg import - -m "Merged branch $1."
+    hg strip $striprev
+}
+
 function hg-svn-rebase-all() {
     for b in `hg llog -u 'Augie Fackler <durin42@gmail.com>' --template '{branches}\n' | sort | uniq`
     do