Created
February 14, 2011 08:14
-
-
Save arjan/825603 to your computer and use it in GitHub Desktop.
Backport latest zotonic commit to the most recent release branch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ "`hg branch`" != "default" ]; then | |
echo "You need to be on the default branch." | |
exit | |
fi | |
REV="`hg parents |grep changeset|awk -F: '{print $2}'`" | |
REV=`echo $REV` # trim whitespace | |
TARGET=$1 | |
if [ "$TARGET" = "" ]; then | |
# take most recent branch | |
TARGET=`hg branches|grep release|head -n 1|awk '{print $1}'` | |
fi | |
echo "Backporting revision $REV to $TARGET" | |
hg export $REV > /tmp/$REV.patch | |
hg update $TARGET | |
hg import /tmp/$REV.patch | |
hg update default |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment