# HG changeset patch # User Augie Fackler # Date 1236101537 21600 # Node ID 79c2c393236202ec41bf27c396c77b5d8fc76a5e # Parent 87b2ccf6ec44517172e719a071b6d8198e9050c3 Add hg-svn-merge-branch which does all the steps of merging an hg branch for me. diff --git a/.shell.d/50.vcs_functions.sh b/.shell.d/50.vcs_functions.sh --- 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 ' --template '{branches}\n' | sort | uniq` do