summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorColin Guthrie <colin@mageia.org>2013-06-11 23:34:53 +0100
committerColin Guthrie <colin@mageia.org>2013-06-12 09:12:37 +0100
commit7d02bfadfe76d6701201531ffcaa867ea1c869eb (patch)
tree0cbf8d728a7ae6b393a5222964fddfafbad5d6fa /scripts
parentb1314b6bb89c321830373266c84a965f171853dd (diff)
downloadsvn-git-migration-7d02bfadfe76d6701201531ffcaa867ea1c869eb.tar
svn-git-migration-7d02bfadfe76d6701201531ffcaa867ea1c869eb.tar.gz
svn-git-migration-7d02bfadfe76d6701201531ffcaa867ea1c869eb.tar.bz2
svn-git-migration-7d02bfadfe76d6701201531ffcaa867ea1c869eb.tar.xz
svn-git-migration-7d02bfadfe76d6701201531ffcaa867ea1c869eb.zip
Add a simply system to skip revisions.
You can only skip commits that are *after* the last squashed commit.
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/mageia-reset-and-import.sh40
1 files changed, 36 insertions, 4 deletions
diff --git a/scripts/mageia-reset-and-import.sh b/scripts/mageia-reset-and-import.sh
index fd74a61..b24abe5 100755
--- a/scripts/mageia-reset-and-import.sh
+++ b/scripts/mageia-reset-and-import.sh
@@ -25,7 +25,8 @@ if [ -f ../svn-import.log ]; then
resetsha1=$(echo $REPLAYDATA | cut -d',' -f 2)
revision=$(echo $REPLAYDATA | cut -d',' -f 3)
morerevisionsx=$(echo $REPLAYDATA | cut -d',' -f 4)
- synthesized=$(echo $REPLAYDATA | cut -d',' -f 5)
+ skiprevisionsx=$(echo $REPLAYDATA | cut -d',' -f 5)
+ synthesized=$(echo $REPLAYDATA | cut -d',' -f 6)
echo
echo "I have found data from a previous run:"
@@ -33,6 +34,7 @@ if [ -f ../svn-import.log ]; then
echo "Reset SHA1: $resetsha1"
echo "Mageia Import SVN Revision: $revision"
echo "Extra SVN Revisions to squash:$morerevisionsx"
+ echo "SVN Revisions to skip: $skiprevisionsx"
echo
echo "Do you want to reply it? [Y/n]"
read REPLAY
@@ -140,6 +142,26 @@ if [ -n "$morerevisionsx" ]; then
echo " $morerevisions"
echo
fi
+
+if [ -z "$REPLAY" ]; then
+ echo "Now enter any commits you wish to skip completely (e.g. for commits+reverts)"
+ read skiprevisionsx
+fi
+skiprevisionsx=$(echo $skiprevisionsx | trim)
+if [ -n "$skiprevisionsx" ]; then
+ for rev in $skiprevisionsx; do
+ rev=$(echo $rev | sed 's/r//g')
+ rev=$(( $rev + 0 ))
+ if [ $rev -gt 0 ]; then
+ skiprevisions="$skiprevisions $rev"
+ fi
+ done
+ echo
+ echo "OK, you said you wanted to skip the following commits:"
+ echo " $skiprevisions"
+ echo
+fi
+
echo
echo "The next step is the dangerous bit. We will clear out all files in the current"
echo "working copy, run an svn export and then drop you to a shell to investigate the differences"
@@ -206,7 +228,7 @@ if [ -n "$morerevisions" ]; then
done
fi
-COMMITDATE=$(svn log -r $revision $NEWSVNURL/$SOFTWARE | head -n2 | tail -n1| cut -d'|' -f3 | cut -d'(' -f1 | trim)
+COMMITDATE=$(svn log -r $revision $NEWSVNURL/$SOFTWARE | head -n2 | tail -n1 | cut -d'|' -f3 | cut -d'(' -f1 | trim)
git commit --author="Mageia SVN-Git Migration <svn-git-migration@mageia.org>" --date="$COMMITDATE" --file=$COMMITTXT -a
rm -f $COMMITTXT
@@ -229,9 +251,9 @@ echo "done"
# Keep a small log of the sha1's etc.
if [ -z "$REPLAY" ]; then
if [ ! -f ../svn-import.log ]; then
- echo "software,startingcommit,startingrevision,otherrevisions,fakecommit" >../svn-import.log
+ echo "software,startingcommit,startingrevision,otherrevisions,skiprevisions,fakecommit" >../svn-import.log
fi
- echo "$SOFTWARE,$resetsha1,$revision,$morerevisions,$sha1" >>../svn-import.log
+ echo "$SOFTWARE,$resetsha1,$revision,$morerevisions,$skiprevisions,$sha1" >>../svn-import.log
else
sed -i "s/,$synthesized\$/,$sha1/" ../svn-import.log
fi
@@ -243,6 +265,16 @@ if [ -n "$morerevisions" ]; then
revision=$rev
done
fi
+
+# Note the revisions to skip have to be after any squashed revisions which we
+# should really check for....
+if [ -n "$skiprevisions" ]; then
+ for rev in $skiprevisions; do
+ git svn fetch -A ../authors-transform.txt -r $(( $revision + 1 )):$(( $rev - 1 ))
+ revision=$rev
+ done
+fi
+
git svn fetch -A ../authors-transform.txt -r $(( $revision + 1 )):HEAD
git reset --hard trunk
echo