Created
May 25, 2010 18:58
-
-
Save pix0r/413534 to your computer and use it in GitHub Desktop.
This file contains 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/sh | |
# | |
# svn-revs-tortoise-to-cmdline.sh | |
# | |
# converts merges from TortoiseSVN-type format to individual svn merge commands. | |
# mergefile should contain a newline-delimited list of the revision list that TortoiseSVN | |
# outputs. Eg: "1,3,6-8,11,15" should be "1\n3\n6-8\n11\n15" | |
trunk=http://my.repo/trunk | |
mergefile=merges.txt | |
for rev in `cat $mergefile`; do | |
if [ "$rev" = "" ]; then | |
echo "stopped" | |
exit 0 | |
fi | |
if [ "`echo $rev | grep :`" = "" ]; then | |
prev=`echo $rev - 1 | bc` | |
cmd="svn merge -r$prev:$rev $trunk" | |
else | |
reva=`echo $rev | sed -e s/:.*//` | |
preva=`echo $reva - 1 | bc` | |
revb=`echo $rev | sed -e s/.*://` | |
cmd="svn merge -r$preva:$revb $trunk" | |
fi | |
echo "$cmd" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment