Show More
@@ -1,210 +1,210 | |||||
1 |
|
1 | |||
2 | $ "$TESTDIR/hghave" svn svn-bindings || exit 80 |
|
2 | $ "$TESTDIR/hghave" svn svn-bindings || exit 80 | |
3 |
|
3 | |||
4 | $ fixpath() |
|
4 | $ fixpath() | |
5 | > { |
|
5 | > { | |
6 | > tr '\\' / |
|
6 | > tr '\\' / | |
7 | > } |
|
7 | > } | |
8 | $ cat >> $HGRCPATH <<EOF |
|
8 | $ cat >> $HGRCPATH <<EOF | |
9 | > [extensions] |
|
9 | > [extensions] | |
10 | > convert = |
|
10 | > convert = | |
11 | > graphlog = |
|
11 | > graphlog = | |
12 | > [convert] |
|
12 | > [convert] | |
13 | > svn.trunk = mytrunk |
|
13 | > svn.trunk = mytrunk | |
14 | > EOF |
|
14 | > EOF | |
15 |
|
15 | |||
16 | $ svnadmin create svn-repo |
|
16 | $ svnadmin create svn-repo | |
17 | $ svnpath=`pwd | fixpath` |
|
17 | $ svnpath=`pwd | fixpath` | |
18 |
|
18 | |||
19 |
|
19 | |||
20 | $ expr "$svnpath" : "\/" > /dev/null |
|
20 | $ expr "$svnpath" : "\/" > /dev/null | |
21 | > if [ $? -ne 0 ]; then |
|
21 | > if [ $? -ne 0 ]; then | |
22 | > svnpath="/$svnpath" |
|
22 | > svnpath="/$svnpath" | |
23 | > fi |
|
23 | > fi | |
24 | > svnurl="file://$svnpath/svn-repo" |
|
24 | > svnurl="file://$svnpath/svn-repo" | |
25 |
|
25 | |||
26 | Now test that it works with trunk/tags layout, but no branches yet. |
|
26 | Now test that it works with trunk/tags layout, but no branches yet. | |
27 |
|
27 | |||
28 | Initial svn import |
|
28 | Initial svn import | |
29 |
|
29 | |||
30 | $ mkdir projB |
|
30 | $ mkdir projB | |
31 | $ cd projB |
|
31 | $ cd projB | |
32 | $ mkdir mytrunk |
|
32 | $ mkdir mytrunk | |
33 | $ mkdir tags |
|
33 | $ mkdir tags | |
34 | $ cd .. |
|
34 | $ cd .. | |
35 |
|
35 | |||
36 | $ svnurl="file://$svnpath/svn-repo/proj%20B" |
|
36 | $ svnurl="file://$svnpath/svn-repo/proj%20B" | |
37 | $ svn import -m "init projB" projB "$svnurl" | fixpath |
|
37 | $ svn import -m "init projB" projB "$svnurl" | fixpath | sort | |
|
38 | ||||
38 | Adding projB/mytrunk |
|
39 | Adding projB/mytrunk | |
39 | Adding projB/tags |
|
40 | Adding projB/tags | |
40 |
|
||||
41 | Committed revision 1. |
|
41 | Committed revision 1. | |
42 |
|
42 | |||
43 | Update svn repository |
|
43 | Update svn repository | |
44 |
|
44 | |||
45 | $ svn co "$svnurl"/mytrunk B | fixpath |
|
45 | $ svn co "$svnurl"/mytrunk B | fixpath | |
46 | Checked out revision 1. |
|
46 | Checked out revision 1. | |
47 | $ cd B |
|
47 | $ cd B | |
48 | $ echo hello > 'letter .txt' |
|
48 | $ echo hello > 'letter .txt' | |
49 | $ svn add 'letter .txt' |
|
49 | $ svn add 'letter .txt' | |
50 | A letter .txt |
|
50 | A letter .txt | |
51 | $ svn ci -m hello |
|
51 | $ svn ci -m hello | |
52 | Adding letter .txt |
|
52 | Adding letter .txt | |
53 | Transmitting file data . |
|
53 | Transmitting file data . | |
54 | Committed revision 2. |
|
54 | Committed revision 2. | |
55 |
|
55 | |||
56 | $ "$TESTDIR/svn-safe-append.py" world 'letter .txt' |
|
56 | $ "$TESTDIR/svn-safe-append.py" world 'letter .txt' | |
57 | $ svn ci -m world |
|
57 | $ svn ci -m world | |
58 | Sending letter .txt |
|
58 | Sending letter .txt | |
59 | Transmitting file data . |
|
59 | Transmitting file data . | |
60 | Committed revision 3. |
|
60 | Committed revision 3. | |
61 |
|
61 | |||
62 | $ svn copy -m "tag v0.1" "$svnurl"/mytrunk "$svnurl"/tags/v0.1 |
|
62 | $ svn copy -m "tag v0.1" "$svnurl"/mytrunk "$svnurl"/tags/v0.1 | |
63 |
|
63 | |||
64 | Committed revision 4. |
|
64 | Committed revision 4. | |
65 |
|
65 | |||
66 | $ "$TESTDIR/svn-safe-append.py" 'nice day today!' 'letter .txt' |
|
66 | $ "$TESTDIR/svn-safe-append.py" 'nice day today!' 'letter .txt' | |
67 | $ svn ci -m "nice day" |
|
67 | $ svn ci -m "nice day" | |
68 | Sending letter .txt |
|
68 | Sending letter .txt | |
69 | Transmitting file data . |
|
69 | Transmitting file data . | |
70 | Committed revision 5. |
|
70 | Committed revision 5. | |
71 | $ cd .. |
|
71 | $ cd .. | |
72 |
|
72 | |||
73 | Convert to hg once |
|
73 | Convert to hg once | |
74 |
|
74 | |||
75 | $ hg convert "$svnurl" B-hg |
|
75 | $ hg convert "$svnurl" B-hg | |
76 | initializing destination B-hg repository |
|
76 | initializing destination B-hg repository | |
77 | scanning source... |
|
77 | scanning source... | |
78 | sorting... |
|
78 | sorting... | |
79 | converting... |
|
79 | converting... | |
80 | 3 init projB |
|
80 | 3 init projB | |
81 | 2 hello |
|
81 | 2 hello | |
82 | 1 world |
|
82 | 1 world | |
83 | 0 nice day |
|
83 | 0 nice day | |
84 | updating tags |
|
84 | updating tags | |
85 |
|
85 | |||
86 | Update svn repository again |
|
86 | Update svn repository again | |
87 |
|
87 | |||
88 | $ cd B |
|
88 | $ cd B | |
89 | $ "$TESTDIR/svn-safe-append.py" "see second letter" 'letter .txt' |
|
89 | $ "$TESTDIR/svn-safe-append.py" "see second letter" 'letter .txt' | |
90 | $ echo "nice to meet you" > letter2.txt |
|
90 | $ echo "nice to meet you" > letter2.txt | |
91 | $ svn add letter2.txt |
|
91 | $ svn add letter2.txt | |
92 | A letter2.txt |
|
92 | A letter2.txt | |
93 | $ svn ci -m "second letter" |
|
93 | $ svn ci -m "second letter" | |
94 | Sending letter .txt |
|
94 | Sending letter .txt | |
95 | Adding letter2.txt |
|
95 | Adding letter2.txt | |
96 | Transmitting file data .. |
|
96 | Transmitting file data .. | |
97 | Committed revision 6. |
|
97 | Committed revision 6. | |
98 |
|
98 | |||
99 | $ svn copy -m "tag v0.2" "$svnurl"/mytrunk "$svnurl"/tags/v0.2 |
|
99 | $ svn copy -m "tag v0.2" "$svnurl"/mytrunk "$svnurl"/tags/v0.2 | |
100 |
|
100 | |||
101 | Committed revision 7. |
|
101 | Committed revision 7. | |
102 |
|
102 | |||
103 | $ "$TESTDIR/svn-safe-append.py" "blah-blah-blah" letter2.txt |
|
103 | $ "$TESTDIR/svn-safe-append.py" "blah-blah-blah" letter2.txt | |
104 | $ svn ci -m "work in progress" |
|
104 | $ svn ci -m "work in progress" | |
105 | Sending letter2.txt |
|
105 | Sending letter2.txt | |
106 | Transmitting file data . |
|
106 | Transmitting file data . | |
107 | Committed revision 8. |
|
107 | Committed revision 8. | |
108 | $ cd .. |
|
108 | $ cd .. | |
109 |
|
109 | |||
110 | $ hg convert -s svn "$svnurl/non-existent-path" dest |
|
110 | $ hg convert -s svn "$svnurl/non-existent-path" dest | |
111 | initializing destination dest repository |
|
111 | initializing destination dest repository | |
112 | abort: no revision found in module /proj B/non-existent-path |
|
112 | abort: no revision found in module /proj B/non-existent-path | |
113 | [255] |
|
113 | [255] | |
114 |
|
114 | |||
115 | ######################################## |
|
115 | ######################################## | |
116 |
|
116 | |||
117 | Test incremental conversion |
|
117 | Test incremental conversion | |
118 |
|
118 | |||
119 | $ hg convert "$svnurl" B-hg |
|
119 | $ hg convert "$svnurl" B-hg | |
120 | scanning source... |
|
120 | scanning source... | |
121 | sorting... |
|
121 | sorting... | |
122 | converting... |
|
122 | converting... | |
123 | 1 second letter |
|
123 | 1 second letter | |
124 | 0 work in progress |
|
124 | 0 work in progress | |
125 | updating tags |
|
125 | updating tags | |
126 |
|
126 | |||
127 | $ cd B-hg |
|
127 | $ cd B-hg | |
128 | $ hg glog --template '{rev} {desc|firstline} files: {files}\n' |
|
128 | $ hg glog --template '{rev} {desc|firstline} files: {files}\n' | |
129 | o 7 update tags files: .hgtags |
|
129 | o 7 update tags files: .hgtags | |
130 | | |
|
130 | | | |
131 | o 6 work in progress files: letter2.txt |
|
131 | o 6 work in progress files: letter2.txt | |
132 | | |
|
132 | | | |
133 | o 5 second letter files: letter .txt letter2.txt |
|
133 | o 5 second letter files: letter .txt letter2.txt | |
134 | | |
|
134 | | | |
135 | o 4 update tags files: .hgtags |
|
135 | o 4 update tags files: .hgtags | |
136 | | |
|
136 | | | |
137 | o 3 nice day files: letter .txt |
|
137 | o 3 nice day files: letter .txt | |
138 | | |
|
138 | | | |
139 | o 2 world files: letter .txt |
|
139 | o 2 world files: letter .txt | |
140 | | |
|
140 | | | |
141 | o 1 hello files: letter .txt |
|
141 | o 1 hello files: letter .txt | |
142 | | |
|
142 | | | |
143 | o 0 init projB files: |
|
143 | o 0 init projB files: | |
144 |
|
144 | |||
145 | $ hg tags -q |
|
145 | $ hg tags -q | |
146 | tip |
|
146 | tip | |
147 | v0.2 |
|
147 | v0.2 | |
148 | v0.1 |
|
148 | v0.1 | |
149 | $ cd .. |
|
149 | $ cd .. | |
150 |
|
150 | |||
151 | Test filemap |
|
151 | Test filemap | |
152 | $ echo 'include letter2.txt' > filemap |
|
152 | $ echo 'include letter2.txt' > filemap | |
153 | $ hg convert --filemap filemap "$svnurl"/mytrunk fmap |
|
153 | $ hg convert --filemap filemap "$svnurl"/mytrunk fmap | |
154 | initializing destination fmap repository |
|
154 | initializing destination fmap repository | |
155 | scanning source... |
|
155 | scanning source... | |
156 | sorting... |
|
156 | sorting... | |
157 | converting... |
|
157 | converting... | |
158 | 5 init projB |
|
158 | 5 init projB | |
159 | 4 hello |
|
159 | 4 hello | |
160 | 3 world |
|
160 | 3 world | |
161 | 2 nice day |
|
161 | 2 nice day | |
162 | 1 second letter |
|
162 | 1 second letter | |
163 | 0 work in progress |
|
163 | 0 work in progress | |
164 | $ hg -R fmap branch -q |
|
164 | $ hg -R fmap branch -q | |
165 | default |
|
165 | default | |
166 | $ hg glog -R fmap --template '{rev} {desc|firstline} files: {files}\n' |
|
166 | $ hg glog -R fmap --template '{rev} {desc|firstline} files: {files}\n' | |
167 | o 1 work in progress files: letter2.txt |
|
167 | o 1 work in progress files: letter2.txt | |
168 | | |
|
168 | | | |
169 | o 0 second letter files: letter2.txt |
|
169 | o 0 second letter files: letter2.txt | |
170 |
|
170 | |||
171 |
|
171 | |||
172 | Test stop revision |
|
172 | Test stop revision | |
173 | $ hg convert --rev 1 "$svnurl"/mytrunk stoprev |
|
173 | $ hg convert --rev 1 "$svnurl"/mytrunk stoprev | |
174 | initializing destination stoprev repository |
|
174 | initializing destination stoprev repository | |
175 | scanning source... |
|
175 | scanning source... | |
176 | sorting... |
|
176 | sorting... | |
177 | converting... |
|
177 | converting... | |
178 | 0 init projB |
|
178 | 0 init projB | |
179 | $ hg -R stoprev branch -q |
|
179 | $ hg -R stoprev branch -q | |
180 | default |
|
180 | default | |
181 |
|
181 | |||
182 | Check convert_revision extra-records. |
|
182 | Check convert_revision extra-records. | |
183 | This is also the only place testing more than one extra field in a revision. |
|
183 | This is also the only place testing more than one extra field in a revision. | |
184 |
|
184 | |||
185 | $ cd stoprev |
|
185 | $ cd stoprev | |
186 | $ hg tip --debug | grep extra |
|
186 | $ hg tip --debug | grep extra | |
187 | extra: branch=default |
|
187 | extra: branch=default | |
188 | extra: convert_revision=svn:........-....-....-....-............/proj B/mytrunk@1 (re) |
|
188 | extra: convert_revision=svn:........-....-....-....-............/proj B/mytrunk@1 (re) | |
189 | $ cd .. |
|
189 | $ cd .. | |
190 |
|
190 | |||
191 | Test converting empty heads (issue3347) |
|
191 | Test converting empty heads (issue3347) | |
192 |
|
192 | |||
193 | $ svnadmin create svn-empty |
|
193 | $ svnadmin create svn-empty | |
194 | $ svnadmin load -q svn-empty < "$TESTDIR/svn/empty.svndump" |
|
194 | $ svnadmin load -q svn-empty < "$TESTDIR/svn/empty.svndump" | |
195 | $ hg --config convert.svn.trunk= convert svn-empty |
|
195 | $ hg --config convert.svn.trunk= convert svn-empty | |
196 | assuming destination svn-empty-hg |
|
196 | assuming destination svn-empty-hg | |
197 | initializing destination svn-empty-hg repository |
|
197 | initializing destination svn-empty-hg repository | |
198 | scanning source... |
|
198 | scanning source... | |
199 | sorting... |
|
199 | sorting... | |
200 | converting... |
|
200 | converting... | |
201 | 1 init projA |
|
201 | 1 init projA | |
202 | 0 adddir |
|
202 | 0 adddir | |
203 | $ hg --config convert.svn.trunk= convert file://$svnpath/svn-empty/trunk |
|
203 | $ hg --config convert.svn.trunk= convert file://$svnpath/svn-empty/trunk | |
204 | assuming destination trunk-hg |
|
204 | assuming destination trunk-hg | |
205 | initializing destination trunk-hg repository |
|
205 | initializing destination trunk-hg repository | |
206 | scanning source... |
|
206 | scanning source... | |
207 | sorting... |
|
207 | sorting... | |
208 | converting... |
|
208 | converting... | |
209 | 1 init projA |
|
209 | 1 init projA | |
210 | 0 adddir |
|
210 | 0 adddir |
General Comments 0
You need to be logged in to leave comments.
Login now