Mercurial > hg
changeset 6398:0e91ef0b52e7
Add a test for svn tags conversion
author | Patrick Mezard <pmezard@gmail.com> |
---|---|
date | Sat, 29 Mar 2008 17:15:43 +0100 |
parents | e1402cf5e08a |
children | 5efd447a9b8d |
files | tests/test-convert-svn-tags tests/test-convert-svn-tags.out |
diffstat | 2 files changed, 114 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/test-convert-svn-tags Sat Mar 29 17:15:43 2008 +0100 @@ -0,0 +1,59 @@ +#!/bin/sh + +"$TESTDIR/hghave" svn svn-bindings || exit 80 + +fix_path() +{ + tr '\\' / +} + +echo "[extensions]" >> $HGRCPATH +echo "convert = " >> $HGRCPATH +echo "hgext.graphlog =" >> $HGRCPATH + +svnadmin create svn-repo + +svnpath=`pwd | fix_path` +# SVN wants all paths to start with a slash. Unfortunately, +# Windows ones don't. Handle that. +expr $svnpath : "\/" > /dev/null +if [ $? -ne 0 ]; then + svnpath='/'$svnpath +fi + +echo % initial svn import +mkdir projA +cd projA +mkdir trunk +mkdir branches +mkdir tags +cd .. + +svnurl=file://$svnpath/svn-repo/projA +svn import -m "init projA" projA $svnurl | fix_path + +echo % update svn repository +svn co $svnurl A | fix_path +cd A +echo a > trunk/a +svn add trunk/a +svn ci -m adda +echo a >> trunk/a +svn ci -m changea +echo a >> trunk/a +svn ci -m changea2 +echo % tag current revision +svn up +svn copy trunk tags/trunk.v1 +svn ci -m "tagging trunk.v1" +echo a >> trunk/a +svn ci -m changea3 +cd .. + +echo % convert +hg convert --datesort $svnurl A-hg + +cd A-hg +hg glog --template '#rev# #desc|firstline# tags: #tags#\n' +hg tags -q +cd ..
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/test-convert-svn-tags.out Sat Mar 29 17:15:43 2008 +0100 @@ -0,0 +1,55 @@ +% initial svn import +Adding projA/trunk +Adding projA/branches +Adding projA/tags + +Committed revision 1. +% update svn repository +A A/trunk +A A/branches +A A/tags +Checked out revision 1. +A trunk/a +Adding trunk/a +Transmitting file data . +Committed revision 2. +Sending trunk/a +Transmitting file data . +Committed revision 3. +Sending trunk/a +Transmitting file data . +Committed revision 4. +% tag current revision +At revision 4. +A tags/trunk.v1 +Adding tags/trunk.v1 + +Committed revision 5. +Sending trunk/a +Transmitting file data . +Committed revision 6. +% convert +initializing destination A-hg repository +scanning source... +sorting... +converting... +4 init projA +3 adda +2 changea +1 changea2 +0 changea3 +updating tags +o 5 update tags tags: tip +| +o 4 changea3 tags: +| +o 3 changea2 tags: trunk.v1 +| +o 2 changea tags: +| +o 1 adda tags: +| +o 0 init projA tags: + +tip +trunk.v1