Mercurial > hg
comparison tests/test-convert-svn-startrev @ 6173:963000ed8cac
convert: add shallow, single branch svn conversions via svn.startrev
author | Patrick Mezard <pmezard@gmail.com> |
---|---|
date | Sun, 24 Feb 2008 17:58:55 +0100 |
parents | |
children | c1b47c0fd2b6 |
comparison
equal
deleted
inserted
replaced
6172:0cd6846e5200 | 6173:963000ed8cac |
---|---|
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 branches | |
29 mkdir tags | |
30 cd .. | |
31 | |
32 svnurl=file://$svnpath/svn-repo/projA | |
33 svn import -m "init projA" projA $svnurl | fix_path | |
34 | |
35 echo % update svn repository | |
36 svn co $svnurl A | fix_path | |
37 cd A | |
38 echo a > trunk/a | |
39 echo b > trunk/b | |
40 svn add trunk/a trunk/b | |
41 svn ci -m createab | |
42 svn rm trunk/b | |
43 svn ci -m removeb | |
44 svn up | |
45 echo a >> trunk/a | |
46 svn ci -m changeaa | |
47 | |
48 echo % branch | |
49 svn up | |
50 svn copy trunk branches/branch1 | |
51 echo a >> branches/branch1/a | |
52 svn ci -m "branch, changeaaa" | |
53 | |
54 echo a >> branches/branch1/a | |
55 echo c > branches/branch1/c | |
56 svn add branches/branch1/c | |
57 svn ci -m "addc,changeaaaa" | |
58 svn up | |
59 cd .. | |
60 | |
61 convert() | |
62 { | |
63 startrev=$1 | |
64 repopath=A-r$startrev-hg | |
65 hg convert --config convert.svn.startrev=$startrev \ | |
66 --config convert.svn.trunk=branches/branch1 \ | |
67 --config convert.svn.branches=" " \ | |
68 --config convert.svn.tags= \ | |
69 --datesort $svnurl $repopath | |
70 hg -R $repopath glog --template '#rev# #desc|firstline# files: #files#\n' | |
71 echo | |
72 } | |
73 | |
74 echo % convert before branching point | |
75 convert 3 | |
76 echo % convert before branching point | |
77 convert 4 | |
78 echo % convert at branching point | |
79 convert 5 | |
80 echo % convert last revision only | |
81 convert 6 |