##// END OF EJS Templates
tests: pass only one file at a time to tail(1)...
Augie Fackler -
r32066:40cf693f stable
parent child Browse files
Show More
@@ -1,565 +1,562
1
1
2 $ cat >> $HGRCPATH <<EOF
2 $ cat >> $HGRCPATH <<EOF
3 > [extensions]
3 > [extensions]
4 > convert=
4 > convert=
5 > [convert]
5 > [convert]
6 > hg.saverev=False
6 > hg.saverev=False
7 > EOF
7 > EOF
8 $ hg init orig
8 $ hg init orig
9 $ cd orig
9 $ cd orig
10 $ echo foo > foo
10 $ echo foo > foo
11 $ echo bar > bar
11 $ echo bar > bar
12 $ hg ci -qAm 'add foo and bar'
12 $ hg ci -qAm 'add foo and bar'
13 $ hg rm foo
13 $ hg rm foo
14 $ hg ci -m 'remove foo'
14 $ hg ci -m 'remove foo'
15 $ mkdir foo
15 $ mkdir foo
16 $ echo file > foo/file
16 $ echo file > foo/file
17 $ hg ci -qAm 'add foo/file'
17 $ hg ci -qAm 'add foo/file'
18 $ hg tag some-tag
18 $ hg tag some-tag
19 $ hg tag -l local-tag
19 $ hg tag -l local-tag
20 $ hg log
20 $ hg log
21 changeset: 3:593cbf6fb2b4
21 changeset: 3:593cbf6fb2b4
22 tag: local-tag
22 tag: local-tag
23 tag: tip
23 tag: tip
24 user: test
24 user: test
25 date: Thu Jan 01 00:00:00 1970 +0000
25 date: Thu Jan 01 00:00:00 1970 +0000
26 summary: Added tag some-tag for changeset ad681a868e44
26 summary: Added tag some-tag for changeset ad681a868e44
27
27
28 changeset: 2:ad681a868e44
28 changeset: 2:ad681a868e44
29 tag: some-tag
29 tag: some-tag
30 user: test
30 user: test
31 date: Thu Jan 01 00:00:00 1970 +0000
31 date: Thu Jan 01 00:00:00 1970 +0000
32 summary: add foo/file
32 summary: add foo/file
33
33
34 changeset: 1:cbba8ecc03b7
34 changeset: 1:cbba8ecc03b7
35 user: test
35 user: test
36 date: Thu Jan 01 00:00:00 1970 +0000
36 date: Thu Jan 01 00:00:00 1970 +0000
37 summary: remove foo
37 summary: remove foo
38
38
39 changeset: 0:327daa9251fa
39 changeset: 0:327daa9251fa
40 user: test
40 user: test
41 date: Thu Jan 01 00:00:00 1970 +0000
41 date: Thu Jan 01 00:00:00 1970 +0000
42 summary: add foo and bar
42 summary: add foo and bar
43
43
44 $ hg phase --public -r tip
44 $ hg phase --public -r tip
45 $ cd ..
45 $ cd ..
46 $ hg convert orig new 2>&1 | grep -v 'subversion python bindings could not be loaded'
46 $ hg convert orig new 2>&1 | grep -v 'subversion python bindings could not be loaded'
47 initializing destination new repository
47 initializing destination new repository
48 scanning source...
48 scanning source...
49 sorting...
49 sorting...
50 converting...
50 converting...
51 3 add foo and bar
51 3 add foo and bar
52 2 remove foo
52 2 remove foo
53 1 add foo/file
53 1 add foo/file
54 0 Added tag some-tag for changeset ad681a868e44
54 0 Added tag some-tag for changeset ad681a868e44
55 $ cd new
55 $ cd new
56 $ hg log -G --template '{rev} {node|short} ({phase}) "{desc}"\n'
56 $ hg log -G --template '{rev} {node|short} ({phase}) "{desc}"\n'
57 o 3 593cbf6fb2b4 (public) "Added tag some-tag for changeset ad681a868e44"
57 o 3 593cbf6fb2b4 (public) "Added tag some-tag for changeset ad681a868e44"
58 |
58 |
59 o 2 ad681a868e44 (public) "add foo/file"
59 o 2 ad681a868e44 (public) "add foo/file"
60 |
60 |
61 o 1 cbba8ecc03b7 (public) "remove foo"
61 o 1 cbba8ecc03b7 (public) "remove foo"
62 |
62 |
63 o 0 327daa9251fa (public) "add foo and bar"
63 o 0 327daa9251fa (public) "add foo and bar"
64
64
65
65
66 $ hg out ../orig
66 $ hg out ../orig
67 comparing with ../orig
67 comparing with ../orig
68 searching for changes
68 searching for changes
69 no changes found
69 no changes found
70 [1]
70 [1]
71
71
72 dirstate should be empty:
72 dirstate should be empty:
73
73
74 $ hg debugstate
74 $ hg debugstate
75 $ hg parents -q
75 $ hg parents -q
76 $ hg up -C
76 $ hg up -C
77 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
77 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
78 $ hg copy bar baz
78 $ hg copy bar baz
79
79
80 put something in the dirstate:
80 put something in the dirstate:
81
81
82 $ hg debugstate > debugstate
82 $ hg debugstate > debugstate
83 $ grep baz debugstate
83 $ grep baz debugstate
84 a 0 -1 unset baz
84 a 0 -1 unset baz
85 copy: bar -> baz
85 copy: bar -> baz
86
86
87 add a new revision in the original repo
87 add a new revision in the original repo
88
88
89 $ cd ../orig
89 $ cd ../orig
90 $ echo baz > baz
90 $ echo baz > baz
91 $ hg ci -qAm 'add baz'
91 $ hg ci -qAm 'add baz'
92 $ cd ..
92 $ cd ..
93 $ hg convert orig new 2>&1 | grep -v 'subversion python bindings could not be loaded'
93 $ hg convert orig new 2>&1 | grep -v 'subversion python bindings could not be loaded'
94 scanning source...
94 scanning source...
95 sorting...
95 sorting...
96 converting...
96 converting...
97 0 add baz
97 0 add baz
98 $ cd new
98 $ cd new
99 $ hg out ../orig
99 $ hg out ../orig
100 comparing with ../orig
100 comparing with ../orig
101 searching for changes
101 searching for changes
102 no changes found
102 no changes found
103 [1]
103 [1]
104
104
105 dirstate should be the same (no output below):
105 dirstate should be the same (no output below):
106
106
107 $ hg debugstate > new-debugstate
107 $ hg debugstate > new-debugstate
108 $ diff debugstate new-debugstate
108 $ diff debugstate new-debugstate
109
109
110 no copies
110 no copies
111
111
112 $ hg up -C
112 $ hg up -C
113 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
113 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
114 $ hg debugrename baz
114 $ hg debugrename baz
115 baz not renamed
115 baz not renamed
116 $ cd ..
116 $ cd ..
117
117
118 test tag rewriting
118 test tag rewriting
119
119
120 $ cat > filemap <<EOF
120 $ cat > filemap <<EOF
121 > exclude foo
121 > exclude foo
122 > EOF
122 > EOF
123 $ hg convert --filemap filemap orig new-filemap 2>&1 | grep -v 'subversion python bindings could not be loaded'
123 $ hg convert --filemap filemap orig new-filemap 2>&1 | grep -v 'subversion python bindings could not be loaded'
124 initializing destination new-filemap repository
124 initializing destination new-filemap repository
125 scanning source...
125 scanning source...
126 sorting...
126 sorting...
127 converting...
127 converting...
128 4 add foo and bar
128 4 add foo and bar
129 3 remove foo
129 3 remove foo
130 2 add foo/file
130 2 add foo/file
131 1 Added tag some-tag for changeset ad681a868e44
131 1 Added tag some-tag for changeset ad681a868e44
132 0 add baz
132 0 add baz
133 $ cd new-filemap
133 $ cd new-filemap
134 $ hg tags
134 $ hg tags
135 tip 2:3c74706b1ff8
135 tip 2:3c74706b1ff8
136 some-tag 0:ba8636729451
136 some-tag 0:ba8636729451
137 $ cd ..
137 $ cd ..
138
138
139
139
140 Test cases for hg-hg roundtrip
140 Test cases for hg-hg roundtrip
141
141
142 Helper
142 Helper
143
143
144 $ glog()
144 $ glog()
145 > {
145 > {
146 > hg log -G --template '{rev} {node|short} ({phase}) "{desc}" files: {files}\n' $*
146 > hg log -G --template '{rev} {node|short} ({phase}) "{desc}" files: {files}\n' $*
147 > }
147 > }
148
148
149 Create a tricky source repo
149 Create a tricky source repo
150
150
151 $ hg init source
151 $ hg init source
152 $ cd source
152 $ cd source
153
153
154 $ echo 0 > 0
154 $ echo 0 > 0
155 $ hg ci -Aqm '0: add 0'
155 $ hg ci -Aqm '0: add 0'
156 $ echo a > a
156 $ echo a > a
157 $ mkdir dir
157 $ mkdir dir
158 $ echo b > dir/b
158 $ echo b > dir/b
159 $ hg ci -qAm '1: add a and dir/b'
159 $ hg ci -qAm '1: add a and dir/b'
160 $ echo c > dir/c
160 $ echo c > dir/c
161 $ hg ci -qAm '2: add dir/c'
161 $ hg ci -qAm '2: add dir/c'
162 $ hg copy a e
162 $ hg copy a e
163 $ echo b >> b
163 $ echo b >> b
164 $ hg ci -qAm '3: copy a to e, change b'
164 $ hg ci -qAm '3: copy a to e, change b'
165 $ hg up -qr -3
165 $ hg up -qr -3
166 $ echo a >> a
166 $ echo a >> a
167 $ hg ci -qAm '4: change a'
167 $ hg ci -qAm '4: change a'
168 $ hg merge
168 $ hg merge
169 merging a and e to e
169 merging a and e to e
170 2 files updated, 1 files merged, 0 files removed, 0 files unresolved
170 2 files updated, 1 files merged, 0 files removed, 0 files unresolved
171 (branch merge, don't forget to commit)
171 (branch merge, don't forget to commit)
172 $ hg copy b dir/d
172 $ hg copy b dir/d
173 $ hg ci -qAm '5: merge 2 and 3, copy b to dir/d'
173 $ hg ci -qAm '5: merge 2 and 3, copy b to dir/d'
174 $ echo a >> a
174 $ echo a >> a
175 $ hg ci -qAm '6: change a'
175 $ hg ci -qAm '6: change a'
176
176
177 $ hg mani
177 $ hg mani
178 0
178 0
179 a
179 a
180 b
180 b
181 dir/b
181 dir/b
182 dir/c
182 dir/c
183 dir/d
183 dir/d
184 e
184 e
185 $ hg phase --public -r tip
185 $ hg phase --public -r tip
186 $ glog
186 $ glog
187 @ 6 0613c8e59a3d (public) "6: change a" files: a
187 @ 6 0613c8e59a3d (public) "6: change a" files: a
188 |
188 |
189 o 5 717e9b37cdb7 (public) "5: merge 2 and 3, copy b to dir/d" files: dir/d e
189 o 5 717e9b37cdb7 (public) "5: merge 2 and 3, copy b to dir/d" files: dir/d e
190 |\
190 |\
191 | o 4 86a55cb968d5 (public) "4: change a" files: a
191 | o 4 86a55cb968d5 (public) "4: change a" files: a
192 | |
192 | |
193 o | 3 0e6e235919dd (public) "3: copy a to e, change b" files: b e
193 o | 3 0e6e235919dd (public) "3: copy a to e, change b" files: b e
194 | |
194 | |
195 o | 2 0394b0d5e4f7 (public) "2: add dir/c" files: dir/c
195 o | 2 0394b0d5e4f7 (public) "2: add dir/c" files: dir/c
196 |/
196 |/
197 o 1 333546584845 (public) "1: add a and dir/b" files: a dir/b
197 o 1 333546584845 (public) "1: add a and dir/b" files: a dir/b
198 |
198 |
199 o 0 d1a24e2ebd23 (public) "0: add 0" files: 0
199 o 0 d1a24e2ebd23 (public) "0: add 0" files: 0
200
200
201 $ cd ..
201 $ cd ..
202
202
203 Convert excluding rev 0 and dir/ (and thus rev2):
203 Convert excluding rev 0 and dir/ (and thus rev2):
204
204
205 $ cat << EOF > filemap
205 $ cat << EOF > filemap
206 > exclude dir
206 > exclude dir
207 > EOF
207 > EOF
208
208
209 $ hg convert --filemap filemap source dest --config convert.hg.revs=1::
209 $ hg convert --filemap filemap source dest --config convert.hg.revs=1::
210 initializing destination dest repository
210 initializing destination dest repository
211 scanning source...
211 scanning source...
212 sorting...
212 sorting...
213 converting...
213 converting...
214 5 1: add a and dir/b
214 5 1: add a and dir/b
215 4 2: add dir/c
215 4 2: add dir/c
216 3 3: copy a to e, change b
216 3 3: copy a to e, change b
217 2 4: change a
217 2 4: change a
218 1 5: merge 2 and 3, copy b to dir/d
218 1 5: merge 2 and 3, copy b to dir/d
219 0 6: change a
219 0 6: change a
220
220
221 Verify that conversion skipped rev 2:
221 Verify that conversion skipped rev 2:
222
222
223 $ glog -R dest
223 $ glog -R dest
224 o 4 78814e84a217 (draft) "6: change a" files: a
224 o 4 78814e84a217 (draft) "6: change a" files: a
225 |
225 |
226 o 3 f7cff662c5e5 (draft) "5: merge 2 and 3, copy b to dir/d" files: e
226 o 3 f7cff662c5e5 (draft) "5: merge 2 and 3, copy b to dir/d" files: e
227 |\
227 |\
228 | o 2 ab40a95b0072 (draft) "4: change a" files: a
228 | o 2 ab40a95b0072 (draft) "4: change a" files: a
229 | |
229 | |
230 o | 1 bd51f17597bf (draft) "3: copy a to e, change b" files: b e
230 o | 1 bd51f17597bf (draft) "3: copy a to e, change b" files: b e
231 |/
231 |/
232 o 0 a4a1dae0fe35 (draft) "1: add a and dir/b" files: 0 a
232 o 0 a4a1dae0fe35 (draft) "1: add a and dir/b" files: 0 a
233
233
234
234
235 Verify mapping correct in both directions:
235 Verify mapping correct in both directions:
236
236
237 $ cat source/.hg/shamap
237 $ cat source/.hg/shamap
238 a4a1dae0fe3514cefd9b8541b7abbc8f44f946d5 333546584845f70c4cfecb992341aaef0e708166
238 a4a1dae0fe3514cefd9b8541b7abbc8f44f946d5 333546584845f70c4cfecb992341aaef0e708166
239 bd51f17597bf32268e68a560b206898c3960cda2 0e6e235919dd8e9285ba8eb5adf703af9ad99378
239 bd51f17597bf32268e68a560b206898c3960cda2 0e6e235919dd8e9285ba8eb5adf703af9ad99378
240 ab40a95b00725307e79c2fd271000aa8af9759f4 86a55cb968d51770cba2a1630d6cc637b574580a
240 ab40a95b00725307e79c2fd271000aa8af9759f4 86a55cb968d51770cba2a1630d6cc637b574580a
241 f7cff662c5e581e6f3f1a85ffdd2bcb35825f6ba 717e9b37cdb7eb9917ca8e30aa3f986e6d5b177d
241 f7cff662c5e581e6f3f1a85ffdd2bcb35825f6ba 717e9b37cdb7eb9917ca8e30aa3f986e6d5b177d
242 78814e84a217894517c2de392b903ed05e6871a4 0613c8e59a3ddb9789072ef52f1ed13496489bb4
242 78814e84a217894517c2de392b903ed05e6871a4 0613c8e59a3ddb9789072ef52f1ed13496489bb4
243 $ cat dest/.hg/shamap
243 $ cat dest/.hg/shamap
244 333546584845f70c4cfecb992341aaef0e708166 a4a1dae0fe3514cefd9b8541b7abbc8f44f946d5
244 333546584845f70c4cfecb992341aaef0e708166 a4a1dae0fe3514cefd9b8541b7abbc8f44f946d5
245 0394b0d5e4f761ced559fd0bbdc6afc16cb3f7d1 a4a1dae0fe3514cefd9b8541b7abbc8f44f946d5
245 0394b0d5e4f761ced559fd0bbdc6afc16cb3f7d1 a4a1dae0fe3514cefd9b8541b7abbc8f44f946d5
246 0e6e235919dd8e9285ba8eb5adf703af9ad99378 bd51f17597bf32268e68a560b206898c3960cda2
246 0e6e235919dd8e9285ba8eb5adf703af9ad99378 bd51f17597bf32268e68a560b206898c3960cda2
247 86a55cb968d51770cba2a1630d6cc637b574580a ab40a95b00725307e79c2fd271000aa8af9759f4
247 86a55cb968d51770cba2a1630d6cc637b574580a ab40a95b00725307e79c2fd271000aa8af9759f4
248 717e9b37cdb7eb9917ca8e30aa3f986e6d5b177d f7cff662c5e581e6f3f1a85ffdd2bcb35825f6ba
248 717e9b37cdb7eb9917ca8e30aa3f986e6d5b177d f7cff662c5e581e6f3f1a85ffdd2bcb35825f6ba
249 0613c8e59a3ddb9789072ef52f1ed13496489bb4 78814e84a217894517c2de392b903ed05e6871a4
249 0613c8e59a3ddb9789072ef52f1ed13496489bb4 78814e84a217894517c2de392b903ed05e6871a4
250
250
251 Verify meta data converted correctly:
251 Verify meta data converted correctly:
252
252
253 $ hg -R dest log -r 1 --debug -p --git
253 $ hg -R dest log -r 1 --debug -p --git
254 changeset: 1:bd51f17597bf32268e68a560b206898c3960cda2
254 changeset: 1:bd51f17597bf32268e68a560b206898c3960cda2
255 phase: draft
255 phase: draft
256 parent: 0:a4a1dae0fe3514cefd9b8541b7abbc8f44f946d5
256 parent: 0:a4a1dae0fe3514cefd9b8541b7abbc8f44f946d5
257 parent: -1:0000000000000000000000000000000000000000
257 parent: -1:0000000000000000000000000000000000000000
258 manifest: 1:040c72ed9b101773c24ac314776bfc846943781f
258 manifest: 1:040c72ed9b101773c24ac314776bfc846943781f
259 user: test
259 user: test
260 date: Thu Jan 01 00:00:00 1970 +0000
260 date: Thu Jan 01 00:00:00 1970 +0000
261 files+: b e
261 files+: b e
262 extra: branch=default
262 extra: branch=default
263 description:
263 description:
264 3: copy a to e, change b
264 3: copy a to e, change b
265
265
266
266
267 diff --git a/b b/b
267 diff --git a/b b/b
268 new file mode 100644
268 new file mode 100644
269 --- /dev/null
269 --- /dev/null
270 +++ b/b
270 +++ b/b
271 @@ -0,0 +1,1 @@
271 @@ -0,0 +1,1 @@
272 +b
272 +b
273 diff --git a/a b/e
273 diff --git a/a b/e
274 copy from a
274 copy from a
275 copy to e
275 copy to e
276
276
277 Verify files included and excluded correctly:
277 Verify files included and excluded correctly:
278
278
279 $ hg -R dest manifest -r tip
279 $ hg -R dest manifest -r tip
280 0
280 0
281 a
281 a
282 b
282 b
283 e
283 e
284
284
285
285
286 Make changes in dest and convert back:
286 Make changes in dest and convert back:
287
287
288 $ hg -R dest up -q
288 $ hg -R dest up -q
289 $ echo dest > dest/dest
289 $ echo dest > dest/dest
290 $ hg -R dest ci -Aqm 'change in dest'
290 $ hg -R dest ci -Aqm 'change in dest'
291 $ hg -R dest tip
291 $ hg -R dest tip
292 changeset: 5:a2e0e3cc6d1d
292 changeset: 5:a2e0e3cc6d1d
293 tag: tip
293 tag: tip
294 user: test
294 user: test
295 date: Thu Jan 01 00:00:00 1970 +0000
295 date: Thu Jan 01 00:00:00 1970 +0000
296 summary: change in dest
296 summary: change in dest
297
297
298
298
299 (converting merges back after using a filemap will probably cause chaos so we
299 (converting merges back after using a filemap will probably cause chaos so we
300 exclude merges.)
300 exclude merges.)
301
301
302 $ hg convert dest source --config convert.hg.revs='!merge()'
302 $ hg convert dest source --config convert.hg.revs='!merge()'
303 scanning source...
303 scanning source...
304 sorting...
304 sorting...
305 converting...
305 converting...
306 0 change in dest
306 0 change in dest
307
307
308 Verify the conversion back:
308 Verify the conversion back:
309
309
310 $ hg -R source log --debug -r tip
310 $ hg -R source log --debug -r tip
311 changeset: 7:e6d364a69ff1248b2099e603b0c145504cade6f0
311 changeset: 7:e6d364a69ff1248b2099e603b0c145504cade6f0
312 tag: tip
312 tag: tip
313 phase: draft
313 phase: draft
314 parent: 6:0613c8e59a3ddb9789072ef52f1ed13496489bb4
314 parent: 6:0613c8e59a3ddb9789072ef52f1ed13496489bb4
315 parent: -1:0000000000000000000000000000000000000000
315 parent: -1:0000000000000000000000000000000000000000
316 manifest: 7:aa3e9542f3b76d4f1f1b2e9c7ce9dbb48b6a95ec
316 manifest: 7:aa3e9542f3b76d4f1f1b2e9c7ce9dbb48b6a95ec
317 user: test
317 user: test
318 date: Thu Jan 01 00:00:00 1970 +0000
318 date: Thu Jan 01 00:00:00 1970 +0000
319 files+: dest
319 files+: dest
320 extra: branch=default
320 extra: branch=default
321 description:
321 description:
322 change in dest
322 change in dest
323
323
324
324
325 Files that had been excluded are still present:
325 Files that had been excluded are still present:
326
326
327 $ hg -R source manifest -r tip
327 $ hg -R source manifest -r tip
328 0
328 0
329 a
329 a
330 b
330 b
331 dest
331 dest
332 dir/b
332 dir/b
333 dir/c
333 dir/c
334 dir/d
334 dir/d
335 e
335 e
336
336
337 More source changes
337 More source changes
338
338
339 $ cd source
339 $ cd source
340 $ echo 1 >> a
340 $ echo 1 >> a
341 $ hg ci -m '8: source first branch'
341 $ hg ci -m '8: source first branch'
342 created new head
342 created new head
343 $ hg up -qr -2
343 $ hg up -qr -2
344 $ echo 2 >> a
344 $ echo 2 >> a
345 $ hg ci -m '9: source second branch'
345 $ hg ci -m '9: source second branch'
346 $ hg merge -q --tool internal:local
346 $ hg merge -q --tool internal:local
347 $ hg ci -m '10: source merge'
347 $ hg ci -m '10: source merge'
348 $ echo >> a
348 $ echo >> a
349 $ hg ci -m '11: source change'
349 $ hg ci -m '11: source change'
350
350
351 $ hg mani
351 $ hg mani
352 0
352 0
353 a
353 a
354 b
354 b
355 dest
355 dest
356 dir/b
356 dir/b
357 dir/c
357 dir/c
358 dir/d
358 dir/d
359 e
359 e
360
360
361 $ glog -r 6:
361 $ glog -r 6:
362 @ 11 0c8927d1f7f4 (draft) "11: source change" files: a
362 @ 11 0c8927d1f7f4 (draft) "11: source change" files: a
363 |
363 |
364 o 10 9ccb7ee8d261 (draft) "10: source merge" files: a
364 o 10 9ccb7ee8d261 (draft) "10: source merge" files: a
365 |\
365 |\
366 | o 9 f131b1518dba (draft) "9: source second branch" files: a
366 | o 9 f131b1518dba (draft) "9: source second branch" files: a
367 | |
367 | |
368 o | 8 669cf0e74b50 (draft) "8: source first branch" files: a
368 o | 8 669cf0e74b50 (draft) "8: source first branch" files: a
369 | |
369 | |
370 | o 7 e6d364a69ff1 (draft) "change in dest" files: dest
370 | o 7 e6d364a69ff1 (draft) "change in dest" files: dest
371 |/
371 |/
372 o 6 0613c8e59a3d (public) "6: change a" files: a
372 o 6 0613c8e59a3d (public) "6: change a" files: a
373 |
373 |
374 ~
374 ~
375 $ cd ..
375 $ cd ..
376
376
377 $ hg convert --filemap filemap source dest --config convert.hg.revs=3:
377 $ hg convert --filemap filemap source dest --config convert.hg.revs=3:
378 scanning source...
378 scanning source...
379 sorting...
379 sorting...
380 converting...
380 converting...
381 3 8: source first branch
381 3 8: source first branch
382 2 9: source second branch
382 2 9: source second branch
383 1 10: source merge
383 1 10: source merge
384 0 11: source change
384 0 11: source change
385
385
386 $ glog -R dest
386 $ glog -R dest
387 o 9 8432d597b263 (draft) "11: source change" files: a
387 o 9 8432d597b263 (draft) "11: source change" files: a
388 |
388 |
389 o 8 632ffacdcd6f (draft) "10: source merge" files: a
389 o 8 632ffacdcd6f (draft) "10: source merge" files: a
390 |\
390 |\
391 | o 7 049cfee90ee6 (draft) "9: source second branch" files: a
391 | o 7 049cfee90ee6 (draft) "9: source second branch" files: a
392 | |
392 | |
393 o | 6 9b6845e036e5 (draft) "8: source first branch" files: a
393 o | 6 9b6845e036e5 (draft) "8: source first branch" files: a
394 | |
394 | |
395 | @ 5 a2e0e3cc6d1d (draft) "change in dest" files: dest
395 | @ 5 a2e0e3cc6d1d (draft) "change in dest" files: dest
396 |/
396 |/
397 o 4 78814e84a217 (draft) "6: change a" files: a
397 o 4 78814e84a217 (draft) "6: change a" files: a
398 |
398 |
399 o 3 f7cff662c5e5 (draft) "5: merge 2 and 3, copy b to dir/d" files: e
399 o 3 f7cff662c5e5 (draft) "5: merge 2 and 3, copy b to dir/d" files: e
400 |\
400 |\
401 | o 2 ab40a95b0072 (draft) "4: change a" files: a
401 | o 2 ab40a95b0072 (draft) "4: change a" files: a
402 | |
402 | |
403 o | 1 bd51f17597bf (draft) "3: copy a to e, change b" files: b e
403 o | 1 bd51f17597bf (draft) "3: copy a to e, change b" files: b e
404 |/
404 |/
405 o 0 a4a1dae0fe35 (draft) "1: add a and dir/b" files: 0 a
405 o 0 a4a1dae0fe35 (draft) "1: add a and dir/b" files: 0 a
406
406
407 $ cd ..
407 $ cd ..
408
408
409 Two way tests
409 Two way tests
410
410
411 $ hg init 0
411 $ hg init 0
412 $ echo f > 0/f
412 $ echo f > 0/f
413 $ echo a > 0/a-only
413 $ echo a > 0/a-only
414 $ echo b > 0/b-only
414 $ echo b > 0/b-only
415 $ hg -R 0 ci -Aqm0
415 $ hg -R 0 ci -Aqm0
416
416
417 $ cat << EOF > filemap-a
417 $ cat << EOF > filemap-a
418 > exclude b-only
418 > exclude b-only
419 > EOF
419 > EOF
420 $ cat << EOF > filemap-b
420 $ cat << EOF > filemap-b
421 > exclude a-only
421 > exclude a-only
422 > EOF
422 > EOF
423 $ hg convert --filemap filemap-a 0 a
423 $ hg convert --filemap filemap-a 0 a
424 initializing destination a repository
424 initializing destination a repository
425 scanning source...
425 scanning source...
426 sorting...
426 sorting...
427 converting...
427 converting...
428 0 0
428 0 0
429 $ hg -R a up -q
429 $ hg -R a up -q
430 $ echo a > a/f
430 $ echo a > a/f
431 $ hg -R a ci -ma
431 $ hg -R a ci -ma
432
432
433 $ hg convert --filemap filemap-b 0 b
433 $ hg convert --filemap filemap-b 0 b
434 initializing destination b repository
434 initializing destination b repository
435 scanning source...
435 scanning source...
436 sorting...
436 sorting...
437 converting...
437 converting...
438 0 0
438 0 0
439 $ hg -R b up -q
439 $ hg -R b up -q
440 $ echo b > b/f
440 $ echo b > b/f
441 $ hg -R b ci -mb
441 $ hg -R b ci -mb
442
442
443 $ tail */.hg/shamap
443 $ tail 0/.hg/shamap
444 ==> 0/.hg/shamap <==
445 86f3f774ffb682bffb5dc3c1d3b3da637cb9a0d6 8a028c7c77f6c7bd6d63bc3f02ca9f779eabf16a
444 86f3f774ffb682bffb5dc3c1d3b3da637cb9a0d6 8a028c7c77f6c7bd6d63bc3f02ca9f779eabf16a
446 dd9f218eb91fb857f2a62fe023e1d64a4e7812fe 8a028c7c77f6c7bd6d63bc3f02ca9f779eabf16a
445 dd9f218eb91fb857f2a62fe023e1d64a4e7812fe 8a028c7c77f6c7bd6d63bc3f02ca9f779eabf16a
447
446 $ tail a/.hg/shamap
448 ==> a/.hg/shamap <==
449 8a028c7c77f6c7bd6d63bc3f02ca9f779eabf16a 86f3f774ffb682bffb5dc3c1d3b3da637cb9a0d6
447 8a028c7c77f6c7bd6d63bc3f02ca9f779eabf16a 86f3f774ffb682bffb5dc3c1d3b3da637cb9a0d6
450
448 $ tail b/.hg/shamap
451 ==> b/.hg/shamap <==
452 8a028c7c77f6c7bd6d63bc3f02ca9f779eabf16a dd9f218eb91fb857f2a62fe023e1d64a4e7812fe
449 8a028c7c77f6c7bd6d63bc3f02ca9f779eabf16a dd9f218eb91fb857f2a62fe023e1d64a4e7812fe
453
450
454 $ hg convert a 0
451 $ hg convert a 0
455 scanning source...
452 scanning source...
456 sorting...
453 sorting...
457 converting...
454 converting...
458 0 a
455 0 a
459
456
460 $ hg convert b 0
457 $ hg convert b 0
461 scanning source...
458 scanning source...
462 sorting...
459 sorting...
463 converting...
460 converting...
464 0 b
461 0 b
465
462
466 $ hg -R 0 log -G
463 $ hg -R 0 log -G
467 o changeset: 2:637fbbbe96b6
464 o changeset: 2:637fbbbe96b6
468 | tag: tip
465 | tag: tip
469 | parent: 0:8a028c7c77f6
466 | parent: 0:8a028c7c77f6
470 | user: test
467 | user: test
471 | date: Thu Jan 01 00:00:00 1970 +0000
468 | date: Thu Jan 01 00:00:00 1970 +0000
472 | summary: b
469 | summary: b
473 |
470 |
474 | o changeset: 1:ec7b9c96e692
471 | o changeset: 1:ec7b9c96e692
475 |/ user: test
472 |/ user: test
476 | date: Thu Jan 01 00:00:00 1970 +0000
473 | date: Thu Jan 01 00:00:00 1970 +0000
477 | summary: a
474 | summary: a
478 |
475 |
479 @ changeset: 0:8a028c7c77f6
476 @ changeset: 0:8a028c7c77f6
480 user: test
477 user: test
481 date: Thu Jan 01 00:00:00 1970 +0000
478 date: Thu Jan 01 00:00:00 1970 +0000
482 summary: 0
479 summary: 0
483
480
484 $ hg convert --filemap filemap-b 0 a --config convert.hg.revs=1::
481 $ hg convert --filemap filemap-b 0 a --config convert.hg.revs=1::
485 scanning source...
482 scanning source...
486 sorting...
483 sorting...
487 converting...
484 converting...
488
485
489 $ hg -R 0 up -r1
486 $ hg -R 0 up -r1
490 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
487 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
491 $ echo f >> 0/f
488 $ echo f >> 0/f
492 $ hg -R 0 ci -mx
489 $ hg -R 0 ci -mx
493
490
494 $ hg convert --filemap filemap-b 0 a --config convert.hg.revs=1::
491 $ hg convert --filemap filemap-b 0 a --config convert.hg.revs=1::
495 scanning source...
492 scanning source...
496 sorting...
493 sorting...
497 converting...
494 converting...
498 0 x
495 0 x
499
496
500 $ hg -R a log -G -T '{rev} {desc|firstline} ({files})\n'
497 $ hg -R a log -G -T '{rev} {desc|firstline} ({files})\n'
501 o 2 x (f)
498 o 2 x (f)
502 |
499 |
503 @ 1 a (f)
500 @ 1 a (f)
504 |
501 |
505 o 0 0 (a-only f)
502 o 0 0 (a-only f)
506
503
507 $ hg -R a mani -r tip
504 $ hg -R a mani -r tip
508 a-only
505 a-only
509 f
506 f
510
507
511 An additional round, demonstrating that unchanged files don't get converted
508 An additional round, demonstrating that unchanged files don't get converted
512
509
513 $ echo f >> 0/f
510 $ echo f >> 0/f
514 $ echo f >> 0/a-only
511 $ echo f >> 0/a-only
515 $ hg -R 0 ci -m "extra f+a-only change"
512 $ hg -R 0 ci -m "extra f+a-only change"
516
513
517 $ hg convert --filemap filemap-b 0 a --config convert.hg.revs=1::
514 $ hg convert --filemap filemap-b 0 a --config convert.hg.revs=1::
518 scanning source...
515 scanning source...
519 sorting...
516 sorting...
520 converting...
517 converting...
521 0 extra f+a-only change
518 0 extra f+a-only change
522
519
523 $ hg -R a log -G -T '{rev} {desc|firstline} ({files})\n'
520 $ hg -R a log -G -T '{rev} {desc|firstline} ({files})\n'
524 o 3 extra f+a-only change (f)
521 o 3 extra f+a-only change (f)
525 |
522 |
526 o 2 x (f)
523 o 2 x (f)
527 |
524 |
528 @ 1 a (f)
525 @ 1 a (f)
529 |
526 |
530 o 0 0 (a-only f)
527 o 0 0 (a-only f)
531
528
532
529
533 Conversion after rollback
530 Conversion after rollback
534
531
535 $ hg -R a rollback -f
532 $ hg -R a rollback -f
536 repository tip rolled back to revision 2 (undo convert)
533 repository tip rolled back to revision 2 (undo convert)
537
534
538 $ hg convert --filemap filemap-b 0 a --config convert.hg.revs=1::
535 $ hg convert --filemap filemap-b 0 a --config convert.hg.revs=1::
539 scanning source...
536 scanning source...
540 sorting...
537 sorting...
541 converting...
538 converting...
542 0 extra f+a-only change
539 0 extra f+a-only change
543
540
544 $ hg -R a log -G -T '{rev} {desc|firstline} ({files})\n'
541 $ hg -R a log -G -T '{rev} {desc|firstline} ({files})\n'
545 o 3 extra f+a-only change (f)
542 o 3 extra f+a-only change (f)
546 |
543 |
547 o 2 x (f)
544 o 2 x (f)
548 |
545 |
549 @ 1 a (f)
546 @ 1 a (f)
550 |
547 |
551 o 0 0 (a-only f)
548 o 0 0 (a-only f)
552
549
553 Convert with --full adds and removes files that didn't change
550 Convert with --full adds and removes files that didn't change
554
551
555 $ echo f >> 0/f
552 $ echo f >> 0/f
556 $ hg -R 0 ci -m "f"
553 $ hg -R 0 ci -m "f"
557 $ hg convert --filemap filemap-b --full 0 a --config convert.hg.revs=1::
554 $ hg convert --filemap filemap-b --full 0 a --config convert.hg.revs=1::
558 scanning source...
555 scanning source...
559 sorting...
556 sorting...
560 converting...
557 converting...
561 0 f
558 0 f
562 $ hg -R a status --change tip
559 $ hg -R a status --change tip
563 M f
560 M f
564 A b-only
561 A b-only
565 R a-only
562 R a-only
General Comments 0
You need to be logged in to leave comments. Login now