##// END OF EJS Templates
test-convert-svn-*: no longer need the url building code
Patrick Mezard -
r8765:9c75f16f default
parent child Browse files
Show More
@@ -1,39 +1,30
1 #!/bin/sh
1 #!/bin/sh
2
2
3 "$TESTDIR/hghave" svn svn-bindings || exit 80
3 "$TESTDIR/hghave" svn svn-bindings || exit 80
4
4
5 fix_path()
5 fix_path()
6 {
6 {
7 tr '\\' /
7 tr '\\' /
8 }
8 }
9
9
10 echo "[extensions]" >> $HGRCPATH
10 echo "[extensions]" >> $HGRCPATH
11 echo "convert = " >> $HGRCPATH
11 echo "convert = " >> $HGRCPATH
12 echo "hgext.graphlog =" >> $HGRCPATH
12 echo "hgext.graphlog =" >> $HGRCPATH
13
13
14 svnadmin create svn-repo
14 svnadmin create svn-repo
15 cat "$TESTDIR/svn/branches.svndump" | svnadmin load svn-repo > /dev/null
15 cat "$TESTDIR/svn/branches.svndump" | svnadmin load svn-repo > /dev/null
16
16
17 svnpath=`pwd | fix_path`
18 # SVN wants all paths to start with a slash. Unfortunately,
19 # Windows ones don't. Handle that.
20 expr $svnpath : "\/" > /dev/null
21 if [ $? -ne 0 ]; then
22 svnpath='/'$svnpath
23 fi
24 svnurl=file://$svnpath/svn-repo
25
26 echo % convert trunk and branches
17 echo % convert trunk and branches
27 cat >branchmap <<EOF
18 cat >branchmap <<EOF
28 old3 newbranch
19 old3 newbranch
29 EOF
20 EOF
30 hg convert --branchmap=branchmap --datesort -r 10 $svnurl A-hg
21 hg convert --branchmap=branchmap --datesort -r 10 svn-repo A-hg
31
22
32 echo % convert again
23 echo % convert again
33 hg convert --branchmap=branchmap --datesort $svnurl A-hg
24 hg convert --branchmap=branchmap --datesort svn-repo A-hg
34
25
35 cd A-hg
26 cd A-hg
36 hg glog --template 'branch={branches} {rev} {desc|firstline} files: {files}\n'
27 hg glog --template 'branch={branches} {rev} {desc|firstline} files: {files}\n'
37 hg branches | sed 's/:.*/:/'
28 hg branches | sed 's/:.*/:/'
38 hg tags -q
29 hg tags -q
39 cd ..
30 cd ..
@@ -1,46 +1,37
1 #!/bin/sh
1 #!/bin/sh
2
2
3 "$TESTDIR/hghave" svn svn-bindings || exit 80
3 "$TESTDIR/hghave" svn svn-bindings || exit 80
4
4
5 fix_path()
5 fix_path()
6 {
6 {
7 tr '\\' /
7 tr '\\' /
8 }
8 }
9
9
10 echo "[extensions]" >> $HGRCPATH
10 echo "[extensions]" >> $HGRCPATH
11 echo "convert = " >> $HGRCPATH
11 echo "convert = " >> $HGRCPATH
12 echo "hgext.graphlog =" >> $HGRCPATH
12 echo "hgext.graphlog =" >> $HGRCPATH
13
13
14 svnadmin create svn-repo
14 svnadmin create svn-repo
15 cat "$TESTDIR/svn/startrev.svndump" | svnadmin load svn-repo > /dev/null
15 cat "$TESTDIR/svn/startrev.svndump" | svnadmin load svn-repo > /dev/null
16
16
17 svnpath=`pwd | fix_path`
18 # SVN wants all paths to start with a slash. Unfortunately,
19 # Windows ones don't. Handle that.
20 expr $svnpath : "\/" > /dev/null
21 if [ $? -ne 0 ]; then
22 svnpath='/'$svnpath
23 fi
24 svnurl=file://$svnpath/svn-repo
25
26 convert()
17 convert()
27 {
18 {
28 startrev=$1
19 startrev=$1
29 repopath=A-r$startrev-hg
20 repopath=A-r$startrev-hg
30 hg convert --config convert.svn.startrev=$startrev \
21 hg convert --config convert.svn.startrev=$startrev \
31 --config convert.svn.trunk=branches/branch1 \
22 --config convert.svn.trunk=branches/branch1 \
32 --config convert.svn.branches=" " \
23 --config convert.svn.branches=" " \
33 --config convert.svn.tags= \
24 --config convert.svn.tags= \
34 --datesort $svnurl $repopath
25 --datesort svn-repo $repopath
35 hg -R $repopath glog --template '{rev} {desc|firstline} files: {files}\n'
26 hg -R $repopath glog --template '{rev} {desc|firstline} files: {files}\n'
36 echo
27 echo
37 }
28 }
38
29
39 echo % convert before branching point
30 echo % convert before branching point
40 convert 3
31 convert 3
41 echo % convert before branching point
32 echo % convert before branching point
42 convert 4
33 convert 4
43 echo % convert at branching point
34 echo % convert at branching point
44 convert 5
35 convert 5
45 echo % convert last revision only
36 echo % convert last revision only
46 convert 6
37 convert 6
@@ -1,37 +1,28
1 #!/bin/sh
1 #!/bin/sh
2
2
3 "$TESTDIR/hghave" svn svn-bindings || exit 80
3 "$TESTDIR/hghave" svn svn-bindings || exit 80
4
4
5 fix_path()
5 fix_path()
6 {
6 {
7 tr '\\' /
7 tr '\\' /
8 }
8 }
9
9
10 echo "[extensions]" >> $HGRCPATH
10 echo "[extensions]" >> $HGRCPATH
11 echo "convert = " >> $HGRCPATH
11 echo "convert = " >> $HGRCPATH
12 echo "hgext.graphlog =" >> $HGRCPATH
12 echo "hgext.graphlog =" >> $HGRCPATH
13
13
14 svnadmin create svn-repo
14 svnadmin create svn-repo
15 cat "$TESTDIR/svn/tags.svndump" | svnadmin load svn-repo > /dev/null
15 cat "$TESTDIR/svn/tags.svndump" | svnadmin load svn-repo > /dev/null
16
16
17 svnpath=`pwd | fix_path`
18 # SVN wants all paths to start with a slash. Unfortunately,
19 # Windows ones don't. Handle that.
20 expr $svnpath : "\/" > /dev/null
21 if [ $? -ne 0 ]; then
22 svnpath='/'$svnpath
23 fi
24 svnurl=file://$svnpath/svn-repo
25
26 echo % convert
17 echo % convert
27 hg convert --datesort $svnurl A-hg
18 hg convert --datesort svn-repo A-hg
28
19
29 cd A-hg
20 cd A-hg
30 hg glog --template '{rev} {desc|firstline} tags: {tags}\n'
21 hg glog --template '{rev} {desc|firstline} tags: {tags}\n'
31 hg tags | sed 's/:.*/:/'
22 hg tags | sed 's/:.*/:/'
32 cd ..
23 cd ..
33
24
34 echo % convert without tags
25 echo % convert without tags
35 hg convert --datesort --config convert.svn.tags= $svnurl A-notags-hg
26 hg convert --datesort --config convert.svn.tags= svn-repo A-notags-hg
36 hg -R A-notags-hg tags -q
27 hg -R A-notags-hg tags -q
37
28
General Comments 0
You need to be logged in to leave comments. Login now