Debian Codegraph @

tests/test-convert-svn-branches.t

raw
1 #require svn svn-bindings
2
3 $ cat >> $HGRCPATH <<EOF
4 > [extensions]
5 > convert =
6 > EOF
7
8 $ svnadmin create svn-repo
9 $ svnadmin load -q svn-repo < "$TESTDIR/svn/branches.svndump"
10
11 Convert trunk and branches
12
13 $ cat > branchmap <<EOF
14 > old3 newbranch
15 >
16 >
17 > EOF
18 $ hg convert --branchmap=branchmap --datesort -r 10 svn-repo A-hg
19 initializing destination A-hg repository
20 scanning source...
21 sorting...
22 converting...
23 10 init projA
24 9 hello
25 8 branch trunk, remove c and dir
26 7 change a
27 6 change b
28 5 move and update c
29 4 move and update c
30 3 change b again
31 2 move to old2
32 1 move back to old
33 0 last change to a
34
35 Test template keywords
36
37 $ hg -R A-hg log --template '{rev} {svnuuid}{svnpath}@{svnrev}\n'
38 10 644ede6c-2b81-4367-9dc8-d786514f2cde/trunk@10
39 9 644ede6c-2b81-4367-9dc8-d786514f2cde/branches/old@9
40 8 644ede6c-2b81-4367-9dc8-d786514f2cde/branches/old2@8
41 7 644ede6c-2b81-4367-9dc8-d786514f2cde/branches/old@7
42 6 644ede6c-2b81-4367-9dc8-d786514f2cde/trunk@6
43 5 644ede6c-2b81-4367-9dc8-d786514f2cde/branches/old@6
44 4 644ede6c-2b81-4367-9dc8-d786514f2cde/branches/old@5
45 3 644ede6c-2b81-4367-9dc8-d786514f2cde/trunk@4
46 2 644ede6c-2b81-4367-9dc8-d786514f2cde/branches/old@3
47 1 644ede6c-2b81-4367-9dc8-d786514f2cde/trunk@2
48 0 644ede6c-2b81-4367-9dc8-d786514f2cde/trunk@1
49
50 Convert again
51
52 $ hg convert --branchmap=branchmap --datesort svn-repo A-hg
53 scanning source...
54 sorting...
55 converting...
56 0 branch trunk@1 into old3
57
58 $ cd A-hg
59 $ hg log -G --template 'branch={branches} {rev} {desc|firstline} files: {files}\n'
60 o branch=newbranch 11 branch trunk@1 into old3 files:
61 |
62 | o branch= 10 last change to a files: a
63 | |
64 | | o branch=old 9 move back to old files:
65 | | |
66 | | o branch=old2 8 move to old2 files:
67 | | |
68 | | o branch=old 7 change b again files: b
69 | | |
70 | o | branch= 6 move and update c files: b
71 | | |
72 | | o branch=old 5 move and update c files: c
73 | | |
74 | | o branch=old 4 change b files: b
75 | | |
76 | o | branch= 3 change a files: a
77 | | |
78 | | o branch=old 2 branch trunk, remove c and dir files: c
79 | |/
80 | o branch= 1 hello files: a b c dir/e
81 |/
82 o branch= 0 init projA files:
83
84
85 $ hg branches
86 newbranch 11:a6d7cc050ad1
87 default 10:6e2b33404495
88 old 9:1b494af68c0b
89 old2 8:5be40b8dcbf6 (inactive)
90 $ hg tags -q
91 tip
92 $ cd ..
93
94 Test hg failing to call itself
95
96 $ HG=foobar hg convert svn-repo B-hg 2>&1 | grep abort
97 abort: Mercurial failed to run itself, check hg executable is in PATH
98
99 Convert 'trunk' to branch other than 'default'
100
101 $ cat > branchmap <<EOF
102 > default hgtrunk
103 >
104 >
105 > EOF
106 $ hg convert --branchmap=branchmap --datesort -r 10 svn-repo C-hg
107 initializing destination C-hg repository
108 scanning source...
109 sorting...
110 converting...
111 10 init projA
112 9 hello
113 8 branch trunk, remove c and dir
114 7 change a
115 6 change b
116 5 move and update c
117 4 move and update c
118 3 change b again
119 2 move to old2
120 1 move back to old
121 0 last change to a
122
123 $ cd C-hg
124 $ hg branches --template '{branch}\n'
125 hgtrunk
126 old
127 old2
128 $ cd ..