Show More
@@ -1,180 +1,89 | |||||
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 |
|
13 | |||
13 | svnadmin create svn-repo |
|
14 | svnadmin create svn-repo | |
14 |
|
15 | |||
15 | echo % initial svn import |
|
|||
16 | mkdir t |
|
|||
17 | cd t |
|
|||
18 | echo a > a |
|
|||
19 | cd .. |
|
|||
20 |
|
||||
21 | svnpath=`pwd | fix_path` |
|
16 | svnpath=`pwd | fix_path` | |
22 | # SVN wants all paths to start with a slash. Unfortunately, |
|
17 | # SVN wants all paths to start with a slash. Unfortunately, | |
23 | # Windows ones don't. Handle that. |
|
18 | # Windows ones don't. Handle that. | |
24 | expr $svnpath : "\/" > /dev/null |
|
19 | expr $svnpath : "\/" > /dev/null | |
25 | if [ $? -ne 0 ]; then |
|
20 | if [ $? -ne 0 ]; then | |
26 | svnpath='/'$svnpath |
|
21 | svnpath='/'$svnpath | |
27 | fi |
|
22 | fi | |
28 |
|
23 | |||
29 | svnurl=file://$svnpath/svn-repo/trunk/test |
|
|||
30 | svn import -m init t $svnurl | fix_path |
|
|||
31 |
|
||||
32 | echo % update svn repository |
|
|||
33 | svn co $svnurl t2 | fix_path |
|
|||
34 | cd t2 |
|
|||
35 | echo b >> a |
|
|||
36 | echo b > b |
|
|||
37 | svn add b |
|
|||
38 | svn ci -m changea |
|
|||
39 | cd .. |
|
|||
40 |
|
||||
41 | echo % convert to hg once |
|
|||
42 | hg convert $svnurl |
|
|||
43 |
|
||||
44 | echo % update svn repository again |
|
|||
45 | cd t2 |
|
|||
46 | echo c >> a |
|
|||
47 | echo c >> b |
|
|||
48 | svn ci -m changeb |
|
|||
49 | cd .. |
|
|||
50 |
|
||||
51 | echo % test incremental conversion |
|
|||
52 | hg convert -v $svnurl | sed 's/source:.*/source:/' |
|
|||
53 |
|
||||
54 | echo % test filemap |
|
|||
55 | echo 'include b' > filemap |
|
|||
56 | hg convert --filemap filemap $svnurl fmap |
|
|||
57 | echo '[extensions]' >> $HGRCPATH |
|
|||
58 | echo 'hgext.graphlog =' >> $HGRCPATH |
|
|||
59 | hg glog -R fmap --template '#rev# #desc|firstline# files: #files#\n' |
|
|||
60 |
|
||||
61 | echo % test stop revision |
|
|||
62 | hg convert --rev 1 $svnurl stoprev |
|
|||
63 | # Check convert_revision extra-records. |
|
|||
64 | # This is also the only place testing more than one extra field |
|
|||
65 | # in a revision. |
|
|||
66 | hg --cwd stoprev tip --debug | grep extra | sed 's/=.*/=/' |
|
|||
67 |
|
||||
68 | ######################################## |
|
|||
69 |
|
||||
70 | echo "# now tests that it works with trunk/branches/tags layout" |
|
|||
71 | echo |
|
|||
72 | echo % initial svn import |
|
|||
73 | mkdir projA |
|
|||
74 | cd projA |
|
|||
75 | mkdir trunk |
|
|||
76 | mkdir branches |
|
|||
77 | mkdir tags |
|
|||
78 | cd .. |
|
|||
79 |
|
||||
80 | svnurl=file://$svnpath/svn-repo/projA |
|
|||
81 | svn import -m "init projA" projA $svnurl | fix_path |
|
|||
82 |
|
||||
83 |
|
||||
84 | echo % update svn repository |
|
|||
85 | svn co $svnurl/trunk A | fix_path |
|
|||
86 | cd A |
|
|||
87 | echo hello > letter.txt |
|
|||
88 | svn add letter.txt |
|
|||
89 | svn ci -m hello |
|
|||
90 |
|
||||
91 | echo world >> letter.txt |
|
|||
92 | svn ci -m world |
|
|||
93 |
|
||||
94 | svn copy -m "tag v0.1" $svnurl/trunk $svnurl/tags/v0.1 |
|
|||
95 |
|
||||
96 | echo 'nice day today!' >> letter.txt |
|
|||
97 | svn ci -m "nice day" |
|
|||
98 | cd .. |
|
|||
99 |
|
||||
100 | echo % convert to hg once |
|
|||
101 | hg convert $svnurl A-hg |
|
|||
102 |
|
||||
103 | echo % update svn repository again |
|
|||
104 | cd A |
|
|||
105 | echo "see second letter" >> letter.txt |
|
|||
106 | # Put it in a subdirectory to test duplicate file records |
|
|||
107 | # from svn source (issue 714) |
|
|||
108 | mkdir todo |
|
|||
109 | echo "nice to meet you" > todo/letter2.txt |
|
|||
110 | svn add todo |
|
|||
111 | svn ci -m "second letter" |
|
|||
112 |
|
||||
113 | svn copy -m "tag v0.2" $svnurl/trunk $svnurl/tags/v0.2 |
|
|||
114 |
|
||||
115 | echo "blah-blah-blah" >> todo/letter2.txt |
|
|||
116 | svn ci -m "work in progress" |
|
|||
117 | cd .. |
|
|||
118 |
|
||||
119 | echo % test incremental conversion |
|
|||
120 | hg convert $svnurl A-hg |
|
|||
121 |
|
||||
122 | cd A-hg |
|
|||
123 | hg glog --template '#rev# #desc|firstline# files: #files#\n' |
|
|||
124 | hg tags -q |
|
|||
125 | cd .. |
|
|||
126 |
|
||||
127 | ######################################## |
|
|||
128 |
|
||||
129 | echo "# now tests that it works with trunk/tags layout, but no branches yet" |
|
24 | echo "# now tests that it works with trunk/tags layout, but no branches yet" | |
130 | echo |
|
25 | echo | |
131 | echo % initial svn import |
|
26 | echo % initial svn import | |
132 | mkdir projB |
|
27 | mkdir projB | |
133 | cd projB |
|
28 | cd projB | |
134 | mkdir trunk |
|
29 | mkdir trunk | |
135 | mkdir tags |
|
30 | mkdir tags | |
136 | cd .. |
|
31 | cd .. | |
137 |
|
32 | |||
138 | svnurl=file://$svnpath/svn-repo/projB |
|
33 | svnurl=file://$svnpath/svn-repo/projB | |
139 | svn import -m "init projB" projB $svnurl | fix_path |
|
34 | svn import -m "init projB" projB $svnurl | fix_path | |
140 |
|
35 | |||
141 |
|
36 | |||
142 | echo % update svn repository |
|
37 | echo % update svn repository | |
143 | svn co $svnurl/trunk B | fix_path |
|
38 | svn co $svnurl/trunk B | fix_path | |
144 | cd B |
|
39 | cd B | |
145 | echo hello > letter.txt |
|
40 | echo hello > letter.txt | |
146 | svn add letter.txt |
|
41 | svn add letter.txt | |
147 | svn ci -m hello |
|
42 | svn ci -m hello | |
148 |
|
43 | |||
149 | echo world >> letter.txt |
|
44 | echo world >> letter.txt | |
150 | svn ci -m world |
|
45 | svn ci -m world | |
151 |
|
46 | |||
152 | svn copy -m "tag v0.1" $svnurl/trunk $svnurl/tags/v0.1 |
|
47 | svn copy -m "tag v0.1" $svnurl/trunk $svnurl/tags/v0.1 | |
153 |
|
48 | |||
154 | echo 'nice day today!' >> letter.txt |
|
49 | echo 'nice day today!' >> letter.txt | |
155 | svn ci -m "nice day" |
|
50 | svn ci -m "nice day" | |
156 | cd .. |
|
51 | cd .. | |
157 |
|
52 | |||
158 | echo % convert to hg once |
|
53 | echo % convert to hg once | |
159 | hg convert $svnurl B-hg |
|
54 | hg convert $svnurl B-hg | |
160 |
|
55 | |||
161 | echo % update svn repository again |
|
56 | echo % update svn repository again | |
162 | cd B |
|
57 | cd B | |
163 | echo "see second letter" >> letter.txt |
|
58 | echo "see second letter" >> letter.txt | |
164 | echo "nice to meet you" > letter2.txt |
|
59 | echo "nice to meet you" > letter2.txt | |
165 | svn add letter2.txt |
|
60 | svn add letter2.txt | |
166 | svn ci -m "second letter" |
|
61 | svn ci -m "second letter" | |
167 |
|
62 | |||
168 | svn copy -m "tag v0.2" $svnurl/trunk $svnurl/tags/v0.2 |
|
63 | svn copy -m "tag v0.2" $svnurl/trunk $svnurl/tags/v0.2 | |
169 |
|
64 | |||
170 | echo "blah-blah-blah" >> letter2.txt |
|
65 | echo "blah-blah-blah" >> letter2.txt | |
171 | svn ci -m "work in progress" |
|
66 | svn ci -m "work in progress" | |
172 | cd .. |
|
67 | cd .. | |
173 |
|
68 | |||
|
69 | ######################################## | |||
|
70 | ||||
174 | echo % test incremental conversion |
|
71 | echo % test incremental conversion | |
175 | hg convert $svnurl B-hg |
|
72 | hg convert $svnurl B-hg | |
176 |
|
73 | |||
177 | cd B-hg |
|
74 | cd B-hg | |
178 | hg glog --template '#rev# #desc|firstline# files: #files#\n' |
|
75 | hg glog --template '#rev# #desc|firstline# files: #files#\n' | |
179 | hg tags -q |
|
76 | hg tags -q | |
180 | cd .. |
|
77 | cd .. | |
|
78 | ||||
|
79 | echo % test filemap | |||
|
80 | echo 'include letter2.txt' > filemap | |||
|
81 | hg convert --filemap filemap $svnurl/trunk fmap | |||
|
82 | hg glog -R fmap --template '#rev# #desc|firstline# files: #files#\n' | |||
|
83 | ||||
|
84 | echo % test stop revision | |||
|
85 | hg convert --rev 1 $svnurl/trunk stoprev | |||
|
86 | # Check convert_revision extra-records. | |||
|
87 | # This is also the only place testing more than one extra field | |||
|
88 | # in a revision. | |||
|
89 | hg --cwd stoprev tip --debug | grep extra | sed 's/=.*/=/' |
@@ -1,195 +1,91 | |||||
1 | % initial svn import |
|
|||
2 | Adding t/a |
|
|||
3 |
|
||||
4 | Committed revision 1. |
|
|||
5 | % update svn repository |
|
|||
6 | A t2/a |
|
|||
7 | Checked out revision 1. |
|
|||
8 | A b |
|
|||
9 | Sending a |
|
|||
10 | Adding b |
|
|||
11 | Transmitting file data .. |
|
|||
12 | Committed revision 2. |
|
|||
13 | % convert to hg once |
|
|||
14 | assuming destination test-hg |
|
|||
15 | initializing destination test-hg repository |
|
|||
16 | scanning source... |
|
|||
17 | sorting... |
|
|||
18 | converting... |
|
|||
19 | 1 init |
|
|||
20 | 0 changea |
|
|||
21 | % update svn repository again |
|
|||
22 | Sending a |
|
|||
23 | Sending b |
|
|||
24 | Transmitting file data .. |
|
|||
25 | Committed revision 3. |
|
|||
26 | % test incremental conversion |
|
|||
27 | assuming destination test-hg |
|
|||
28 | scanning source... |
|
|||
29 | fetching revision log for "/trunk/test" from 3 to 2 |
|
|||
30 | sorting... |
|
|||
31 | converting... |
|
|||
32 | 0 changeb |
|
|||
33 | source: |
|
|||
34 | a |
|
|||
35 | b |
|
|||
36 | no tags found at revision 3 |
|
|||
37 | % test filemap |
|
|||
38 | initializing destination fmap repository |
|
|||
39 | scanning source... |
|
|||
40 | sorting... |
|
|||
41 | converting... |
|
|||
42 | 2 init |
|
|||
43 | 1 changea |
|
|||
44 | 0 changeb |
|
|||
45 | o 1 changeb files: b |
|
|||
46 | | |
|
|||
47 | o 0 changea files: b |
|
|||
48 |
|
||||
49 | % test stop revision |
|
|||
50 | initializing destination stoprev repository |
|
|||
51 | scanning source... |
|
|||
52 | sorting... |
|
|||
53 | converting... |
|
|||
54 | 0 init |
|
|||
55 | extra: branch= |
|
|||
56 | extra: convert_revision= |
|
|||
57 | # now tests that it works with trunk/branches/tags layout |
|
|||
58 |
|
||||
59 | % initial svn import |
|
|||
60 | Adding projA/trunk |
|
|||
61 | Adding projA/branches |
|
|||
62 | Adding projA/tags |
|
|||
63 |
|
||||
64 | Committed revision 4. |
|
|||
65 | % update svn repository |
|
|||
66 | Checked out revision 4. |
|
|||
67 | A letter.txt |
|
|||
68 | Adding letter.txt |
|
|||
69 | Transmitting file data . |
|
|||
70 | Committed revision 5. |
|
|||
71 | Sending letter.txt |
|
|||
72 | Transmitting file data . |
|
|||
73 | Committed revision 6. |
|
|||
74 |
|
||||
75 | Committed revision 7. |
|
|||
76 | Sending letter.txt |
|
|||
77 | Transmitting file data . |
|
|||
78 | Committed revision 8. |
|
|||
79 | % convert to hg once |
|
|||
80 | initializing destination A-hg repository |
|
|||
81 | scanning source... |
|
|||
82 | sorting... |
|
|||
83 | converting... |
|
|||
84 | 3 init projA |
|
|||
85 | 2 hello |
|
|||
86 | 1 world |
|
|||
87 | 0 nice day |
|
|||
88 | updating tags |
|
|||
89 | % update svn repository again |
|
|||
90 | A todo |
|
|||
91 | A todo/letter2.txt |
|
|||
92 | Sending letter.txt |
|
|||
93 | Adding todo |
|
|||
94 | Adding todo/letter2.txt |
|
|||
95 | Transmitting file data .. |
|
|||
96 | Committed revision 9. |
|
|||
97 |
|
||||
98 | Committed revision 10. |
|
|||
99 | Sending todo/letter2.txt |
|
|||
100 | Transmitting file data . |
|
|||
101 | Committed revision 11. |
|
|||
102 | % test incremental conversion |
|
|||
103 | scanning source... |
|
|||
104 | sorting... |
|
|||
105 | converting... |
|
|||
106 | 1 second letter |
|
|||
107 | 0 work in progress |
|
|||
108 | updating tags |
|
|||
109 | o 7 update tags files: .hgtags |
|
|||
110 | | |
|
|||
111 | o 6 work in progress files: todo/letter2.txt |
|
|||
112 | | |
|
|||
113 | o 5 second letter files: letter.txt todo/letter2.txt |
|
|||
114 | | |
|
|||
115 | o 4 update tags files: .hgtags |
|
|||
116 | | |
|
|||
117 | o 3 nice day files: letter.txt |
|
|||
118 | | |
|
|||
119 | o 2 world files: letter.txt |
|
|||
120 | | |
|
|||
121 | o 1 hello files: letter.txt |
|
|||
122 | | |
|
|||
123 | o 0 init projA files: |
|
|||
124 |
|
||||
125 | tip |
|
|||
126 | v0.2 |
|
|||
127 | v0.1 |
|
|||
128 | # now tests that it works with trunk/tags layout, but no branches yet |
|
1 | # now tests that it works with trunk/tags layout, but no branches yet | |
129 |
|
2 | |||
130 | % initial svn import |
|
3 | % initial svn import | |
131 | Adding projB/trunk |
|
4 | Adding projB/trunk | |
132 | Adding projB/tags |
|
5 | Adding projB/tags | |
133 |
|
6 | |||
134 |
Committed revision 1 |
|
7 | Committed revision 1. | |
135 | % update svn repository |
|
8 | % update svn repository | |
136 |
Checked out revision 1 |
|
9 | Checked out revision 1. | |
137 | A letter.txt |
|
10 | A letter.txt | |
138 | Adding letter.txt |
|
11 | Adding letter.txt | |
139 | Transmitting file data . |
|
12 | Transmitting file data . | |
140 |
Committed revision |
|
13 | Committed revision 2. | |
141 | Sending letter.txt |
|
14 | Sending letter.txt | |
142 | Transmitting file data . |
|
15 | Transmitting file data . | |
143 |
Committed revision |
|
16 | Committed revision 3. | |
144 |
|
17 | |||
145 |
Committed revision |
|
18 | Committed revision 4. | |
146 | Sending letter.txt |
|
19 | Sending letter.txt | |
147 | Transmitting file data . |
|
20 | Transmitting file data . | |
148 |
Committed revision |
|
21 | Committed revision 5. | |
149 | % convert to hg once |
|
22 | % convert to hg once | |
150 | initializing destination B-hg repository |
|
23 | initializing destination B-hg repository | |
151 | scanning source... |
|
24 | scanning source... | |
152 | sorting... |
|
25 | sorting... | |
153 | converting... |
|
26 | converting... | |
154 | 3 init projB |
|
27 | 3 init projB | |
155 | 2 hello |
|
28 | 2 hello | |
156 | 1 world |
|
29 | 1 world | |
157 | 0 nice day |
|
30 | 0 nice day | |
158 | updating tags |
|
31 | updating tags | |
159 | % update svn repository again |
|
32 | % update svn repository again | |
160 | A letter2.txt |
|
33 | A letter2.txt | |
161 | Sending letter.txt |
|
34 | Sending letter.txt | |
162 | Adding letter2.txt |
|
35 | Adding letter2.txt | |
163 | Transmitting file data .. |
|
36 | Transmitting file data .. | |
164 |
Committed revision |
|
37 | Committed revision 6. | |
165 |
|
38 | |||
166 |
Committed revision |
|
39 | Committed revision 7. | |
167 | Sending letter2.txt |
|
40 | Sending letter2.txt | |
168 | Transmitting file data . |
|
41 | Transmitting file data . | |
169 |
Committed revision |
|
42 | Committed revision 8. | |
170 | % test incremental conversion |
|
43 | % test incremental conversion | |
171 | scanning source... |
|
44 | scanning source... | |
172 | sorting... |
|
45 | sorting... | |
173 | converting... |
|
46 | converting... | |
174 | 1 second letter |
|
47 | 1 second letter | |
175 | 0 work in progress |
|
48 | 0 work in progress | |
176 | updating tags |
|
49 | updating tags | |
177 | o 7 update tags files: .hgtags |
|
50 | o 7 update tags files: .hgtags | |
178 | | |
|
51 | | | |
179 | o 6 work in progress files: letter2.txt |
|
52 | o 6 work in progress files: letter2.txt | |
180 | | |
|
53 | | | |
181 | o 5 second letter files: letter.txt letter2.txt |
|
54 | o 5 second letter files: letter.txt letter2.txt | |
182 | | |
|
55 | | | |
183 | o 4 update tags files: .hgtags |
|
56 | o 4 update tags files: .hgtags | |
184 | | |
|
57 | | | |
185 | o 3 nice day files: letter.txt |
|
58 | o 3 nice day files: letter.txt | |
186 | | |
|
59 | | | |
187 | o 2 world files: letter.txt |
|
60 | o 2 world files: letter.txt | |
188 | | |
|
61 | | | |
189 | o 1 hello files: letter.txt |
|
62 | o 1 hello files: letter.txt | |
190 | | |
|
63 | | | |
191 | o 0 init projB files: |
|
64 | o 0 init projB files: | |
192 |
|
65 | |||
193 | tip |
|
66 | tip | |
194 | v0.2 |
|
67 | v0.2 | |
195 | v0.1 |
|
68 | v0.1 | |
|
69 | % test filemap | |||
|
70 | initializing destination fmap repository | |||
|
71 | scanning source... | |||
|
72 | sorting... | |||
|
73 | converting... | |||
|
74 | 5 init projB | |||
|
75 | 4 hello | |||
|
76 | 3 world | |||
|
77 | 2 nice day | |||
|
78 | 1 second letter | |||
|
79 | 0 work in progress | |||
|
80 | o 1 work in progress files: letter2.txt | |||
|
81 | | | |||
|
82 | o 0 second letter files: letter2.txt | |||
|
83 | ||||
|
84 | % test stop revision | |||
|
85 | initializing destination stoprev repository | |||
|
86 | scanning source... | |||
|
87 | sorting... | |||
|
88 | converting... | |||
|
89 | 0 init projB | |||
|
90 | extra: branch= | |||
|
91 | extra: convert_revision= |
General Comments 0
You need to be logged in to leave comments.
Login now