comparison tests/test-convert-svn-move @ 5955:c4496b7c10ce

convert: fix svn_source.latest()
author Patrick Mezard <pmezard@gmail.com>
date Sat, 26 Jan 2008 14:45:04 +0100
parents
children 971a17af5982
comparison
equal deleted inserted replaced
5954:851402e53337 5955:c4496b7c10ce
1 #!/bin/sh
2
3 "$TESTDIR/hghave" svn svn-bindings || exit 80
4
5 fix_path()
6 {
7 tr '\\' /
8 }
9
10 echo "[extensions]" >> $HGRCPATH
11 echo "convert = " >> $HGRCPATH
12 echo "hgext.graphlog =" >> $HGRCPATH
13
14 svnadmin create svn-repo
15
16 svnpath=`pwd | fix_path`
17 # SVN wants all paths to start with a slash. Unfortunately,
18 # Windows ones don't. Handle that.
19 expr $svnpath : "\/" > /dev/null
20 if [ $? -ne 0 ]; then
21 svnpath='/'$svnpath
22 fi
23
24 echo % initial svn import
25 mkdir projA
26 cd projA
27 mkdir trunk
28 mkdir trunk/d1
29 echo b > trunk/d1/b
30 cd ..
31
32 svnurl=file://$svnpath/svn-repo/projA
33 svn import -m "init projA" projA $svnurl | fix_path
34
35 # Build a module renaming chain which used to confuse the converter.
36 echo % update svn repository
37 svn co $svnurl A | fix_path
38 cd A
39 svn mv $svnurl/trunk $svnurl/subproject -m movedtrunk
40 svn up
41 mkdir subproject/trunk
42 svn add subproject/trunk
43 svn ci -m createtrunk
44 mkdir subproject/branches
45 svn add subproject/branches
46 svn ci -m createbranches
47 svn mv $svnurl/subproject/d1 $svnurl/subproject/trunk/d1 -m moved1
48 svn up
49 echo b >> subproject/trunk/d1/b
50 svn ci -m changeb
51 svn mv $svnurl/subproject/trunk/d1 $svnurl/subproject/branches/d1 -m moved1again
52 cd ..
53
54 echo % convert trunk and branches
55 hg convert --datesort $svnurl/subproject A-hg
56
57 cd A-hg
58 hg glog --template '#rev# #desc|firstline# files: #files#\n'
59 hg branches | sed 's/:.*/:/'
60 cd ..