Show More
This diff has been collapsed as it changes many lines, (1656 lines changed) Show them Hide them | |||||
@@ -1,2427 +1,771 | |||||
1 | #testcases abortcommand abortflag |
|
1 | #testcases abortcommand abortflag | |
2 |
|
2 | |||
3 | $ cat >> $HGRCPATH <<EOF |
|
|||
4 | > [extdiff] |
|
|||
5 | > # for portability: |
|
|||
6 | > pdiff = sh "$RUNTESTDIR/pdiff" |
|
|||
7 | > EOF |
|
|||
8 |
|
||||
9 | #if abortflag |
|
3 | #if abortflag | |
10 | $ cat >> $HGRCPATH <<EOF |
|
4 | $ cat >> $HGRCPATH <<EOF | |
11 | > [alias] |
|
5 | > [alias] | |
12 | > abort = graft --abort |
|
6 | > abort = graft --abort | |
13 | > EOF |
|
7 | > EOF | |
14 | #endif |
|
8 | #endif | |
15 |
|
9 | |||
16 | Create a repo with some stuff in it: |
|
|||
17 |
|
||||
18 | $ hg init a |
|
|||
19 | $ cd a |
|
|||
20 | $ echo a > a |
|
|||
21 | $ echo a > d |
|
|||
22 | $ echo a > e |
|
|||
23 | $ hg ci -qAm0 |
|
|||
24 | $ echo b > a |
|
|||
25 | $ hg ci -m1 -u bar |
|
|||
26 | $ hg mv a b |
|
|||
27 | $ hg ci -m2 |
|
|||
28 | $ hg cp b c |
|
|||
29 | $ hg ci -m3 -u baz |
|
|||
30 | $ echo b > d |
|
|||
31 | $ echo f > e |
|
|||
32 | $ hg ci -m4 |
|
|||
33 | $ hg up -q 3 |
|
|||
34 | $ echo b > e |
|
|||
35 | $ hg branch -q stable |
|
|||
36 | $ hg ci -m5 |
|
|||
37 | $ hg merge -q default --tool internal:local # for conflicts in e, choose 5 and ignore 4 |
|
|||
38 | $ hg branch -q default |
|
|||
39 | $ hg ci -m6 |
|
|||
40 | $ hg phase --public 3 |
|
|||
41 | $ hg phase --force --secret 6 |
|
|||
42 |
|
||||
43 | $ hg log -G --template '{author}@{rev}.{phase}: {desc}\n' |
|
|||
44 | @ test@6.secret: 6 |
|
|||
45 | |\ |
|
|||
46 | | o test@5.draft: 5 |
|
|||
47 | | | |
|
|||
48 | o | test@4.draft: 4 |
|
|||
49 | |/ |
|
|||
50 | o baz@3.public: 3 |
|
|||
51 | | |
|
|||
52 | o test@2.public: 2 |
|
|||
53 | | |
|
|||
54 | o bar@1.public: 1 |
|
|||
55 | | |
|
|||
56 | o test@0.public: 0 |
|
|||
57 |
|
||||
58 | Test --base for grafting the merge of 4 from the perspective of 5, thus only getting the change to d |
|
|||
59 |
|
||||
60 | $ hg up -cqr 3 |
|
|||
61 | $ hg graft -r 6 --base 5 |
|
|||
62 | grafting 6:25a2b029d3ae "6" (tip) |
|
|||
63 | merging e |
|
|||
64 | $ hg st --change . |
|
|||
65 | M d |
|
|||
66 |
|
||||
67 | $ hg -q strip . --config extensions.strip= |
|
|||
68 |
|
||||
69 | Test --base for collapsing changesets 2 and 3, thus getting both b and c |
|
|||
70 |
|
||||
71 | $ hg up -cqr 0 |
|
|||
72 | $ hg graft -r 3 --base 1 |
|
|||
73 | grafting 3:4c60f11aa304 "3" |
|
|||
74 | merging a and b to b |
|
|||
75 | merging a and c to c |
|
|||
76 | $ hg st --change . |
|
|||
77 | A b |
|
|||
78 | A c |
|
|||
79 | R a |
|
|||
80 |
|
||||
81 | $ hg -q strip . --config extensions.strip= |
|
|||
82 |
|
||||
83 | Specifying child as --base revision fails safely (perhaps slightly confusing, but consistent) |
|
|||
84 |
|
||||
85 | $ hg graft -r 2 --base 3 |
|
|||
86 | grafting 2:5c095ad7e90f "2" |
|
|||
87 | note: possible conflict - c was deleted and renamed to: |
|
|||
88 | a |
|
|||
89 | note: graft of 2:5c095ad7e90f created no changes to commit |
|
|||
90 |
|
||||
91 | Can't continue without starting: |
|
|||
92 |
|
||||
93 | $ hg -q up -cr tip |
|
|||
94 | $ hg rm -q e |
|
|||
95 | $ hg graft --continue |
|
|||
96 | abort: no graft in progress |
|
|||
97 | [255] |
|
|||
98 | $ hg revert -r . -q e |
|
|||
99 |
|
||||
100 | Need to specify a rev: |
|
|||
101 |
|
||||
102 | $ hg graft |
|
|||
103 | abort: no revisions specified |
|
|||
104 | [255] |
|
|||
105 |
|
||||
106 | Can't graft ancestor: |
|
|||
107 |
|
||||
108 | $ hg graft 1 2 |
|
|||
109 | skipping ancestor revision 1:5d205f8b35b6 |
|
|||
110 | skipping ancestor revision 2:5c095ad7e90f |
|
|||
111 | [255] |
|
|||
112 |
|
||||
113 | Specify revisions with -r: |
|
|||
114 |
|
||||
115 | $ hg graft -r 1 -r 2 |
|
|||
116 | skipping ancestor revision 1:5d205f8b35b6 |
|
|||
117 | skipping ancestor revision 2:5c095ad7e90f |
|
|||
118 | [255] |
|
|||
119 |
|
||||
120 | $ hg graft -r 1 2 |
|
|||
121 | warning: inconsistent use of --rev might give unexpected revision ordering! |
|
|||
122 | skipping ancestor revision 2:5c095ad7e90f |
|
|||
123 | skipping ancestor revision 1:5d205f8b35b6 |
|
|||
124 | [255] |
|
|||
125 |
|
||||
126 | Conflicting date/user options: |
|
|||
127 |
|
||||
128 | $ hg up -q 0 |
|
|||
129 | $ hg graft -U --user foo 2 |
|
|||
130 | abort: cannot specify both --user and --currentuser |
|
|||
131 | [255] |
|
|||
132 | $ hg graft -D --date '0 0' 2 |
|
|||
133 | abort: cannot specify both --date and --currentdate |
|
|||
134 | [255] |
|
|||
135 |
|
||||
136 | Can't graft with dirty wd: |
|
|||
137 |
|
||||
138 | $ hg up -q 0 |
|
|||
139 | $ echo foo > a |
|
|||
140 | $ hg graft 1 |
|
|||
141 | abort: uncommitted changes |
|
|||
142 | [255] |
|
|||
143 | $ hg revert a |
|
|||
144 |
|
||||
145 | Graft a rename: |
|
|||
146 | (this also tests that editor is invoked if '--edit' is specified) |
|
|||
147 |
|
||||
148 | $ hg status --rev "2^1" --rev 2 |
|
|||
149 | A b |
|
|||
150 | R a |
|
|||
151 | $ HGEDITOR=cat hg graft 2 -u foo --edit |
|
|||
152 | grafting 2:5c095ad7e90f "2" |
|
|||
153 | merging a and b to b |
|
|||
154 | 2 |
|
|||
155 |
|
||||
156 |
|
||||
157 | HG: Enter commit message. Lines beginning with 'HG:' are removed. |
|
|||
158 | HG: Leave message empty to abort commit. |
|
|||
159 | HG: -- |
|
|||
160 | HG: user: foo |
|
|||
161 | HG: branch 'default' |
|
|||
162 | HG: added b |
|
|||
163 | HG: removed a |
|
|||
164 | $ hg export tip --git |
|
|||
165 | # HG changeset patch |
|
|||
166 | # User foo |
|
|||
167 | # Date 0 0 |
|
|||
168 | # Thu Jan 01 00:00:00 1970 +0000 |
|
|||
169 | # Node ID ef0ef43d49e79e81ddafdc7997401ba0041efc82 |
|
|||
170 | # Parent 68795b066622ca79a25816a662041d8f78f3cd9e |
|
|||
171 | 2 |
|
|||
172 |
|
||||
173 | diff --git a/a b/b |
|
|||
174 | rename from a |
|
|||
175 | rename to b |
|
|||
176 |
|
||||
177 | Look for extra:source |
|
|||
178 |
|
||||
179 | $ hg log --debug -r tip |
|
|||
180 | changeset: 7:ef0ef43d49e79e81ddafdc7997401ba0041efc82 |
|
|||
181 | tag: tip |
|
|||
182 | phase: draft |
|
|||
183 | parent: 0:68795b066622ca79a25816a662041d8f78f3cd9e |
|
|||
184 | parent: -1:0000000000000000000000000000000000000000 |
|
|||
185 | manifest: 7:e59b6b228f9cbf9903d5e9abf996e083a1f533eb |
|
|||
186 | user: foo |
|
|||
187 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
|||
188 | files+: b |
|
|||
189 | files-: a |
|
|||
190 | extra: branch=default |
|
|||
191 | extra: source=5c095ad7e90f871700f02dd1fa5012cb4498a2d4 |
|
|||
192 | description: |
|
|||
193 | 2 |
|
|||
194 |
|
||||
195 |
|
||||
196 |
|
||||
197 | Graft out of order, skipping a merge and a duplicate |
|
|||
198 | (this also tests that editor is not invoked if '--edit' is not specified) |
|
|||
199 |
|
||||
200 | $ hg graft 1 5 4 3 'merge()' 2 -n |
|
|||
201 | skipping ungraftable merge revision 6 |
|
|||
202 | skipping revision 2:5c095ad7e90f (already grafted to 7:ef0ef43d49e7) |
|
|||
203 | grafting 1:5d205f8b35b6 "1" |
|
|||
204 | grafting 5:97f8bfe72746 "5" |
|
|||
205 | grafting 4:9c233e8e184d "4" |
|
|||
206 | grafting 3:4c60f11aa304 "3" |
|
|||
207 |
|
||||
208 | $ HGEDITOR=cat hg graft 1 5 'merge()' 2 --debug |
|
|||
209 | skipping ungraftable merge revision 6 |
|
|||
210 | scanning for duplicate grafts |
|
|||
211 | skipping revision 2:5c095ad7e90f (already grafted to 7:ef0ef43d49e7) |
|
|||
212 | grafting 1:5d205f8b35b6 "1" |
|
|||
213 | unmatched files in local: |
|
|||
214 | b |
|
|||
215 | all copies found (* = to merge, ! = divergent, % = renamed and deleted): |
|
|||
216 | src: 'a' -> dst: 'b' * |
|
|||
217 | checking for directory renames |
|
|||
218 | resolving manifests |
|
|||
219 | branchmerge: True, force: True, partial: False |
|
|||
220 | ancestor: 68795b066622, local: ef0ef43d49e7+, remote: 5d205f8b35b6 |
|
|||
221 | preserving b for resolve of b |
|
|||
222 | starting 4 threads for background file closing (?) |
|
|||
223 | b: local copied/moved from a -> m (premerge) |
|
|||
224 | picked tool ':merge' for b (binary False symlink False changedelete False) |
|
|||
225 | merging b and a to b |
|
|||
226 | my b@ef0ef43d49e7+ other a@5d205f8b35b6 ancestor a@68795b066622 |
|
|||
227 | premerge successful |
|
|||
228 | committing files: |
|
|||
229 | b |
|
|||
230 | committing manifest |
|
|||
231 | committing changelog |
|
|||
232 | updating the branch cache |
|
|||
233 | grafting 5:97f8bfe72746 "5" |
|
|||
234 | all copies found (* = to merge, ! = divergent, % = renamed and deleted): |
|
|||
235 | src: 'c' -> dst: 'b' |
|
|||
236 | checking for directory renames |
|
|||
237 | resolving manifests |
|
|||
238 | branchmerge: True, force: True, partial: False |
|
|||
239 | ancestor: 4c60f11aa304, local: 6b9e5368ca4e+, remote: 97f8bfe72746 |
|
|||
240 | e: remote is newer -> g |
|
|||
241 | getting e |
|
|||
242 | committing files: |
|
|||
243 | e |
|
|||
244 | committing manifest |
|
|||
245 | committing changelog |
|
|||
246 | updating the branch cache |
|
|||
247 | $ HGEDITOR=cat hg graft 4 3 --log --debug |
|
|||
248 | scanning for duplicate grafts |
|
|||
249 | grafting 4:9c233e8e184d "4" |
|
|||
250 | all copies found (* = to merge, ! = divergent, % = renamed and deleted): |
|
|||
251 | src: 'c' -> dst: 'b' |
|
|||
252 | checking for directory renames |
|
|||
253 | resolving manifests |
|
|||
254 | branchmerge: True, force: True, partial: False |
|
|||
255 | ancestor: 4c60f11aa304, local: 1905859650ec+, remote: 9c233e8e184d |
|
|||
256 | preserving e for resolve of e |
|
|||
257 | d: remote is newer -> g |
|
|||
258 | getting d |
|
|||
259 | e: versions differ -> m (premerge) |
|
|||
260 | picked tool ':merge' for e (binary False symlink False changedelete False) |
|
|||
261 | merging e |
|
|||
262 | my e@1905859650ec+ other e@9c233e8e184d ancestor e@4c60f11aa304 |
|
|||
263 | e: versions differ -> m (merge) |
|
|||
264 | picked tool ':merge' for e (binary False symlink False changedelete False) |
|
|||
265 | my e@1905859650ec+ other e@9c233e8e184d ancestor e@4c60f11aa304 |
|
|||
266 | warning: conflicts while merging e! (edit, then use 'hg resolve --mark') |
|
|||
267 | abort: unresolved conflicts, can't continue |
|
|||
268 | (use 'hg resolve' and 'hg graft --continue') |
|
|||
269 | [255] |
|
|||
270 |
|
||||
271 | Summary should mention graft: |
|
|||
272 |
|
||||
273 | $ hg summary |grep graft |
|
|||
274 | commit: 2 modified, 2 unknown, 1 unresolved (graft in progress) |
|
|||
275 |
|
||||
276 | Using status to get more context |
|
|||
277 |
|
||||
278 | $ hg status --verbose |
|
|||
279 | M d |
|
|||
280 | M e |
|
|||
281 | ? a.orig |
|
|||
282 | ? e.orig |
|
|||
283 | # The repository is in an unfinished *graft* state. |
|
|||
284 |
|
||||
285 | # Unresolved merge conflicts: |
|
|||
286 | # |
|
|||
287 | # e |
|
|||
288 | # |
|
|||
289 | # To mark files as resolved: hg resolve --mark FILE |
|
|||
290 |
|
||||
291 | # To continue: hg graft --continue |
|
|||
292 | # To abort: hg graft --abort |
|
|||
293 | # To stop: hg graft --stop |
|
|||
294 |
|
||||
295 |
|
||||
296 | Commit while interrupted should fail: |
|
|||
297 |
|
||||
298 | $ hg ci -m 'commit interrupted graft' |
|
|||
299 | abort: graft in progress |
|
|||
300 | (use 'hg graft --continue' or 'hg graft --stop' to stop) |
|
|||
301 | [255] |
|
|||
302 |
|
||||
303 | Abort the graft and try committing: |
|
|||
304 |
|
||||
305 | $ hg up -C . |
|
|||
306 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
|||
307 | $ echo c >> e |
|
|||
308 | $ hg ci -mtest |
|
|||
309 |
|
||||
310 | $ hg strip . --config extensions.strip= |
|
|||
311 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
|||
312 | saved backup bundle to $TESTTMP/a/.hg/strip-backup/*-backup.hg (glob) |
|
|||
313 |
|
||||
314 | Graft again: |
|
|||
315 |
|
||||
316 | $ hg graft 1 5 4 3 'merge()' 2 |
|
|||
317 | skipping ungraftable merge revision 6 |
|
|||
318 | skipping revision 2:5c095ad7e90f (already grafted to 7:ef0ef43d49e7) |
|
|||
319 | skipping revision 1:5d205f8b35b6 (already grafted to 8:6b9e5368ca4e) |
|
|||
320 | skipping revision 5:97f8bfe72746 (already grafted to 9:1905859650ec) |
|
|||
321 | grafting 4:9c233e8e184d "4" |
|
|||
322 | merging e |
|
|||
323 | warning: conflicts while merging e! (edit, then use 'hg resolve --mark') |
|
|||
324 | abort: unresolved conflicts, can't continue |
|
|||
325 | (use 'hg resolve' and 'hg graft --continue') |
|
|||
326 | [255] |
|
|||
327 |
|
||||
328 | Continue without resolve should fail: |
|
|||
329 |
|
||||
330 | $ hg graft -c |
|
|||
331 | grafting 4:9c233e8e184d "4" |
|
|||
332 | abort: unresolved merge conflicts (see 'hg help resolve') |
|
|||
333 | [255] |
|
|||
334 |
|
||||
335 | Fix up: |
|
|||
336 |
|
||||
337 | $ echo b > e |
|
|||
338 | $ hg resolve -m e |
|
|||
339 | (no more unresolved files) |
|
|||
340 | continue: hg graft --continue |
|
|||
341 |
|
||||
342 | Continue with a revision should fail: |
|
|||
343 |
|
||||
344 | $ hg graft -c 6 |
|
|||
345 | abort: can't specify --continue and revisions |
|
|||
346 | [255] |
|
|||
347 |
|
||||
348 | $ hg graft -c -r 6 |
|
|||
349 | abort: can't specify --continue and revisions |
|
|||
350 | [255] |
|
|||
351 |
|
||||
352 | Continue for real, clobber usernames |
|
|||
353 |
|
||||
354 | $ hg graft -c -U |
|
|||
355 | grafting 4:9c233e8e184d "4" |
|
|||
356 | grafting 3:4c60f11aa304 "3" |
|
|||
357 |
|
||||
358 | Compare with original: |
|
|||
359 |
|
||||
360 | $ hg diff -r 6 |
|
|||
361 | $ hg status --rev 0:. -C |
|
|||
362 | M d |
|
|||
363 | M e |
|
|||
364 | A b |
|
|||
365 | a |
|
|||
366 | A c |
|
|||
367 | a |
|
|||
368 | R a |
|
|||
369 |
|
||||
370 | View graph: |
|
|||
371 |
|
||||
372 | $ hg log -G --template '{author}@{rev}.{phase}: {desc}\n' |
|
|||
373 | @ test@11.draft: 3 |
|
|||
374 | | |
|
|||
375 | o test@10.draft: 4 |
|
|||
376 | | |
|
|||
377 | o test@9.draft: 5 |
|
|||
378 | | |
|
|||
379 | o bar@8.draft: 1 |
|
|||
380 | | |
|
|||
381 | o foo@7.draft: 2 |
|
|||
382 | | |
|
|||
383 | | o test@6.secret: 6 |
|
|||
384 | | |\ |
|
|||
385 | | | o test@5.draft: 5 |
|
|||
386 | | | | |
|
|||
387 | | o | test@4.draft: 4 |
|
|||
388 | | |/ |
|
|||
389 | | o baz@3.public: 3 |
|
|||
390 | | | |
|
|||
391 | | o test@2.public: 2 |
|
|||
392 | | | |
|
|||
393 | | o bar@1.public: 1 |
|
|||
394 | |/ |
|
|||
395 | o test@0.public: 0 |
|
|||
396 |
|
||||
397 | Graft again onto another branch should preserve the original source |
|
|||
398 | $ hg up -q 0 |
|
|||
399 | $ echo 'g'>g |
|
|||
400 | $ hg add g |
|
|||
401 | $ hg ci -m 7 |
|
|||
402 | created new head |
|
|||
403 | $ hg graft 7 |
|
|||
404 | grafting 7:ef0ef43d49e7 "2" |
|
|||
405 |
|
||||
406 | $ hg log -r 7 --template '{rev}:{node}\n' |
|
|||
407 | 7:ef0ef43d49e79e81ddafdc7997401ba0041efc82 |
|
|||
408 | $ hg log -r 2 --template '{rev}:{node}\n' |
|
|||
409 | 2:5c095ad7e90f871700f02dd1fa5012cb4498a2d4 |
|
|||
410 |
|
||||
411 | $ hg log --debug -r tip |
|
|||
412 | changeset: 13:7a4785234d87ec1aa420ed6b11afe40fa73e12a9 |
|
|||
413 | tag: tip |
|
|||
414 | phase: draft |
|
|||
415 | parent: 12:b592ea63bb0c19a6c5c44685ee29a2284f9f1b8f |
|
|||
416 | parent: -1:0000000000000000000000000000000000000000 |
|
|||
417 | manifest: 13:dc313617b8c32457c0d589e0dbbedfe71f3cd637 |
|
|||
418 | user: foo |
|
|||
419 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
|||
420 | files+: b |
|
|||
421 | files-: a |
|
|||
422 | extra: branch=default |
|
|||
423 | extra: intermediate-source=ef0ef43d49e79e81ddafdc7997401ba0041efc82 |
|
|||
424 | extra: source=5c095ad7e90f871700f02dd1fa5012cb4498a2d4 |
|
|||
425 | description: |
|
|||
426 | 2 |
|
|||
427 |
|
||||
428 |
|
||||
429 | Disallow grafting an already grafted cset onto its original branch |
|
|||
430 | $ hg up -q 6 |
|
|||
431 | $ hg graft 7 |
|
|||
432 | skipping already grafted revision 7:ef0ef43d49e7 (was grafted from 2:5c095ad7e90f) |
|
|||
433 | [255] |
|
|||
434 |
|
||||
435 | $ hg pdiff --config extensions.extdiff= --patch -r 2 -r 13 |
|
|||
436 | --- */hg-5c095ad7e90f.patch * (glob) |
|
|||
437 | +++ */hg-7a4785234d87.patch * (glob) |
|
|||
438 | @@ -1,18 +1,18 @@ |
|
|||
439 | # HG changeset patch |
|
|||
440 | -# User test |
|
|||
441 | +# User foo |
|
|||
442 | # Date 0 0 |
|
|||
443 | # Thu Jan 01 00:00:00 1970 +0000 |
|
|||
444 | -# Node ID 5c095ad7e90f871700f02dd1fa5012cb4498a2d4 |
|
|||
445 | -# Parent 5d205f8b35b66bc36375c9534ffd3237730e8f04 |
|
|||
446 | +# Node ID 7a4785234d87ec1aa420ed6b11afe40fa73e12a9 |
|
|||
447 | +# Parent b592ea63bb0c19a6c5c44685ee29a2284f9f1b8f |
|
|||
448 | 2 |
|
|||
449 |
|
||||
450 | -diff -r 5d205f8b35b6 -r 5c095ad7e90f a |
|
|||
451 | +diff -r b592ea63bb0c -r 7a4785234d87 a |
|
|||
452 | --- a/a Thu Jan 01 00:00:00 1970 +0000 |
|
|||
453 | +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
|||
454 | @@ -1,1 +0,0 @@ |
|
|||
455 | --b |
|
|||
456 | -diff -r 5d205f8b35b6 -r 5c095ad7e90f b |
|
|||
457 | +-a |
|
|||
458 | +diff -r b592ea63bb0c -r 7a4785234d87 b |
|
|||
459 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
|||
460 | +++ b/b Thu Jan 01 00:00:00 1970 +0000 |
|
|||
461 | @@ -0,0 +1,1 @@ |
|
|||
462 | -+b |
|
|||
463 | ++a |
|
|||
464 | [1] |
|
|||
465 |
|
||||
466 | $ hg pdiff --config extensions.extdiff= --patch -r 2 -r 13 -X . |
|
|||
467 | --- */hg-5c095ad7e90f.patch * (glob) |
|
|||
468 | +++ */hg-7a4785234d87.patch * (glob) |
|
|||
469 | @@ -1,8 +1,8 @@ |
|
|||
470 | # HG changeset patch |
|
|||
471 | -# User test |
|
|||
472 | +# User foo |
|
|||
473 | # Date 0 0 |
|
|||
474 | # Thu Jan 01 00:00:00 1970 +0000 |
|
|||
475 | -# Node ID 5c095ad7e90f871700f02dd1fa5012cb4498a2d4 |
|
|||
476 | -# Parent 5d205f8b35b66bc36375c9534ffd3237730e8f04 |
|
|||
477 | +# Node ID 7a4785234d87ec1aa420ed6b11afe40fa73e12a9 |
|
|||
478 | +# Parent b592ea63bb0c19a6c5c44685ee29a2284f9f1b8f |
|
|||
479 | 2 |
|
|||
480 |
|
||||
481 | [1] |
|
|||
482 |
|
||||
483 | Disallow grafting already grafted csets with the same origin onto each other |
|
|||
484 | $ hg up -q 13 |
|
|||
485 | $ hg graft 2 |
|
|||
486 | skipping revision 2:5c095ad7e90f (already grafted to 13:7a4785234d87) |
|
|||
487 | [255] |
|
|||
488 | $ hg graft 7 |
|
|||
489 | skipping already grafted revision 7:ef0ef43d49e7 (13:7a4785234d87 also has origin 2:5c095ad7e90f) |
|
|||
490 | [255] |
|
|||
491 |
|
||||
492 | $ hg up -q 7 |
|
|||
493 | $ hg graft 2 |
|
|||
494 | skipping revision 2:5c095ad7e90f (already grafted to 7:ef0ef43d49e7) |
|
|||
495 | [255] |
|
|||
496 | $ hg graft tip |
|
|||
497 | skipping already grafted revision 13:7a4785234d87 (7:ef0ef43d49e7 also has origin 2:5c095ad7e90f) |
|
|||
498 | [255] |
|
|||
499 |
|
||||
500 | Graft with --log |
|
|||
501 |
|
||||
502 | $ hg up -Cq 1 |
|
|||
503 | $ hg graft 3 --log -u foo |
|
|||
504 | grafting 3:4c60f11aa304 "3" |
|
|||
505 | warning: can't find ancestor for 'c' copied from 'b'! |
|
|||
506 | $ hg log --template '{rev}:{node|short} {parents} {desc}\n' -r tip |
|
|||
507 | 14:0c921c65ef1e 1:5d205f8b35b6 3 |
|
|||
508 | (grafted from 4c60f11aa304a54ae1c199feb94e7fc771e51ed8) |
|
|||
509 |
|
||||
510 | Resolve conflicted graft |
|
|||
511 | $ hg up -q 0 |
|
|||
512 | $ echo b > a |
|
|||
513 | $ hg ci -m 8 |
|
|||
514 | created new head |
|
|||
515 | $ echo c > a |
|
|||
516 | $ hg ci -m 9 |
|
|||
517 | $ hg graft 1 --tool internal:fail |
|
|||
518 | grafting 1:5d205f8b35b6 "1" |
|
|||
519 | abort: unresolved conflicts, can't continue |
|
|||
520 | (use 'hg resolve' and 'hg graft --continue') |
|
|||
521 | [255] |
|
|||
522 | $ hg resolve --all |
|
|||
523 | merging a |
|
|||
524 | warning: conflicts while merging a! (edit, then use 'hg resolve --mark') |
|
|||
525 | [1] |
|
|||
526 | $ cat a |
|
|||
527 | <<<<<<< local: aaa4406d4f0a - test: 9 |
|
|||
528 | c |
|
|||
529 | ======= |
|
|||
530 | b |
|
|||
531 | >>>>>>> graft: 5d205f8b35b6 - bar: 1 |
|
|||
532 | $ echo b > a |
|
|||
533 | $ hg resolve -m a |
|
|||
534 | (no more unresolved files) |
|
|||
535 | continue: hg graft --continue |
|
|||
536 | $ hg graft -c |
|
|||
537 | grafting 1:5d205f8b35b6 "1" |
|
|||
538 | $ hg export tip --git |
|
|||
539 | # HG changeset patch |
|
|||
540 | # User bar |
|
|||
541 | # Date 0 0 |
|
|||
542 | # Thu Jan 01 00:00:00 1970 +0000 |
|
|||
543 | # Node ID f67661df0c4804d301f064f332b57e7d5ddaf2be |
|
|||
544 | # Parent aaa4406d4f0ae9befd6e58c82ec63706460cbca6 |
|
|||
545 | 1 |
|
|||
546 |
|
||||
547 | diff --git a/a b/a |
|
|||
548 | --- a/a |
|
|||
549 | +++ b/a |
|
|||
550 | @@ -1,1 +1,1 @@ |
|
|||
551 | -c |
|
|||
552 | +b |
|
|||
553 |
|
||||
554 | Resolve conflicted graft with rename |
|
|||
555 | $ echo c > a |
|
|||
556 | $ hg ci -m 10 |
|
|||
557 | $ hg graft 2 --tool internal:fail |
|
|||
558 | grafting 2:5c095ad7e90f "2" |
|
|||
559 | abort: unresolved conflicts, can't continue |
|
|||
560 | (use 'hg resolve' and 'hg graft --continue') |
|
|||
561 | [255] |
|
|||
562 | $ hg resolve --all |
|
|||
563 | merging a and b to b |
|
|||
564 | (no more unresolved files) |
|
|||
565 | continue: hg graft --continue |
|
|||
566 | $ hg graft -c |
|
|||
567 | grafting 2:5c095ad7e90f "2" |
|
|||
568 | $ hg export tip --git |
|
|||
569 | # HG changeset patch |
|
|||
570 | # User test |
|
|||
571 | # Date 0 0 |
|
|||
572 | # Thu Jan 01 00:00:00 1970 +0000 |
|
|||
573 | # Node ID 9627f653b421c61fc1ea4c4e366745070fa3d2bc |
|
|||
574 | # Parent ee295f490a40b97f3d18dd4c4f1c8936c233b612 |
|
|||
575 | 2 |
|
|||
576 |
|
||||
577 | diff --git a/a b/b |
|
|||
578 | rename from a |
|
|||
579 | rename to b |
|
|||
580 |
|
||||
581 | Test simple origin(), with and without args |
|
|||
582 | $ hg log -r 'origin()' |
|
|||
583 | changeset: 1:5d205f8b35b6 |
|
|||
584 | user: bar |
|
|||
585 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
|||
586 | summary: 1 |
|
|||
587 |
|
||||
588 | changeset: 2:5c095ad7e90f |
|
|||
589 | user: test |
|
|||
590 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
|||
591 | summary: 2 |
|
|||
592 |
|
||||
593 | changeset: 3:4c60f11aa304 |
|
|||
594 | user: baz |
|
|||
595 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
|||
596 | summary: 3 |
|
|||
597 |
|
||||
598 | changeset: 4:9c233e8e184d |
|
|||
599 | user: test |
|
|||
600 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
|||
601 | summary: 4 |
|
|||
602 |
|
||||
603 | changeset: 5:97f8bfe72746 |
|
|||
604 | branch: stable |
|
|||
605 | parent: 3:4c60f11aa304 |
|
|||
606 | user: test |
|
|||
607 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
|||
608 | summary: 5 |
|
|||
609 |
|
||||
610 | $ hg log -r 'origin(7)' |
|
|||
611 | changeset: 2:5c095ad7e90f |
|
|||
612 | user: test |
|
|||
613 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
|||
614 | summary: 2 |
|
|||
615 |
|
||||
616 | Now transplant a graft to test following through copies |
|
|||
617 | $ hg up -q 0 |
|
|||
618 | $ hg branch -q dev |
|
|||
619 | $ hg ci -qm "dev branch" |
|
|||
620 | $ hg --config extensions.transplant= transplant -q 7 |
|
|||
621 | $ hg log -r 'origin(.)' |
|
|||
622 | changeset: 2:5c095ad7e90f |
|
|||
623 | user: test |
|
|||
624 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
|||
625 | summary: 2 |
|
|||
626 |
|
||||
627 | Test that the graft and transplant markers in extra are converted, allowing |
|
|||
628 | origin() to still work. Note that these recheck the immediately preceeding two |
|
|||
629 | tests. |
|
|||
630 | $ hg --quiet --config extensions.convert= --config convert.hg.saverev=True convert . ../converted |
|
|||
631 |
|
||||
632 | The graft case |
|
|||
633 | $ hg -R ../converted log -r 7 --template "{rev}: {node}\n{join(extras, '\n')}\n" |
|
|||
634 | 7: 7ae846e9111fc8f57745634250c7b9ac0a60689b |
|
|||
635 | branch=default |
|
|||
636 | convert_revision=ef0ef43d49e79e81ddafdc7997401ba0041efc82 |
|
|||
637 | source=e0213322b2c1a5d5d236c74e79666441bee67a7d |
|
|||
638 | $ hg -R ../converted log -r 'origin(7)' |
|
|||
639 | changeset: 2:e0213322b2c1 |
|
|||
640 | user: test |
|
|||
641 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
|||
642 | summary: 2 |
|
|||
643 |
|
||||
644 | Test that template correctly expands more than one 'extra' (issue4362), and that |
|
|||
645 | 'intermediate-source' is converted. |
|
|||
646 | $ hg -R ../converted log -r 13 --template "{extras % ' Extra: {extra}\n'}" |
|
|||
647 | Extra: branch=default |
|
|||
648 | Extra: convert_revision=7a4785234d87ec1aa420ed6b11afe40fa73e12a9 |
|
|||
649 | Extra: intermediate-source=7ae846e9111fc8f57745634250c7b9ac0a60689b |
|
|||
650 | Extra: source=e0213322b2c1a5d5d236c74e79666441bee67a7d |
|
|||
651 |
|
||||
652 | The transplant case |
|
|||
653 | $ hg -R ../converted log -r tip --template "{rev}: {node}\n{join(extras, '\n')}\n" |
|
|||
654 | 21: fbb6c5cc81002f2b4b49c9d731404688bcae5ade |
|
|||
655 | branch=dev |
|
|||
656 | convert_revision=7e61b508e709a11d28194a5359bc3532d910af21 |
|
|||
657 | transplant_source=z\xe8F\xe9\x11\x1f\xc8\xf5wEcBP\xc7\xb9\xac\n`h\x9b |
|
|||
658 | $ hg -R ../converted log -r 'origin(tip)' |
|
|||
659 | changeset: 2:e0213322b2c1 |
|
|||
660 | user: test |
|
|||
661 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
|||
662 | summary: 2 |
|
|||
663 |
|
||||
664 |
|
||||
665 | Test simple destination |
|
|||
666 | $ hg log -r 'destination()' |
|
|||
667 | changeset: 7:ef0ef43d49e7 |
|
|||
668 | parent: 0:68795b066622 |
|
|||
669 | user: foo |
|
|||
670 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
|||
671 | summary: 2 |
|
|||
672 |
|
||||
673 | changeset: 8:6b9e5368ca4e |
|
|||
674 | user: bar |
|
|||
675 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
|||
676 | summary: 1 |
|
|||
677 |
|
||||
678 | changeset: 9:1905859650ec |
|
|||
679 | user: test |
|
|||
680 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
|||
681 | summary: 5 |
|
|||
682 |
|
||||
683 | changeset: 10:52dc0b4c6907 |
|
|||
684 | user: test |
|
|||
685 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
|||
686 | summary: 4 |
|
|||
687 |
|
||||
688 | changeset: 11:882b35362a6b |
|
|||
689 | user: test |
|
|||
690 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
|||
691 | summary: 3 |
|
|||
692 |
|
||||
693 | changeset: 13:7a4785234d87 |
|
|||
694 | user: foo |
|
|||
695 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
|||
696 | summary: 2 |
|
|||
697 |
|
||||
698 | changeset: 14:0c921c65ef1e |
|
|||
699 | parent: 1:5d205f8b35b6 |
|
|||
700 | user: foo |
|
|||
701 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
|||
702 | summary: 3 |
|
|||
703 |
|
||||
704 | changeset: 17:f67661df0c48 |
|
|||
705 | user: bar |
|
|||
706 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
|||
707 | summary: 1 |
|
|||
708 |
|
||||
709 | changeset: 19:9627f653b421 |
|
|||
710 | user: test |
|
|||
711 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
|||
712 | summary: 2 |
|
|||
713 |
|
||||
714 | changeset: 21:7e61b508e709 |
|
|||
715 | branch: dev |
|
|||
716 | tag: tip |
|
|||
717 | user: foo |
|
|||
718 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
|||
719 | summary: 2 |
|
|||
720 |
|
||||
721 | $ hg log -r 'destination(2)' |
|
|||
722 | changeset: 7:ef0ef43d49e7 |
|
|||
723 | parent: 0:68795b066622 |
|
|||
724 | user: foo |
|
|||
725 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
|||
726 | summary: 2 |
|
|||
727 |
|
||||
728 | changeset: 13:7a4785234d87 |
|
|||
729 | user: foo |
|
|||
730 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
|||
731 | summary: 2 |
|
|||
732 |
|
||||
733 | changeset: 19:9627f653b421 |
|
|||
734 | user: test |
|
|||
735 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
|||
736 | summary: 2 |
|
|||
737 |
|
||||
738 | changeset: 21:7e61b508e709 |
|
|||
739 | branch: dev |
|
|||
740 | tag: tip |
|
|||
741 | user: foo |
|
|||
742 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
|||
743 | summary: 2 |
|
|||
744 |
|
||||
745 | Transplants of grafts can find a destination... |
|
|||
746 | $ hg log -r 'destination(7)' |
|
|||
747 | changeset: 21:7e61b508e709 |
|
|||
748 | branch: dev |
|
|||
749 | tag: tip |
|
|||
750 | user: foo |
|
|||
751 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
|||
752 | summary: 2 |
|
|||
753 |
|
||||
754 | ... grafts of grafts unfortunately can't |
|
|||
755 | $ hg graft -q 13 --debug |
|
|||
756 | scanning for duplicate grafts |
|
|||
757 | grafting 13:7a4785234d87 "2" |
|
|||
758 | all copies found (* = to merge, ! = divergent, % = renamed and deleted): |
|
|||
759 | src: 'a' -> dst: 'b' * |
|
|||
760 | checking for directory renames |
|
|||
761 | resolving manifests |
|
|||
762 | branchmerge: True, force: True, partial: False |
|
|||
763 | ancestor: b592ea63bb0c, local: 7e61b508e709+, remote: 7a4785234d87 |
|
|||
764 | starting 4 threads for background file closing (?) |
|
|||
765 | committing files: |
|
|||
766 | b |
|
|||
767 | warning: can't find ancestor for 'b' copied from 'a'! |
|
|||
768 | reusing manifest from p1 (listed files actually unchanged) |
|
|||
769 | committing changelog |
|
|||
770 | updating the branch cache |
|
|||
771 | $ hg log -r 'destination(13)' |
|
|||
772 | All copies of a cset |
|
|||
773 | $ hg log -r 'origin(13) or destination(origin(13))' |
|
|||
774 | changeset: 2:5c095ad7e90f |
|
|||
775 | user: test |
|
|||
776 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
|||
777 | summary: 2 |
|
|||
778 |
|
||||
779 | changeset: 7:ef0ef43d49e7 |
|
|||
780 | parent: 0:68795b066622 |
|
|||
781 | user: foo |
|
|||
782 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
|||
783 | summary: 2 |
|
|||
784 |
|
||||
785 | changeset: 13:7a4785234d87 |
|
|||
786 | user: foo |
|
|||
787 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
|||
788 | summary: 2 |
|
|||
789 |
|
||||
790 | changeset: 19:9627f653b421 |
|
|||
791 | user: test |
|
|||
792 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
|||
793 | summary: 2 |
|
|||
794 |
|
||||
795 | changeset: 21:7e61b508e709 |
|
|||
796 | branch: dev |
|
|||
797 | user: foo |
|
|||
798 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
|||
799 | summary: 2 |
|
|||
800 |
|
||||
801 | changeset: 22:3a4e92d81b97 |
|
|||
802 | branch: dev |
|
|||
803 | tag: tip |
|
|||
804 | user: foo |
|
|||
805 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
|||
806 | summary: 2 |
|
|||
807 |
|
||||
808 |
|
||||
809 | graft works on complex revset |
|
|||
810 |
|
||||
811 | $ hg graft 'origin(13) or destination(origin(13))' |
|
|||
812 | skipping ancestor revision 21:7e61b508e709 |
|
|||
813 | skipping ancestor revision 22:3a4e92d81b97 |
|
|||
814 | skipping revision 2:5c095ad7e90f (already grafted to 22:3a4e92d81b97) |
|
|||
815 | grafting 7:ef0ef43d49e7 "2" |
|
|||
816 | warning: can't find ancestor for 'b' copied from 'a'! |
|
|||
817 | grafting 13:7a4785234d87 "2" |
|
|||
818 | warning: can't find ancestor for 'b' copied from 'a'! |
|
|||
819 | grafting 19:9627f653b421 "2" |
|
|||
820 | merging b |
|
|||
821 | warning: can't find ancestor for 'b' copied from 'a'! |
|
|||
822 |
|
||||
823 | graft with --force (still doesn't graft merges) |
|
|||
824 |
|
||||
825 | $ hg graft 19 0 6 |
|
|||
826 | skipping ungraftable merge revision 6 |
|
|||
827 | skipping ancestor revision 0:68795b066622 |
|
|||
828 | skipping already grafted revision 19:9627f653b421 (22:3a4e92d81b97 also has origin 2:5c095ad7e90f) |
|
|||
829 | [255] |
|
|||
830 | $ hg graft 19 0 6 --force |
|
|||
831 | skipping ungraftable merge revision 6 |
|
|||
832 | grafting 19:9627f653b421 "2" |
|
|||
833 | merging b |
|
|||
834 | warning: can't find ancestor for 'b' copied from 'a'! |
|
|||
835 | grafting 0:68795b066622 "0" |
|
|||
836 |
|
||||
837 | graft --force after backout |
|
|||
838 |
|
||||
839 | $ echo abc > a |
|
|||
840 | $ hg ci -m 28 |
|
|||
841 | $ hg backout 28 |
|
|||
842 | reverting a |
|
|||
843 | changeset 29:9d95e865b00c backs out changeset 28:cc20d29aec8d |
|
|||
844 | $ hg graft 28 |
|
|||
845 | skipping ancestor revision 28:cc20d29aec8d |
|
|||
846 | [255] |
|
|||
847 | $ hg graft 28 --force |
|
|||
848 | grafting 28:cc20d29aec8d "28" |
|
|||
849 | merging a |
|
|||
850 | $ cat a |
|
|||
851 | abc |
|
|||
852 |
|
||||
853 | graft --continue after --force |
|
|||
854 |
|
||||
855 | $ echo def > a |
|
|||
856 | $ hg ci -m 31 |
|
|||
857 | $ hg graft 28 --force --tool internal:fail |
|
|||
858 | grafting 28:cc20d29aec8d "28" |
|
|||
859 | abort: unresolved conflicts, can't continue |
|
|||
860 | (use 'hg resolve' and 'hg graft --continue') |
|
|||
861 | [255] |
|
|||
862 | $ hg resolve --all |
|
|||
863 | merging a |
|
|||
864 | warning: conflicts while merging a! (edit, then use 'hg resolve --mark') |
|
|||
865 | [1] |
|
|||
866 | $ echo abc > a |
|
|||
867 | $ hg resolve -m a |
|
|||
868 | (no more unresolved files) |
|
|||
869 | continue: hg graft --continue |
|
|||
870 | $ hg graft -c |
|
|||
871 | grafting 28:cc20d29aec8d "28" |
|
|||
872 | $ cat a |
|
|||
873 | abc |
|
|||
874 |
|
||||
875 | Continue testing same origin policy, using revision numbers from test above |
|
|||
876 | but do some destructive editing of the repo: |
|
|||
877 |
|
||||
878 | $ hg up -qC 7 |
|
|||
879 | $ hg tag -l -r 13 tmp |
|
|||
880 | $ hg --config extensions.strip= strip 2 |
|
|||
881 | saved backup bundle to $TESTTMP/a/.hg/strip-backup/5c095ad7e90f-d323a1e4-backup.hg |
|
|||
882 | $ hg graft tmp |
|
|||
883 | skipping already grafted revision 8:7a4785234d87 (2:ef0ef43d49e7 also has unknown origin 5c095ad7e90f) |
|
|||
884 | [255] |
|
|||
885 |
|
||||
886 | Empty graft |
|
|||
887 |
|
||||
888 | $ hg up -qr 26 |
|
|||
889 | $ hg tag -f something |
|
|||
890 | $ hg graft -qr 27 |
|
|||
891 | $ hg graft -f 27 |
|
|||
892 | grafting 27:17d42b8f5d50 "28" |
|
|||
893 | note: graft of 27:17d42b8f5d50 created no changes to commit |
|
|||
894 |
|
||||
895 | $ cd .. |
|
|||
896 |
|
||||
897 | Graft to duplicate a commit |
|
|||
898 |
|
||||
899 | $ hg init graftsibling |
|
|||
900 | $ cd graftsibling |
|
|||
901 | $ touch a |
|
|||
902 | $ hg commit -qAm a |
|
|||
903 | $ touch b |
|
|||
904 | $ hg commit -qAm b |
|
|||
905 | $ hg log -G -T '{rev}\n' |
|
|||
906 | @ 1 |
|
|||
907 | | |
|
|||
908 | o 0 |
|
|||
909 |
|
||||
910 | $ hg up -q 0 |
|
|||
911 | $ hg graft -r 1 |
|
|||
912 | grafting 1:0e067c57feba "b" (tip) |
|
|||
913 | $ hg log -G -T '{rev}\n' |
|
|||
914 | @ 2 |
|
|||
915 | | |
|
|||
916 | | o 1 |
|
|||
917 | |/ |
|
|||
918 | o 0 |
|
|||
919 |
|
||||
920 | Graft to duplicate a commit twice |
|
|||
921 |
|
||||
922 | $ hg up -q 0 |
|
|||
923 | $ hg graft -r 2 |
|
|||
924 | grafting 2:044ec77f6389 "b" (tip) |
|
|||
925 | $ hg log -G -T '{rev}\n' |
|
|||
926 | @ 3 |
|
|||
927 | | |
|
|||
928 | | o 2 |
|
|||
929 | |/ |
|
|||
930 | | o 1 |
|
|||
931 | |/ |
|
|||
932 | o 0 |
|
|||
933 |
|
||||
934 | Graft from behind a move or rename |
|
|||
935 | ================================== |
|
|||
936 |
|
||||
937 | NOTE: This is affected by issue5343, and will need updating when it's fixed |
|
|||
938 |
|
||||
939 | Consider this topology for a regular graft: |
|
|||
940 |
|
||||
941 | o c1 |
|
|||
942 | | |
|
|||
943 | | o c2 |
|
|||
944 | | | |
|
|||
945 | | o ca # stands for "common ancestor" |
|
|||
946 | |/ |
|
|||
947 | o cta # stands for "common topological ancestor" |
|
|||
948 |
|
||||
949 | Note that in issue5343, ca==cta. |
|
|||
950 |
|
||||
951 | The following table shows the possible cases. Here, "x->y" and, equivalently, |
|
|||
952 | "y<-x", where x is an ancestor of y, means that some copy happened from x to y. |
|
|||
953 |
|
||||
954 | name | c1<-cta | cta<->ca | ca->c2 |
|
|||
955 | A.0 | | | |
|
|||
956 | A.1 | X | | |
|
|||
957 | A.2 | | X | |
|
|||
958 | A.3 | | | X |
|
|||
959 | A.4 | X | X | |
|
|||
960 | A.5 | X | | X |
|
|||
961 | A.6 | | X | X |
|
|||
962 | A.7 | X | X | X |
|
|||
963 |
|
||||
964 | A.0 is trivial, and doesn't need copy tracking. |
|
|||
965 | For A.1, a forward rename is recorded in the c1 pass, to be followed later. |
|
|||
966 | In A.2, the rename is recorded in the c2 pass and followed backwards. |
|
|||
967 | A.3 is recorded in the c2 pass as a forward rename to be duplicated on target. |
|
|||
968 | In A.4, both passes of checkcopies record incomplete renames, which are |
|
|||
969 | then joined in mergecopies to record a rename to be followed. |
|
|||
970 | In A.5 and A.7, the c1 pass records an incomplete rename, while the c2 pass |
|
|||
971 | records an incomplete divergence. The incomplete rename is then joined to the |
|
|||
972 | appropriate side of the incomplete divergence, and the result is recorded as a |
|
|||
973 | divergence. The code doesn't distinguish at all between these two cases, since |
|
|||
974 | the end result of them is the same: an incomplete divergence joined with an |
|
|||
975 | incomplete rename into a divergence. |
|
|||
976 | Finally, A.6 records a divergence entirely in the c2 pass. |
|
|||
977 |
|
||||
978 | A.4 has a degenerate case a<-b<-a->a, where checkcopies isn't needed at all. |
|
|||
979 | A.5 has a special case a<-b<-b->a, which is treated like a<-b->a in a merge. |
|
|||
980 | A.5 has issue5343 as a special case. |
|
|||
981 | A.6 has a special case a<-a<-b->a. Here, checkcopies will find a spurious |
|
|||
982 | incomplete divergence, which is in fact complete. This is handled later in |
|
|||
983 | mergecopies. |
|
|||
984 | A.7 has 4 special cases: a<-b<-a->b (the "ping-pong" case), a<-b<-c->b, |
|
|||
985 | a<-b<-a->c and a<-b<-c->a. Of these, only the "ping-pong" case is interesting, |
|
|||
986 | the others are fairly trivial (a<-b<-c->b and a<-b<-a->c proceed like the base |
|
|||
987 | case, a<-b<-c->a is treated the same as a<-b<-b->a). |
|
|||
988 |
|
||||
989 | f5a therefore tests the "ping-pong" rename case, where a file is renamed to the |
|
|||
990 | same name on both branches, then the rename is backed out on one branch, and |
|
|||
991 | the backout is grafted to the other branch. This creates a challenging rename |
|
|||
992 | sequence of a<-b<-a->b in the graft target, topological CA, graft CA and graft |
|
|||
993 | source, respectively. Since rename detection will run on the c1 side for such a |
|
|||
994 | sequence (as for technical reasons, we split the c1 and c2 sides not at the |
|
|||
995 | graft CA, but rather at the topological CA), it will pick up a false rename, |
|
|||
996 | and cause a spurious merge conflict. This false rename is always exactly the |
|
|||
997 | reverse of the true rename that would be detected on the c2 side, so we can |
|
|||
998 | correct for it by detecting this condition and reversing as necessary. |
|
|||
999 |
|
||||
1000 | First, set up the repository with commits to be grafted |
|
|||
1001 |
|
||||
1002 | $ hg init ../graftmove |
|
|||
1003 | $ cd ../graftmove |
|
|||
1004 | $ echo c1a > f1a |
|
|||
1005 | $ echo c2a > f2a |
|
|||
1006 | $ echo c3a > f3a |
|
|||
1007 | $ echo c4a > f4a |
|
|||
1008 | $ echo c5a > f5a |
|
|||
1009 | $ hg ci -qAm A0 |
|
|||
1010 | $ hg mv f1a f1b |
|
|||
1011 | $ hg mv f3a f3b |
|
|||
1012 | $ hg mv f5a f5b |
|
|||
1013 | $ hg ci -qAm B0 |
|
|||
1014 | $ echo c1c > f1b |
|
|||
1015 | $ hg mv f2a f2c |
|
|||
1016 | $ hg mv f5b f5a |
|
|||
1017 | $ echo c5c > f5a |
|
|||
1018 | $ hg ci -qAm C0 |
|
|||
1019 | $ hg mv f3b f3d |
|
|||
1020 | $ echo c4d > f4a |
|
|||
1021 | $ hg ci -qAm D0 |
|
|||
1022 | $ hg log -G |
|
|||
1023 | @ changeset: 3:b69f5839d2d9 |
|
|||
1024 | | tag: tip |
|
|||
1025 | | user: test |
|
|||
1026 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
|||
1027 | | summary: D0 |
|
|||
1028 | | |
|
|||
1029 | o changeset: 2:f58c7e2b28fa |
|
|||
1030 | | user: test |
|
|||
1031 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
|||
1032 | | summary: C0 |
|
|||
1033 | | |
|
|||
1034 | o changeset: 1:3d7bba921b5d |
|
|||
1035 | | user: test |
|
|||
1036 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
|||
1037 | | summary: B0 |
|
|||
1038 | | |
|
|||
1039 | o changeset: 0:11f7a1b56675 |
|
|||
1040 | user: test |
|
|||
1041 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
|||
1042 | summary: A0 |
|
|||
1043 |
|
||||
1044 |
|
||||
1045 | Test the cases A.2 (f1x), A.3 (f2x) and a special case of A.6 (f5x) where the |
|
|||
1046 | two renames actually converge to the same name (thus no actual divergence). |
|
|||
1047 |
|
||||
1048 | $ hg up -q 'desc("A0")' |
|
|||
1049 | $ HGEDITOR="echo C1 >" hg graft -r 'desc("C0")' --edit |
|
|||
1050 | grafting 2:f58c7e2b28fa "C0" |
|
|||
1051 | merging f1a and f1b to f1a |
|
|||
1052 | merging f5a |
|
|||
1053 | warning: can't find ancestor for 'f5a' copied from 'f5b'! |
|
|||
1054 | $ hg status --change . |
|
|||
1055 | M f1a |
|
|||
1056 | M f5a |
|
|||
1057 | A f2c |
|
|||
1058 | R f2a |
|
|||
1059 | $ hg cat f1a |
|
|||
1060 | c1c |
|
|||
1061 | $ hg cat f1b |
|
|||
1062 | f1b: no such file in rev c9763722f9bd |
|
|||
1063 | [1] |
|
|||
1064 |
|
||||
1065 | Test the cases A.0 (f4x) and A.6 (f3x) |
|
|||
1066 |
|
||||
1067 | $ HGEDITOR="echo D1 >" hg graft -r 'desc("D0")' --edit |
|
|||
1068 | grafting 3:b69f5839d2d9 "D0" |
|
|||
1069 | note: possible conflict - f3b was renamed multiple times to: |
|
|||
1070 | f3a |
|
|||
1071 | f3d |
|
|||
1072 | warning: can't find ancestor for 'f3d' copied from 'f3b'! |
|
|||
1073 |
|
||||
1074 | Set up the repository for some further tests |
|
|||
1075 |
|
||||
1076 | $ hg up -q "min(desc("A0"))" |
|
|||
1077 | $ hg mv f1a f1e |
|
|||
1078 | $ echo c2e > f2a |
|
|||
1079 | $ hg mv f3a f3e |
|
|||
1080 | $ hg mv f4a f4e |
|
|||
1081 | $ hg mv f5a f5b |
|
|||
1082 | $ hg ci -qAm "E0" |
|
|||
1083 | $ hg up -q "min(desc("A0"))" |
|
|||
1084 | $ hg cp f1a f1f |
|
|||
1085 | $ hg ci -qAm "F0" |
|
|||
1086 | $ hg up -q "min(desc("A0"))" |
|
|||
1087 | $ hg cp f1a f1g |
|
|||
1088 | $ echo c1g > f1g |
|
|||
1089 | $ hg ci -qAm "G0" |
|
|||
1090 | $ hg log -G |
|
|||
1091 | @ changeset: 8:ba67f08fb15a |
|
|||
1092 | | tag: tip |
|
|||
1093 | | parent: 0:11f7a1b56675 |
|
|||
1094 | | user: test |
|
|||
1095 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
|||
1096 | | summary: G0 |
|
|||
1097 | | |
|
|||
1098 | | o changeset: 7:d376ab0d7fda |
|
|||
1099 | |/ parent: 0:11f7a1b56675 |
|
|||
1100 | | user: test |
|
|||
1101 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
|||
1102 | | summary: F0 |
|
|||
1103 | | |
|
|||
1104 | | o changeset: 6:6bd1736cab86 |
|
|||
1105 | |/ parent: 0:11f7a1b56675 |
|
|||
1106 | | user: test |
|
|||
1107 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
|||
1108 | | summary: E0 |
|
|||
1109 | | |
|
|||
1110 | | o changeset: 5:560daee679da |
|
|||
1111 | | | user: test |
|
|||
1112 | | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
|||
1113 | | | summary: D1 |
|
|||
1114 | | | |
|
|||
1115 | | o changeset: 4:c9763722f9bd |
|
|||
1116 | |/ parent: 0:11f7a1b56675 |
|
|||
1117 | | user: test |
|
|||
1118 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
|||
1119 | | summary: C1 |
|
|||
1120 | | |
|
|||
1121 | | o changeset: 3:b69f5839d2d9 |
|
|||
1122 | | | user: test |
|
|||
1123 | | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
|||
1124 | | | summary: D0 |
|
|||
1125 | | | |
|
|||
1126 | | o changeset: 2:f58c7e2b28fa |
|
|||
1127 | | | user: test |
|
|||
1128 | | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
|||
1129 | | | summary: C0 |
|
|||
1130 | | | |
|
|||
1131 | | o changeset: 1:3d7bba921b5d |
|
|||
1132 | |/ user: test |
|
|||
1133 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
|||
1134 | | summary: B0 |
|
|||
1135 | | |
|
|||
1136 | o changeset: 0:11f7a1b56675 |
|
|||
1137 | user: test |
|
|||
1138 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
|||
1139 | summary: A0 |
|
|||
1140 |
|
||||
1141 |
|
||||
1142 | Test the cases A.4 (f1x), the "ping-pong" special case of A.7 (f5x), |
|
|||
1143 | and A.3 with a local content change to be preserved (f2x). |
|
|||
1144 |
|
||||
1145 | $ hg up -q "desc("E0")" |
|
|||
1146 | $ HGEDITOR="echo C2 >" hg graft -r 'desc("C0")' --edit |
|
|||
1147 | grafting 2:f58c7e2b28fa "C0" |
|
|||
1148 | merging f1e and f1b to f1e |
|
|||
1149 | merging f2a and f2c to f2c |
|
|||
1150 |
|
||||
1151 | Test the cases A.1 (f4x) and A.7 (f3x). |
|
|||
1152 |
|
||||
1153 | $ HGEDITOR="echo D2 >" hg graft -r 'desc("D0")' --edit |
|
|||
1154 | grafting 3:b69f5839d2d9 "D0" |
|
|||
1155 | note: possible conflict - f3b was renamed multiple times to: |
|
|||
1156 | f3d |
|
|||
1157 | f3e |
|
|||
1158 | merging f4e and f4a to f4e |
|
|||
1159 | warning: can't find ancestor for 'f3d' copied from 'f3b'! |
|
|||
1160 |
|
||||
1161 | $ hg cat f2c |
|
|||
1162 | c2e |
|
|||
1163 |
|
||||
1164 | Test the case A.5 (move case, f1x). |
|
|||
1165 |
|
||||
1166 | $ hg up -q "desc("C0")" |
|
|||
1167 | BROKEN: Shouldn't get the warning about missing ancestor |
|
|||
1168 | $ HGEDITOR="echo E1 >" hg graft -r 'desc("E0")' --edit |
|
|||
1169 | grafting 6:6bd1736cab86 "E0" |
|
|||
1170 | note: possible conflict - f1a was renamed multiple times to: |
|
|||
1171 | f1b |
|
|||
1172 | f1e |
|
|||
1173 | note: possible conflict - f3a was renamed multiple times to: |
|
|||
1174 | f3b |
|
|||
1175 | f3e |
|
|||
1176 | merging f2c and f2a to f2c |
|
|||
1177 | merging f5a and f5b to f5b |
|
|||
1178 | warning: can't find ancestor for 'f1e' copied from 'f1a'! |
|
|||
1179 | warning: can't find ancestor for 'f3e' copied from 'f3a'! |
|
|||
1180 | $ cat f1e |
|
|||
1181 | c1a |
|
|||
1182 |
|
||||
1183 | Test the case A.5 (copy case, f1x). |
|
|||
1184 |
|
||||
1185 | $ hg up -q "desc("C0")" |
|
|||
1186 | BROKEN: Shouldn't get the warning about missing ancestor |
|
|||
1187 | $ HGEDITOR="echo F1 >" hg graft -r 'desc("F0")' --edit |
|
|||
1188 | grafting 7:d376ab0d7fda "F0" |
|
|||
1189 | warning: can't find ancestor for 'f1f' copied from 'f1a'! |
|
|||
1190 | BROKEN: f1f should be marked a copy from f1b |
|
|||
1191 | $ hg st --copies --change . |
|
|||
1192 | A f1f |
|
|||
1193 | BROKEN: f1f should have the new content from f1b (i.e. "c1c") |
|
|||
1194 | $ cat f1f |
|
|||
1195 | c1a |
|
|||
1196 |
|
||||
1197 | Test the case A.5 (copy+modify case, f1x). |
|
|||
1198 |
|
||||
1199 | $ hg up -q "desc("C0")" |
|
|||
1200 | BROKEN: We should get a merge conflict from the 3-way merge between f1b in C0 |
|
|||
1201 | (content "c1c") and f1g in G0 (content "c1g") with f1a in A0 as base (content |
|
|||
1202 | "c1a") |
|
|||
1203 | $ HGEDITOR="echo G1 >" hg graft -r 'desc("G0")' --edit |
|
|||
1204 | grafting 8:ba67f08fb15a "G0" |
|
|||
1205 | warning: can't find ancestor for 'f1g' copied from 'f1a'! |
|
|||
1206 |
|
||||
1207 | Check the results of the grafts tested |
|
|||
1208 |
|
||||
1209 | $ hg log -CGv --patch --git |
|
|||
1210 | @ changeset: 13:ef3adf6c20a4 |
|
|||
1211 | | tag: tip |
|
|||
1212 | | parent: 2:f58c7e2b28fa |
|
|||
1213 | | user: test |
|
|||
1214 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
|||
1215 | | files: f1g |
|
|||
1216 | | description: |
|
|||
1217 | | G1 |
|
|||
1218 | | |
|
|||
1219 | | |
|
|||
1220 | | diff --git a/f1g b/f1g |
|
|||
1221 | | new file mode 100644 |
|
|||
1222 | | --- /dev/null |
|
|||
1223 | | +++ b/f1g |
|
|||
1224 | | @@ -0,0 +1,1 @@ |
|
|||
1225 | | +c1g |
|
|||
1226 | | |
|
|||
1227 | | o changeset: 12:b5542d755b54 |
|
|||
1228 | |/ parent: 2:f58c7e2b28fa |
|
|||
1229 | | user: test |
|
|||
1230 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
|||
1231 | | files: f1f |
|
|||
1232 | | description: |
|
|||
1233 | | F1 |
|
|||
1234 | | |
|
|||
1235 | | |
|
|||
1236 | | diff --git a/f1f b/f1f |
|
|||
1237 | | new file mode 100644 |
|
|||
1238 | | --- /dev/null |
|
|||
1239 | | +++ b/f1f |
|
|||
1240 | | @@ -0,0 +1,1 @@ |
|
|||
1241 | | +c1a |
|
|||
1242 | | |
|
|||
1243 | | o changeset: 11:f8a162271246 |
|
|||
1244 | |/ parent: 2:f58c7e2b28fa |
|
|||
1245 | | user: test |
|
|||
1246 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
|||
1247 | | files: f1e f2c f3e f4a f4e f5a f5b |
|
|||
1248 | | copies: f4e (f4a) f5b (f5a) |
|
|||
1249 | | description: |
|
|||
1250 | | E1 |
|
|||
1251 | | |
|
|||
1252 | | |
|
|||
1253 | | diff --git a/f1e b/f1e |
|
|||
1254 | | new file mode 100644 |
|
|||
1255 | | --- /dev/null |
|
|||
1256 | | +++ b/f1e |
|
|||
1257 | | @@ -0,0 +1,1 @@ |
|
|||
1258 | | +c1a |
|
|||
1259 | | diff --git a/f2c b/f2c |
|
|||
1260 | | --- a/f2c |
|
|||
1261 | | +++ b/f2c |
|
|||
1262 | | @@ -1,1 +1,1 @@ |
|
|||
1263 | | -c2a |
|
|||
1264 | | +c2e |
|
|||
1265 | | diff --git a/f3e b/f3e |
|
|||
1266 | | new file mode 100644 |
|
|||
1267 | | --- /dev/null |
|
|||
1268 | | +++ b/f3e |
|
|||
1269 | | @@ -0,0 +1,1 @@ |
|
|||
1270 | | +c3a |
|
|||
1271 | | diff --git a/f4a b/f4e |
|
|||
1272 | | rename from f4a |
|
|||
1273 | | rename to f4e |
|
|||
1274 | | diff --git a/f5a b/f5b |
|
|||
1275 | | rename from f5a |
|
|||
1276 | | rename to f5b |
|
|||
1277 | | |
|
|||
1278 | | o changeset: 10:93ee502e8b0a |
|
|||
1279 | | | user: test |
|
|||
1280 | | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
|||
1281 | | | files: f3d f4e |
|
|||
1282 | | | description: |
|
|||
1283 | | | D2 |
|
|||
1284 | | | |
|
|||
1285 | | | |
|
|||
1286 | | | diff --git a/f3d b/f3d |
|
|||
1287 | | | new file mode 100644 |
|
|||
1288 | | | --- /dev/null |
|
|||
1289 | | | +++ b/f3d |
|
|||
1290 | | | @@ -0,0 +1,1 @@ |
|
|||
1291 | | | +c3a |
|
|||
1292 | | | diff --git a/f4e b/f4e |
|
|||
1293 | | | --- a/f4e |
|
|||
1294 | | | +++ b/f4e |
|
|||
1295 | | | @@ -1,1 +1,1 @@ |
|
|||
1296 | | | -c4a |
|
|||
1297 | | | +c4d |
|
|||
1298 | | | |
|
|||
1299 | | o changeset: 9:539cf145f496 |
|
|||
1300 | | | parent: 6:6bd1736cab86 |
|
|||
1301 | | | user: test |
|
|||
1302 | | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
|||
1303 | | | files: f1e f2a f2c f5a f5b |
|
|||
1304 | | | copies: f2c (f2a) f5a (f5b) |
|
|||
1305 | | | description: |
|
|||
1306 | | | C2 |
|
|||
1307 | | | |
|
|||
1308 | | | |
|
|||
1309 | | | diff --git a/f1e b/f1e |
|
|||
1310 | | | --- a/f1e |
|
|||
1311 | | | +++ b/f1e |
|
|||
1312 | | | @@ -1,1 +1,1 @@ |
|
|||
1313 | | | -c1a |
|
|||
1314 | | | +c1c |
|
|||
1315 | | | diff --git a/f2a b/f2c |
|
|||
1316 | | | rename from f2a |
|
|||
1317 | | | rename to f2c |
|
|||
1318 | | | diff --git a/f5b b/f5a |
|
|||
1319 | | | rename from f5b |
|
|||
1320 | | | rename to f5a |
|
|||
1321 | | | --- a/f5b |
|
|||
1322 | | | +++ b/f5a |
|
|||
1323 | | | @@ -1,1 +1,1 @@ |
|
|||
1324 | | | -c5a |
|
|||
1325 | | | +c5c |
|
|||
1326 | | | |
|
|||
1327 | | | o changeset: 8:ba67f08fb15a |
|
|||
1328 | | | | parent: 0:11f7a1b56675 |
|
|||
1329 | | | | user: test |
|
|||
1330 | | | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
|||
1331 | | | | files: f1g |
|
|||
1332 | | | | copies: f1g (f1a) |
|
|||
1333 | | | | description: |
|
|||
1334 | | | | G0 |
|
|||
1335 | | | | |
|
|||
1336 | | | | |
|
|||
1337 | | | | diff --git a/f1a b/f1g |
|
|||
1338 | | | | copy from f1a |
|
|||
1339 | | | | copy to f1g |
|
|||
1340 | | | | --- a/f1a |
|
|||
1341 | | | | +++ b/f1g |
|
|||
1342 | | | | @@ -1,1 +1,1 @@ |
|
|||
1343 | | | | -c1a |
|
|||
1344 | | | | +c1g |
|
|||
1345 | | | | |
|
|||
1346 | | | | o changeset: 7:d376ab0d7fda |
|
|||
1347 | | | |/ parent: 0:11f7a1b56675 |
|
|||
1348 | | | | user: test |
|
|||
1349 | | | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
|||
1350 | | | | files: f1f |
|
|||
1351 | | | | copies: f1f (f1a) |
|
|||
1352 | | | | description: |
|
|||
1353 | | | | F0 |
|
|||
1354 | | | | |
|
|||
1355 | | | | |
|
|||
1356 | | | | diff --git a/f1a b/f1f |
|
|||
1357 | | | | copy from f1a |
|
|||
1358 | | | | copy to f1f |
|
|||
1359 | | | | |
|
|||
1360 | | o | changeset: 6:6bd1736cab86 |
|
|||
1361 | | |/ parent: 0:11f7a1b56675 |
|
|||
1362 | | | user: test |
|
|||
1363 | | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
|||
1364 | | | files: f1a f1e f2a f3a f3e f4a f4e f5a f5b |
|
|||
1365 | | | copies: f1e (f1a) f3e (f3a) f4e (f4a) f5b (f5a) |
|
|||
1366 | | | description: |
|
|||
1367 | | | E0 |
|
|||
1368 | | | |
|
|||
1369 | | | |
|
|||
1370 | | | diff --git a/f1a b/f1e |
|
|||
1371 | | | rename from f1a |
|
|||
1372 | | | rename to f1e |
|
|||
1373 | | | diff --git a/f2a b/f2a |
|
|||
1374 | | | --- a/f2a |
|
|||
1375 | | | +++ b/f2a |
|
|||
1376 | | | @@ -1,1 +1,1 @@ |
|
|||
1377 | | | -c2a |
|
|||
1378 | | | +c2e |
|
|||
1379 | | | diff --git a/f3a b/f3e |
|
|||
1380 | | | rename from f3a |
|
|||
1381 | | | rename to f3e |
|
|||
1382 | | | diff --git a/f4a b/f4e |
|
|||
1383 | | | rename from f4a |
|
|||
1384 | | | rename to f4e |
|
|||
1385 | | | diff --git a/f5a b/f5b |
|
|||
1386 | | | rename from f5a |
|
|||
1387 | | | rename to f5b |
|
|||
1388 | | | |
|
|||
1389 | | | o changeset: 5:560daee679da |
|
|||
1390 | | | | user: test |
|
|||
1391 | | | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
|||
1392 | | | | files: f3d f4a |
|
|||
1393 | | | | description: |
|
|||
1394 | | | | D1 |
|
|||
1395 | | | | |
|
|||
1396 | | | | |
|
|||
1397 | | | | diff --git a/f3d b/f3d |
|
|||
1398 | | | | new file mode 100644 |
|
|||
1399 | | | | --- /dev/null |
|
|||
1400 | | | | +++ b/f3d |
|
|||
1401 | | | | @@ -0,0 +1,1 @@ |
|
|||
1402 | | | | +c3a |
|
|||
1403 | | | | diff --git a/f4a b/f4a |
|
|||
1404 | | | | --- a/f4a |
|
|||
1405 | | | | +++ b/f4a |
|
|||
1406 | | | | @@ -1,1 +1,1 @@ |
|
|||
1407 | | | | -c4a |
|
|||
1408 | | | | +c4d |
|
|||
1409 | | | | |
|
|||
1410 | | | o changeset: 4:c9763722f9bd |
|
|||
1411 | | |/ parent: 0:11f7a1b56675 |
|
|||
1412 | | | user: test |
|
|||
1413 | | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
|||
1414 | | | files: f1a f2a f2c f5a |
|
|||
1415 | | | copies: f2c (f2a) |
|
|||
1416 | | | description: |
|
|||
1417 | | | C1 |
|
|||
1418 | | | |
|
|||
1419 | | | |
|
|||
1420 | | | diff --git a/f1a b/f1a |
|
|||
1421 | | | --- a/f1a |
|
|||
1422 | | | +++ b/f1a |
|
|||
1423 | | | @@ -1,1 +1,1 @@ |
|
|||
1424 | | | -c1a |
|
|||
1425 | | | +c1c |
|
|||
1426 | | | diff --git a/f2a b/f2c |
|
|||
1427 | | | rename from f2a |
|
|||
1428 | | | rename to f2c |
|
|||
1429 | | | diff --git a/f5a b/f5a |
|
|||
1430 | | | --- a/f5a |
|
|||
1431 | | | +++ b/f5a |
|
|||
1432 | | | @@ -1,1 +1,1 @@ |
|
|||
1433 | | | -c5a |
|
|||
1434 | | | +c5c |
|
|||
1435 | | | |
|
|||
1436 | +---o changeset: 3:b69f5839d2d9 |
|
|||
1437 | | | user: test |
|
|||
1438 | | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
|||
1439 | | | files: f3b f3d f4a |
|
|||
1440 | | | copies: f3d (f3b) |
|
|||
1441 | | | description: |
|
|||
1442 | | | D0 |
|
|||
1443 | | | |
|
|||
1444 | | | |
|
|||
1445 | | | diff --git a/f3b b/f3d |
|
|||
1446 | | | rename from f3b |
|
|||
1447 | | | rename to f3d |
|
|||
1448 | | | diff --git a/f4a b/f4a |
|
|||
1449 | | | --- a/f4a |
|
|||
1450 | | | +++ b/f4a |
|
|||
1451 | | | @@ -1,1 +1,1 @@ |
|
|||
1452 | | | -c4a |
|
|||
1453 | | | +c4d |
|
|||
1454 | | | |
|
|||
1455 | o | changeset: 2:f58c7e2b28fa |
|
|||
1456 | | | user: test |
|
|||
1457 | | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
|||
1458 | | | files: f1b f2a f2c f5a f5b |
|
|||
1459 | | | copies: f2c (f2a) f5a (f5b) |
|
|||
1460 | | | description: |
|
|||
1461 | | | C0 |
|
|||
1462 | | | |
|
|||
1463 | | | |
|
|||
1464 | | | diff --git a/f1b b/f1b |
|
|||
1465 | | | --- a/f1b |
|
|||
1466 | | | +++ b/f1b |
|
|||
1467 | | | @@ -1,1 +1,1 @@ |
|
|||
1468 | | | -c1a |
|
|||
1469 | | | +c1c |
|
|||
1470 | | | diff --git a/f2a b/f2c |
|
|||
1471 | | | rename from f2a |
|
|||
1472 | | | rename to f2c |
|
|||
1473 | | | diff --git a/f5b b/f5a |
|
|||
1474 | | | rename from f5b |
|
|||
1475 | | | rename to f5a |
|
|||
1476 | | | --- a/f5b |
|
|||
1477 | | | +++ b/f5a |
|
|||
1478 | | | @@ -1,1 +1,1 @@ |
|
|||
1479 | | | -c5a |
|
|||
1480 | | | +c5c |
|
|||
1481 | | | |
|
|||
1482 | o | changeset: 1:3d7bba921b5d |
|
|||
1483 | |/ user: test |
|
|||
1484 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
|||
1485 | | files: f1a f1b f3a f3b f5a f5b |
|
|||
1486 | | copies: f1b (f1a) f3b (f3a) f5b (f5a) |
|
|||
1487 | | description: |
|
|||
1488 | | B0 |
|
|||
1489 | | |
|
|||
1490 | | |
|
|||
1491 | | diff --git a/f1a b/f1b |
|
|||
1492 | | rename from f1a |
|
|||
1493 | | rename to f1b |
|
|||
1494 | | diff --git a/f3a b/f3b |
|
|||
1495 | | rename from f3a |
|
|||
1496 | | rename to f3b |
|
|||
1497 | | diff --git a/f5a b/f5b |
|
|||
1498 | | rename from f5a |
|
|||
1499 | | rename to f5b |
|
|||
1500 | | |
|
|||
1501 | o changeset: 0:11f7a1b56675 |
|
|||
1502 | user: test |
|
|||
1503 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
|||
1504 | files: f1a f2a f3a f4a f5a |
|
|||
1505 | description: |
|
|||
1506 | A0 |
|
|||
1507 |
|
||||
1508 |
|
||||
1509 | diff --git a/f1a b/f1a |
|
|||
1510 | new file mode 100644 |
|
|||
1511 | --- /dev/null |
|
|||
1512 | +++ b/f1a |
|
|||
1513 | @@ -0,0 +1,1 @@ |
|
|||
1514 | +c1a |
|
|||
1515 | diff --git a/f2a b/f2a |
|
|||
1516 | new file mode 100644 |
|
|||
1517 | --- /dev/null |
|
|||
1518 | +++ b/f2a |
|
|||
1519 | @@ -0,0 +1,1 @@ |
|
|||
1520 | +c2a |
|
|||
1521 | diff --git a/f3a b/f3a |
|
|||
1522 | new file mode 100644 |
|
|||
1523 | --- /dev/null |
|
|||
1524 | +++ b/f3a |
|
|||
1525 | @@ -0,0 +1,1 @@ |
|
|||
1526 | +c3a |
|
|||
1527 | diff --git a/f4a b/f4a |
|
|||
1528 | new file mode 100644 |
|
|||
1529 | --- /dev/null |
|
|||
1530 | +++ b/f4a |
|
|||
1531 | @@ -0,0 +1,1 @@ |
|
|||
1532 | +c4a |
|
|||
1533 | diff --git a/f5a b/f5a |
|
|||
1534 | new file mode 100644 |
|
|||
1535 | --- /dev/null |
|
|||
1536 | +++ b/f5a |
|
|||
1537 | @@ -0,0 +1,1 @@ |
|
|||
1538 | +c5a |
|
|||
1539 |
|
||||
1540 | Check superfluous filemerge of files renamed in the past but untouched by graft |
|
|||
1541 |
|
||||
1542 | $ echo a > a |
|
|||
1543 | $ hg ci -qAma |
|
|||
1544 | $ hg mv a b |
|
|||
1545 | $ echo b > b |
|
|||
1546 | $ hg ci -qAmb |
|
|||
1547 | $ echo c > c |
|
|||
1548 | $ hg ci -qAmc |
|
|||
1549 | $ hg up -q .~2 |
|
|||
1550 | $ hg graft tip -qt:fail |
|
|||
1551 |
|
||||
1552 | $ cd .. |
|
|||
1553 |
|
||||
1554 | Graft a change into a new file previously grafted into a renamed directory |
|
|||
1555 |
|
||||
1556 | $ hg init dirmovenewfile |
|
|||
1557 | $ cd dirmovenewfile |
|
|||
1558 | $ mkdir a |
|
|||
1559 | $ echo a > a/a |
|
|||
1560 | $ hg ci -qAma |
|
|||
1561 | $ echo x > a/x |
|
|||
1562 | $ hg ci -qAmx |
|
|||
1563 | $ hg up -q 0 |
|
|||
1564 | $ hg mv -q a b |
|
|||
1565 | $ hg ci -qAmb |
|
|||
1566 | $ hg graft -q 1 # a/x grafted as b/x, but no copy information recorded |
|
|||
1567 | $ hg up -q 1 |
|
|||
1568 | $ echo y > a/x |
|
|||
1569 | $ hg ci -qAmy |
|
|||
1570 | $ hg up -q 3 |
|
|||
1571 | $ hg graft -q 4 |
|
|||
1572 | $ hg status --change . |
|
|||
1573 | M b/x |
|
|||
1574 |
|
||||
1575 | Prepare for test of skipped changesets and how merges can influence it: |
|
|||
1576 |
|
||||
1577 | $ hg merge -q -r 1 --tool :local |
|
|||
1578 | $ hg ci -m m |
|
|||
1579 | $ echo xx >> b/x |
|
|||
1580 | $ hg ci -m xx |
|
|||
1581 |
|
||||
1582 | $ hg log -G -T '{rev} {desc|firstline}' |
|
|||
1583 | @ 7 xx |
|
|||
1584 | | |
|
|||
1585 | o 6 m |
|
|||
1586 | |\ |
|
|||
1587 | | o 5 y |
|
|||
1588 | | | |
|
|||
1589 | +---o 4 y |
|
|||
1590 | | | |
|
|||
1591 | | o 3 x |
|
|||
1592 | | | |
|
|||
1593 | | o 2 b |
|
|||
1594 | | | |
|
|||
1595 | o | 1 x |
|
|||
1596 | |/ |
|
|||
1597 | o 0 a |
|
|||
1598 |
|
||||
1599 | Grafting of plain changes correctly detects that 3 and 5 should be skipped: |
|
|||
1600 |
|
||||
1601 | $ hg up -qCr 4 |
|
|||
1602 | $ hg graft --tool :local -r 2::5 |
|
|||
1603 | skipping already grafted revision 3:ca093ca2f1d9 (was grafted from 1:13ec5badbf2a) |
|
|||
1604 | skipping already grafted revision 5:43e9eb70dab0 (was grafted from 4:6c9a1289e5f1) |
|
|||
1605 | grafting 2:42127f193bcd "b" |
|
|||
1606 |
|
||||
1607 | Extending the graft range to include a (skipped) merge of 3 will not prevent us from |
|
|||
1608 | also detecting that both 3 and 5 should be skipped: |
|
|||
1609 |
|
||||
1610 | $ hg up -qCr 4 |
|
|||
1611 | $ hg graft --tool :local -r 2::7 |
|
|||
1612 | skipping ungraftable merge revision 6 |
|
|||
1613 | skipping already grafted revision 3:ca093ca2f1d9 (was grafted from 1:13ec5badbf2a) |
|
|||
1614 | skipping already grafted revision 5:43e9eb70dab0 (was grafted from 4:6c9a1289e5f1) |
|
|||
1615 | grafting 2:42127f193bcd "b" |
|
|||
1616 | grafting 7:d3c3f2b38ecc "xx" |
|
|||
1617 | note: graft of 7:d3c3f2b38ecc created no changes to commit |
|
|||
1618 |
|
||||
1619 | $ cd .. |
|
|||
1620 |
|
||||
1621 | Grafted revision should be warned and skipped only once. (issue6024) |
|
|||
1622 |
|
||||
1623 | $ mkdir issue6024 |
|
|||
1624 | $ cd issue6024 |
|
|||
1625 |
|
||||
1626 | $ hg init base |
|
|||
1627 | $ cd base |
|
|||
1628 | $ touch x |
|
|||
1629 | $ hg commit -qAminit |
|
|||
1630 | $ echo a > x |
|
|||
1631 | $ hg commit -mchange |
|
|||
1632 | $ hg update -q 0 |
|
|||
1633 | $ hg graft -r 1 |
|
|||
1634 | grafting 1:a0b923c546aa "change" (tip) |
|
|||
1635 | $ cd .. |
|
|||
1636 |
|
||||
1637 | $ hg clone -qr 2 base clone |
|
|||
1638 | $ cd clone |
|
|||
1639 | $ hg pull -q |
|
|||
1640 | $ hg merge -q 2 |
|
|||
1641 | $ hg commit -mmerge |
|
|||
1642 | $ hg update -q 0 |
|
|||
1643 | $ hg graft -r 1 |
|
|||
1644 | grafting 1:04fc6d444368 "change" |
|
|||
1645 | $ hg update -q 3 |
|
|||
1646 | $ hg log -G -T '{rev}:{node|shortest} <- {extras.source|shortest}\n' |
|
|||
1647 | o 4:4e16 <- a0b9 |
|
|||
1648 | | |
|
|||
1649 | | @ 3:f0ac <- |
|
|||
1650 | | |\ |
|
|||
1651 | +---o 2:a0b9 <- |
|
|||
1652 | | | |
|
|||
1653 | | o 1:04fc <- a0b9 |
|
|||
1654 | |/ |
|
|||
1655 | o 0:7848 <- |
|
|||
1656 |
|
||||
1657 |
|
||||
1658 | the source of rev 4 is an ancestor of the working parent, and was also |
|
|||
1659 | grafted as rev 1. it should be stripped from the target revisions only once. |
|
|||
1660 |
|
||||
1661 | $ hg graft -r 4 |
|
|||
1662 | skipping already grafted revision 4:4e16bab40c9c (1:04fc6d444368 also has origin 2:a0b923c546aa) |
|
|||
1663 | [255] |
|
|||
1664 |
|
||||
1665 | $ cd ../.. |
|
|||
1666 |
|
10 | |||
1667 | Testing the reading of old format graftstate file with newer mercurial |
|
11 | Testing the reading of old format graftstate file with newer mercurial | |
1668 |
|
12 | |||
1669 | $ hg init oldgraft |
|
13 | $ hg init oldgraft | |
1670 | $ cd oldgraft |
|
14 | $ cd oldgraft | |
1671 |
$ for ch in a b c |
|
15 | $ for ch in a b c; do echo foo > $ch; hg add $ch; hg ci -Aqm "added "$ch; done; | |
1672 | $ hg log -GT "{rev}:{node|short} {desc}\n" |
|
16 | $ hg log -GT "{rev}:{node|short} {desc}\n" | |
1673 | @ 2:8be98ac1a569 added c |
|
17 | @ 2:8be98ac1a569 added c | |
1674 | | |
|
18 | | | |
1675 | o 1:80e6d2c47cfe added b |
|
19 | o 1:80e6d2c47cfe added b | |
1676 | | |
|
20 | | | |
1677 | o 0:f7ad41964313 added a |
|
21 | o 0:f7ad41964313 added a | |
1678 |
|
22 | |||
1679 | $ hg up 0 |
|
23 | $ hg up 0 | |
1680 | 0 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
24 | 0 files updated, 0 files merged, 2 files removed, 0 files unresolved | |
1681 | $ echo bar > b |
|
25 | $ echo bar > b | |
1682 | $ hg add b |
|
26 | $ hg add b | |
1683 | $ hg ci -m "bar to b" |
|
27 | $ hg ci -m "bar to b" | |
1684 | created new head |
|
28 | created new head | |
1685 | $ hg graft -r 1 -r 2 |
|
29 | $ hg graft -r 1 -r 2 | |
1686 | grafting 1:80e6d2c47cfe "added b" |
|
30 | grafting 1:80e6d2c47cfe "added b" | |
1687 | merging b |
|
31 | merging b | |
1688 | warning: conflicts while merging b! (edit, then use 'hg resolve --mark') |
|
32 | warning: conflicts while merging b! (edit, then use 'hg resolve --mark') | |
1689 | abort: unresolved conflicts, can't continue |
|
33 | abort: unresolved conflicts, can't continue | |
1690 | (use 'hg resolve' and 'hg graft --continue') |
|
34 | (use 'hg resolve' and 'hg graft --continue') | |
1691 | [255] |
|
35 | [255] | |
1692 |
|
36 | |||
1693 | Writing the nodes in old format to graftstate |
|
37 | Writing the nodes in old format to graftstate | |
1694 |
|
38 | |||
1695 | $ hg log -r 1 -r 2 -T '{node}\n' > .hg/graftstate |
|
39 | $ hg log -r 1 -r 2 -T '{node}\n' > .hg/graftstate | |
1696 | $ echo foo > b |
|
40 | $ echo foo > b | |
1697 | $ hg resolve -m |
|
41 | $ hg resolve -m | |
1698 | (no more unresolved files) |
|
42 | (no more unresolved files) | |
1699 | continue: hg graft --continue |
|
43 | continue: hg graft --continue | |
1700 | $ hg graft --continue |
|
44 | $ hg graft --continue | |
1701 | grafting 1:80e6d2c47cfe "added b" |
|
45 | grafting 1:80e6d2c47cfe "added b" | |
1702 | grafting 2:8be98ac1a569 "added c" |
|
46 | grafting 2:8be98ac1a569 "added c" | |
1703 |
|
47 | |||
1704 | Testing that --user is preserved during conflicts and value is reused while |
|
48 | Testing that --user is preserved during conflicts and value is reused while | |
1705 | running `hg graft --continue` |
|
49 | running `hg graft --continue` | |
1706 |
|
50 | |||
1707 | $ hg log -G |
|
51 | $ hg log -G | |
1708 | @ changeset: 5:711e9fa999f1 |
|
52 | @ changeset: 5:711e9fa999f1 | |
1709 | | tag: tip |
|
53 | | tag: tip | |
1710 | | user: test |
|
54 | | user: test | |
1711 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
55 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
1712 | | summary: added c |
|
56 | | summary: added c | |
1713 | | |
|
57 | | | |
1714 | o changeset: 4:e5ad7353b408 |
|
58 | o changeset: 4:e5ad7353b408 | |
1715 | | user: test |
|
59 | | user: test | |
1716 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
60 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
1717 | | summary: added b |
|
61 | | summary: added b | |
1718 | | |
|
62 | | | |
1719 | o changeset: 3:9e887f7a939c |
|
63 | o changeset: 3:9e887f7a939c | |
1720 | | parent: 0:f7ad41964313 |
|
64 | | parent: 0:f7ad41964313 | |
1721 | | user: test |
|
65 | | user: test | |
1722 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
66 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
1723 | | summary: bar to b |
|
67 | | summary: bar to b | |
1724 | | |
|
68 | | | |
1725 | | o changeset: 2:8be98ac1a569 |
|
69 | | o changeset: 2:8be98ac1a569 | |
1726 | | | user: test |
|
70 | | | user: test | |
1727 | | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
71 | | | date: Thu Jan 01 00:00:00 1970 +0000 | |
1728 | | | summary: added c |
|
72 | | | summary: added c | |
1729 | | | |
|
73 | | | | |
1730 | | o changeset: 1:80e6d2c47cfe |
|
74 | | o changeset: 1:80e6d2c47cfe | |
1731 | |/ user: test |
|
75 | |/ user: test | |
1732 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
76 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
1733 | | summary: added b |
|
77 | | summary: added b | |
1734 | | |
|
78 | | | |
1735 | o changeset: 0:f7ad41964313 |
|
79 | o changeset: 0:f7ad41964313 | |
1736 | user: test |
|
80 | user: test | |
1737 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
81 | date: Thu Jan 01 00:00:00 1970 +0000 | |
1738 | summary: added a |
|
82 | summary: added a | |
1739 |
|
83 | |||
1740 |
|
84 | |||
1741 | $ hg up '.^^' |
|
85 | $ hg up '.^^' | |
1742 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
86 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
1743 |
|
87 | |||
1744 | $ hg graft -r 1 -r 2 --user batman |
|
88 | $ hg graft -r 1 -r 2 --user batman | |
1745 | grafting 1:80e6d2c47cfe "added b" |
|
89 | grafting 1:80e6d2c47cfe "added b" | |
1746 | merging b |
|
90 | merging b | |
1747 | warning: conflicts while merging b! (edit, then use 'hg resolve --mark') |
|
91 | warning: conflicts while merging b! (edit, then use 'hg resolve --mark') | |
1748 | abort: unresolved conflicts, can't continue |
|
92 | abort: unresolved conflicts, can't continue | |
1749 | (use 'hg resolve' and 'hg graft --continue') |
|
93 | (use 'hg resolve' and 'hg graft --continue') | |
1750 | [255] |
|
94 | [255] | |
1751 |
|
95 | |||
1752 | $ echo wat > b |
|
96 | $ echo wat > b | |
1753 | $ hg resolve -m |
|
97 | $ hg resolve -m | |
1754 | (no more unresolved files) |
|
98 | (no more unresolved files) | |
1755 | continue: hg graft --continue |
|
99 | continue: hg graft --continue | |
1756 |
|
100 | |||
1757 | $ hg graft --continue |
|
101 | $ hg graft --continue | |
1758 | grafting 1:80e6d2c47cfe "added b" |
|
102 | grafting 1:80e6d2c47cfe "added b" | |
1759 | grafting 2:8be98ac1a569 "added c" |
|
103 | grafting 2:8be98ac1a569 "added c" | |
1760 |
|
104 | |||
1761 | $ hg log -Gr 3:: |
|
105 | $ hg log -Gr 3:: | |
1762 | @ changeset: 7:11a36ffaacf2 |
|
106 | @ changeset: 7:11a36ffaacf2 | |
1763 | | tag: tip |
|
107 | | tag: tip | |
1764 | | user: batman |
|
108 | | user: batman | |
1765 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
109 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
1766 | | summary: added c |
|
110 | | summary: added c | |
1767 | | |
|
111 | | | |
1768 | o changeset: 6:76803afc6511 |
|
112 | o changeset: 6:76803afc6511 | |
1769 | | parent: 3:9e887f7a939c |
|
113 | | parent: 3:9e887f7a939c | |
1770 | | user: batman |
|
114 | | user: batman | |
1771 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
115 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
1772 | | summary: added b |
|
116 | | summary: added b | |
1773 | | |
|
117 | | | |
1774 | | o changeset: 5:711e9fa999f1 |
|
118 | | o changeset: 5:711e9fa999f1 | |
1775 | | | user: test |
|
119 | | | user: test | |
1776 | | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
120 | | | date: Thu Jan 01 00:00:00 1970 +0000 | |
1777 | | | summary: added c |
|
121 | | | summary: added c | |
1778 | | | |
|
122 | | | | |
1779 | | o changeset: 4:e5ad7353b408 |
|
123 | | o changeset: 4:e5ad7353b408 | |
1780 | |/ user: test |
|
124 | |/ user: test | |
1781 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
125 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
1782 | | summary: added b |
|
126 | | summary: added b | |
1783 | | |
|
127 | | | |
1784 | o changeset: 3:9e887f7a939c |
|
128 | o changeset: 3:9e887f7a939c | |
1785 | | parent: 0:f7ad41964313 |
|
129 | | parent: 0:f7ad41964313 | |
1786 | ~ user: test |
|
130 | ~ user: test | |
1787 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
131 | date: Thu Jan 01 00:00:00 1970 +0000 | |
1788 | summary: bar to b |
|
132 | summary: bar to b | |
1789 |
|
133 | |||
1790 | Test that --date is preserved and reused in `hg graft --continue` |
|
134 | Test that --date is preserved and reused in `hg graft --continue` | |
1791 |
|
135 | |||
1792 | $ hg up '.^^' |
|
136 | $ hg up '.^^' | |
1793 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
137 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
1794 | $ hg graft -r 1 -r 2 --date '1234560000 120' |
|
138 | $ hg graft -r 1 -r 2 --date '1234560000 120' | |
1795 | grafting 1:80e6d2c47cfe "added b" |
|
139 | grafting 1:80e6d2c47cfe "added b" | |
1796 | merging b |
|
140 | merging b | |
1797 | warning: conflicts while merging b! (edit, then use 'hg resolve --mark') |
|
141 | warning: conflicts while merging b! (edit, then use 'hg resolve --mark') | |
1798 | abort: unresolved conflicts, can't continue |
|
142 | abort: unresolved conflicts, can't continue | |
1799 | (use 'hg resolve' and 'hg graft --continue') |
|
143 | (use 'hg resolve' and 'hg graft --continue') | |
1800 | [255] |
|
144 | [255] | |
1801 |
|
145 | |||
1802 | $ echo foobar > b |
|
146 | $ echo foobar > b | |
1803 | $ hg resolve -m |
|
147 | $ hg resolve -m | |
1804 | (no more unresolved files) |
|
148 | (no more unresolved files) | |
1805 | continue: hg graft --continue |
|
149 | continue: hg graft --continue | |
1806 | $ hg graft --continue |
|
150 | $ hg graft --continue | |
1807 | grafting 1:80e6d2c47cfe "added b" |
|
151 | grafting 1:80e6d2c47cfe "added b" | |
1808 | grafting 2:8be98ac1a569 "added c" |
|
152 | grafting 2:8be98ac1a569 "added c" | |
1809 |
|
153 | |||
1810 | $ hg log -Gr '.^^::.' |
|
154 | $ hg log -Gr '.^^::.' | |
1811 | @ changeset: 9:1896b76e007a |
|
155 | @ changeset: 9:1896b76e007a | |
1812 | | tag: tip |
|
156 | | tag: tip | |
1813 | | user: test |
|
157 | | user: test | |
1814 | | date: Fri Feb 13 21:18:00 2009 -0002 |
|
158 | | date: Fri Feb 13 21:18:00 2009 -0002 | |
1815 | | summary: added c |
|
159 | | summary: added c | |
1816 | | |
|
160 | | | |
1817 | o changeset: 8:ce2b4f1632af |
|
161 | o changeset: 8:ce2b4f1632af | |
1818 | | parent: 3:9e887f7a939c |
|
162 | | parent: 3:9e887f7a939c | |
1819 | | user: test |
|
163 | | user: test | |
1820 | | date: Fri Feb 13 21:18:00 2009 -0002 |
|
164 | | date: Fri Feb 13 21:18:00 2009 -0002 | |
1821 | | summary: added b |
|
165 | | summary: added b | |
1822 | | |
|
166 | | | |
1823 | o changeset: 3:9e887f7a939c |
|
167 | o changeset: 3:9e887f7a939c | |
1824 | | parent: 0:f7ad41964313 |
|
168 | | parent: 0:f7ad41964313 | |
1825 | ~ user: test |
|
169 | ~ user: test | |
1826 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
170 | date: Thu Jan 01 00:00:00 1970 +0000 | |
1827 | summary: bar to b |
|
171 | summary: bar to b | |
1828 |
|
172 | |||
1829 | Test that --log is preserved and reused in `hg graft --continue` |
|
173 | Test that --log is preserved and reused in `hg graft --continue` | |
1830 |
|
174 | |||
1831 | $ hg up '.^^' |
|
175 | $ hg up '.^^' | |
1832 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
176 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
1833 | $ hg graft -r 1 -r 2 --log |
|
177 | $ hg graft -r 1 -r 2 --log | |
1834 | grafting 1:80e6d2c47cfe "added b" |
|
178 | grafting 1:80e6d2c47cfe "added b" | |
1835 | merging b |
|
179 | merging b | |
1836 | warning: conflicts while merging b! (edit, then use 'hg resolve --mark') |
|
180 | warning: conflicts while merging b! (edit, then use 'hg resolve --mark') | |
1837 | abort: unresolved conflicts, can't continue |
|
181 | abort: unresolved conflicts, can't continue | |
1838 | (use 'hg resolve' and 'hg graft --continue') |
|
182 | (use 'hg resolve' and 'hg graft --continue') | |
1839 | [255] |
|
183 | [255] | |
1840 |
|
184 | |||
1841 | $ echo foobar > b |
|
185 | $ echo foobar > b | |
1842 | $ hg resolve -m |
|
186 | $ hg resolve -m | |
1843 | (no more unresolved files) |
|
187 | (no more unresolved files) | |
1844 | continue: hg graft --continue |
|
188 | continue: hg graft --continue | |
1845 |
|
189 | |||
1846 | $ hg graft --continue |
|
190 | $ hg graft --continue | |
1847 | grafting 1:80e6d2c47cfe "added b" |
|
191 | grafting 1:80e6d2c47cfe "added b" | |
1848 | grafting 2:8be98ac1a569 "added c" |
|
192 | grafting 2:8be98ac1a569 "added c" | |
1849 |
|
193 | |||
1850 | $ hg log -GT "{rev}:{node|short} {desc}" -r '.^^::.' |
|
194 | $ hg log -GT "{rev}:{node|short} {desc}" -r '.^^::.' | |
1851 | @ 11:30c1050a58b2 added c |
|
195 | @ 11:30c1050a58b2 added c | |
1852 | | (grafted from 8be98ac1a56990c2d9ca6861041b8390af7bd6f3) |
|
196 | | (grafted from 8be98ac1a56990c2d9ca6861041b8390af7bd6f3) | |
1853 | o 10:ec7eda2313e2 added b |
|
197 | o 10:ec7eda2313e2 added b | |
1854 | | (grafted from 80e6d2c47cfe5b3185519568327a17a061c7efb6) |
|
198 | | (grafted from 80e6d2c47cfe5b3185519568327a17a061c7efb6) | |
1855 | o 3:9e887f7a939c bar to b |
|
199 | o 3:9e887f7a939c bar to b | |
1856 | | |
|
200 | | | |
1857 | ~ |
|
201 | ~ | |
1858 |
|
202 | |||
1859 | $ cd .. |
|
203 | $ cd .. | |
1860 |
|
204 | |||
1861 | Testing the --stop flag of `hg graft` which stops the interrupted graft |
|
205 | Testing the --stop flag of `hg graft` which stops the interrupted graft | |
1862 |
|
206 | |||
1863 | $ hg init stopgraft |
|
207 | $ hg init stopgraft | |
1864 | $ cd stopgraft |
|
208 | $ cd stopgraft | |
1865 | $ for ch in a b c d; do echo $ch > $ch; hg add $ch; hg ci -Aqm "added "$ch; done; |
|
209 | $ for ch in a b c d; do echo $ch > $ch; hg add $ch; hg ci -Aqm "added "$ch; done; | |
1866 |
|
210 | |||
1867 | $ hg log -G |
|
211 | $ hg log -G | |
1868 | @ changeset: 3:9150fe93bec6 |
|
212 | @ changeset: 3:9150fe93bec6 | |
1869 | | tag: tip |
|
213 | | tag: tip | |
1870 | | user: test |
|
214 | | user: test | |
1871 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
215 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
1872 | | summary: added d |
|
216 | | summary: added d | |
1873 | | |
|
217 | | | |
1874 | o changeset: 2:155349b645be |
|
218 | o changeset: 2:155349b645be | |
1875 | | user: test |
|
219 | | user: test | |
1876 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
220 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
1877 | | summary: added c |
|
221 | | summary: added c | |
1878 | | |
|
222 | | | |
1879 | o changeset: 1:5f6d8a4bf34a |
|
223 | o changeset: 1:5f6d8a4bf34a | |
1880 | | user: test |
|
224 | | user: test | |
1881 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
225 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
1882 | | summary: added b |
|
226 | | summary: added b | |
1883 | | |
|
227 | | | |
1884 | o changeset: 0:9092f1db7931 |
|
228 | o changeset: 0:9092f1db7931 | |
1885 | user: test |
|
229 | user: test | |
1886 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
230 | date: Thu Jan 01 00:00:00 1970 +0000 | |
1887 | summary: added a |
|
231 | summary: added a | |
1888 |
|
232 | |||
1889 | $ hg up '.^^' |
|
233 | $ hg up '.^^' | |
1890 | 0 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
234 | 0 files updated, 0 files merged, 2 files removed, 0 files unresolved | |
1891 |
|
235 | |||
1892 | $ echo foo > d |
|
236 | $ echo foo > d | |
1893 | $ hg ci -Aqm "added foo to d" |
|
237 | $ hg ci -Aqm "added foo to d" | |
1894 |
|
238 | |||
1895 | $ hg graft --stop |
|
239 | $ hg graft --stop | |
1896 | abort: no interrupted graft found |
|
240 | abort: no interrupted graft found | |
1897 | [255] |
|
241 | [255] | |
1898 |
|
242 | |||
1899 | $ hg graft -r 3 |
|
243 | $ hg graft -r 3 | |
1900 | grafting 3:9150fe93bec6 "added d" |
|
244 | grafting 3:9150fe93bec6 "added d" | |
1901 | merging d |
|
245 | merging d | |
1902 | warning: conflicts while merging d! (edit, then use 'hg resolve --mark') |
|
246 | warning: conflicts while merging d! (edit, then use 'hg resolve --mark') | |
1903 | abort: unresolved conflicts, can't continue |
|
247 | abort: unresolved conflicts, can't continue | |
1904 | (use 'hg resolve' and 'hg graft --continue') |
|
248 | (use 'hg resolve' and 'hg graft --continue') | |
1905 | [255] |
|
249 | [255] | |
1906 |
|
250 | |||
1907 | $ hg graft --stop --continue |
|
251 | $ hg graft --stop --continue | |
1908 | abort: cannot use '--continue' and '--stop' together |
|
252 | abort: cannot use '--continue' and '--stop' together | |
1909 | [255] |
|
253 | [255] | |
1910 |
|
254 | |||
1911 | $ hg graft --stop -U |
|
255 | $ hg graft --stop -U | |
1912 | abort: cannot specify any other flag with '--stop' |
|
256 | abort: cannot specify any other flag with '--stop' | |
1913 | [255] |
|
257 | [255] | |
1914 | $ hg graft --stop --rev 4 |
|
258 | $ hg graft --stop --rev 4 | |
1915 | abort: cannot specify any other flag with '--stop' |
|
259 | abort: cannot specify any other flag with '--stop' | |
1916 | [255] |
|
260 | [255] | |
1917 | $ hg graft --stop --log |
|
261 | $ hg graft --stop --log | |
1918 | abort: cannot specify any other flag with '--stop' |
|
262 | abort: cannot specify any other flag with '--stop' | |
1919 | [255] |
|
263 | [255] | |
1920 |
|
264 | |||
1921 | $ hg graft --stop |
|
265 | $ hg graft --stop | |
1922 | stopped the interrupted graft |
|
266 | stopped the interrupted graft | |
1923 | working directory is now at a0deacecd59d |
|
267 | working directory is now at a0deacecd59d | |
1924 |
|
268 | |||
1925 | $ hg diff |
|
269 | $ hg diff | |
1926 |
|
270 | |||
1927 | $ hg log -Gr '.' |
|
271 | $ hg log -Gr '.' | |
1928 | @ changeset: 4:a0deacecd59d |
|
272 | @ changeset: 4:a0deacecd59d | |
1929 | | tag: tip |
|
273 | | tag: tip | |
1930 | ~ parent: 1:5f6d8a4bf34a |
|
274 | ~ parent: 1:5f6d8a4bf34a | |
1931 | user: test |
|
275 | user: test | |
1932 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
276 | date: Thu Jan 01 00:00:00 1970 +0000 | |
1933 | summary: added foo to d |
|
277 | summary: added foo to d | |
1934 |
|
278 | |||
1935 | $ hg graft -r 2 -r 3 |
|
279 | $ hg graft -r 2 -r 3 | |
1936 | grafting 2:155349b645be "added c" |
|
280 | grafting 2:155349b645be "added c" | |
1937 | grafting 3:9150fe93bec6 "added d" |
|
281 | grafting 3:9150fe93bec6 "added d" | |
1938 | merging d |
|
282 | merging d | |
1939 | warning: conflicts while merging d! (edit, then use 'hg resolve --mark') |
|
283 | warning: conflicts while merging d! (edit, then use 'hg resolve --mark') | |
1940 | abort: unresolved conflicts, can't continue |
|
284 | abort: unresolved conflicts, can't continue | |
1941 | (use 'hg resolve' and 'hg graft --continue') |
|
285 | (use 'hg resolve' and 'hg graft --continue') | |
1942 | [255] |
|
286 | [255] | |
1943 |
|
287 | |||
1944 | $ hg graft --stop |
|
288 | $ hg graft --stop | |
1945 | stopped the interrupted graft |
|
289 | stopped the interrupted graft | |
1946 | working directory is now at 75b447541a9e |
|
290 | working directory is now at 75b447541a9e | |
1947 |
|
291 | |||
1948 | $ hg diff |
|
292 | $ hg diff | |
1949 |
|
293 | |||
1950 | $ hg log -G -T "{rev}:{node|short} {desc}" |
|
294 | $ hg log -G -T "{rev}:{node|short} {desc}" | |
1951 | @ 5:75b447541a9e added c |
|
295 | @ 5:75b447541a9e added c | |
1952 | | |
|
296 | | | |
1953 | o 4:a0deacecd59d added foo to d |
|
297 | o 4:a0deacecd59d added foo to d | |
1954 | | |
|
298 | | | |
1955 | | o 3:9150fe93bec6 added d |
|
299 | | o 3:9150fe93bec6 added d | |
1956 | | | |
|
300 | | | | |
1957 | | o 2:155349b645be added c |
|
301 | | o 2:155349b645be added c | |
1958 | |/ |
|
302 | |/ | |
1959 | o 1:5f6d8a4bf34a added b |
|
303 | o 1:5f6d8a4bf34a added b | |
1960 | | |
|
304 | | | |
1961 | o 0:9092f1db7931 added a |
|
305 | o 0:9092f1db7931 added a | |
1962 |
|
306 | |||
1963 | $ cd .. |
|
307 | $ cd .. | |
1964 |
|
308 | |||
1965 | Testing the --abort flag for `hg graft` which aborts and rollback to state |
|
309 | Testing the --abort flag for `hg graft` which aborts and rollback to state | |
1966 | before the graft |
|
310 | before the graft | |
1967 |
|
311 | |||
1968 | $ hg init abortgraft |
|
312 | $ hg init abortgraft | |
1969 | $ cd abortgraft |
|
313 | $ cd abortgraft | |
1970 | $ for ch in a b c d; do echo $ch > $ch; hg add $ch; hg ci -Aqm "added "$ch; done; |
|
314 | $ for ch in a b c d; do echo $ch > $ch; hg add $ch; hg ci -Aqm "added "$ch; done; | |
1971 |
|
315 | |||
1972 | $ hg up '.^^' |
|
316 | $ hg up '.^^' | |
1973 | 0 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
317 | 0 files updated, 0 files merged, 2 files removed, 0 files unresolved | |
1974 |
|
318 | |||
1975 | $ echo x > x |
|
319 | $ echo x > x | |
1976 | $ hg ci -Aqm "added x" |
|
320 | $ hg ci -Aqm "added x" | |
1977 | $ hg up '.^' |
|
321 | $ hg up '.^' | |
1978 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
322 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
1979 | $ echo foo > c |
|
323 | $ echo foo > c | |
1980 | $ hg ci -Aqm "added foo to c" |
|
324 | $ hg ci -Aqm "added foo to c" | |
1981 |
|
325 | |||
1982 | $ hg log -GT "{rev}:{node|short} {desc}" |
|
326 | $ hg log -GT "{rev}:{node|short} {desc}" | |
1983 | @ 5:36b793615f78 added foo to c |
|
327 | @ 5:36b793615f78 added foo to c | |
1984 | | |
|
328 | | | |
1985 | | o 4:863a25e1a9ea added x |
|
329 | | o 4:863a25e1a9ea added x | |
1986 | |/ |
|
330 | |/ | |
1987 | | o 3:9150fe93bec6 added d |
|
331 | | o 3:9150fe93bec6 added d | |
1988 | | | |
|
332 | | | | |
1989 | | o 2:155349b645be added c |
|
333 | | o 2:155349b645be added c | |
1990 | |/ |
|
334 | |/ | |
1991 | o 1:5f6d8a4bf34a added b |
|
335 | o 1:5f6d8a4bf34a added b | |
1992 | | |
|
336 | | | |
1993 | o 0:9092f1db7931 added a |
|
337 | o 0:9092f1db7931 added a | |
1994 |
|
338 | |||
1995 | $ hg up 9150fe93bec6 |
|
339 | $ hg up 9150fe93bec6 | |
1996 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
340 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
1997 |
|
341 | |||
1998 | $ hg abort |
|
342 | $ hg abort | |
1999 | abort: no interrupted graft to abort (abortflag !) |
|
343 | abort: no interrupted graft to abort (abortflag !) | |
2000 | abort: no operation in progress (abortcommand !) |
|
344 | abort: no operation in progress (abortcommand !) | |
2001 | [255] |
|
345 | [255] | |
2002 |
|
346 | |||
2003 | when stripping is required |
|
347 | when stripping is required | |
2004 | $ hg graft -r 4 -r 5 |
|
348 | $ hg graft -r 4 -r 5 | |
2005 | grafting 4:863a25e1a9ea "added x" |
|
349 | grafting 4:863a25e1a9ea "added x" | |
2006 | grafting 5:36b793615f78 "added foo to c" (tip) |
|
350 | grafting 5:36b793615f78 "added foo to c" (tip) | |
2007 | merging c |
|
351 | merging c | |
2008 | warning: conflicts while merging c! (edit, then use 'hg resolve --mark') |
|
352 | warning: conflicts while merging c! (edit, then use 'hg resolve --mark') | |
2009 | abort: unresolved conflicts, can't continue |
|
353 | abort: unresolved conflicts, can't continue | |
2010 | (use 'hg resolve' and 'hg graft --continue') |
|
354 | (use 'hg resolve' and 'hg graft --continue') | |
2011 | [255] |
|
355 | [255] | |
2012 |
|
356 | |||
2013 | $ hg graft --continue --abort |
|
357 | $ hg graft --continue --abort | |
2014 | abort: cannot use '--continue' and '--abort' together |
|
358 | abort: cannot use '--continue' and '--abort' together | |
2015 | [255] |
|
359 | [255] | |
2016 |
|
360 | |||
2017 | $ hg graft --abort --stop |
|
361 | $ hg graft --abort --stop | |
2018 | abort: cannot use '--abort' and '--stop' together |
|
362 | abort: cannot use '--abort' and '--stop' together | |
2019 | [255] |
|
363 | [255] | |
2020 |
|
364 | |||
2021 | $ hg graft --abort --currentuser |
|
365 | $ hg graft --abort --currentuser | |
2022 | abort: cannot specify any other flag with '--abort' |
|
366 | abort: cannot specify any other flag with '--abort' | |
2023 | [255] |
|
367 | [255] | |
2024 |
|
368 | |||
2025 | $ hg graft --abort --edit |
|
369 | $ hg graft --abort --edit | |
2026 | abort: cannot specify any other flag with '--abort' |
|
370 | abort: cannot specify any other flag with '--abort' | |
2027 | [255] |
|
371 | [255] | |
2028 |
|
372 | |||
2029 | #if abortcommand |
|
373 | #if abortcommand | |
2030 | when in dry-run mode |
|
374 | when in dry-run mode | |
2031 | $ hg abort --dry-run |
|
375 | $ hg abort --dry-run | |
2032 | graft in progress, will be aborted |
|
376 | graft in progress, will be aborted | |
2033 | #endif |
|
377 | #endif | |
2034 |
|
378 | |||
2035 | $ hg abort |
|
379 | $ hg abort | |
2036 | graft aborted |
|
380 | graft aborted | |
2037 | working directory is now at 9150fe93bec6 |
|
381 | working directory is now at 9150fe93bec6 | |
2038 | $ hg log -GT "{rev}:{node|short} {desc}" |
|
382 | $ hg log -GT "{rev}:{node|short} {desc}" | |
2039 | o 5:36b793615f78 added foo to c |
|
383 | o 5:36b793615f78 added foo to c | |
2040 | | |
|
384 | | | |
2041 | | o 4:863a25e1a9ea added x |
|
385 | | o 4:863a25e1a9ea added x | |
2042 | |/ |
|
386 | |/ | |
2043 | | @ 3:9150fe93bec6 added d |
|
387 | | @ 3:9150fe93bec6 added d | |
2044 | | | |
|
388 | | | | |
2045 | | o 2:155349b645be added c |
|
389 | | o 2:155349b645be added c | |
2046 | |/ |
|
390 | |/ | |
2047 | o 1:5f6d8a4bf34a added b |
|
391 | o 1:5f6d8a4bf34a added b | |
2048 | | |
|
392 | | | |
2049 | o 0:9092f1db7931 added a |
|
393 | o 0:9092f1db7931 added a | |
2050 |
|
394 | |||
2051 | when stripping is not required |
|
395 | when stripping is not required | |
2052 | $ hg graft -r 5 |
|
396 | $ hg graft -r 5 | |
2053 | grafting 5:36b793615f78 "added foo to c" (tip) |
|
397 | grafting 5:36b793615f78 "added foo to c" (tip) | |
2054 | merging c |
|
398 | merging c | |
2055 | warning: conflicts while merging c! (edit, then use 'hg resolve --mark') |
|
399 | warning: conflicts while merging c! (edit, then use 'hg resolve --mark') | |
2056 | abort: unresolved conflicts, can't continue |
|
400 | abort: unresolved conflicts, can't continue | |
2057 | (use 'hg resolve' and 'hg graft --continue') |
|
401 | (use 'hg resolve' and 'hg graft --continue') | |
2058 | [255] |
|
402 | [255] | |
2059 |
|
403 | |||
2060 | $ hg abort |
|
404 | $ hg abort | |
2061 | graft aborted |
|
405 | graft aborted | |
2062 | working directory is now at 9150fe93bec6 |
|
406 | working directory is now at 9150fe93bec6 | |
2063 | $ hg log -GT "{rev}:{node|short} {desc}" |
|
407 | $ hg log -GT "{rev}:{node|short} {desc}" | |
2064 | o 5:36b793615f78 added foo to c |
|
408 | o 5:36b793615f78 added foo to c | |
2065 | | |
|
409 | | | |
2066 | | o 4:863a25e1a9ea added x |
|
410 | | o 4:863a25e1a9ea added x | |
2067 | |/ |
|
411 | |/ | |
2068 | | @ 3:9150fe93bec6 added d |
|
412 | | @ 3:9150fe93bec6 added d | |
2069 | | | |
|
413 | | | | |
2070 | | o 2:155349b645be added c |
|
414 | | o 2:155349b645be added c | |
2071 | |/ |
|
415 | |/ | |
2072 | o 1:5f6d8a4bf34a added b |
|
416 | o 1:5f6d8a4bf34a added b | |
2073 | | |
|
417 | | | |
2074 | o 0:9092f1db7931 added a |
|
418 | o 0:9092f1db7931 added a | |
2075 |
|
419 | |||
2076 | when some of the changesets became public |
|
420 | when some of the changesets became public | |
2077 |
|
421 | |||
2078 | $ hg graft -r 4 -r 5 |
|
422 | $ hg graft -r 4 -r 5 | |
2079 | grafting 4:863a25e1a9ea "added x" |
|
423 | grafting 4:863a25e1a9ea "added x" | |
2080 | grafting 5:36b793615f78 "added foo to c" (tip) |
|
424 | grafting 5:36b793615f78 "added foo to c" (tip) | |
2081 | merging c |
|
425 | merging c | |
2082 | warning: conflicts while merging c! (edit, then use 'hg resolve --mark') |
|
426 | warning: conflicts while merging c! (edit, then use 'hg resolve --mark') | |
2083 | abort: unresolved conflicts, can't continue |
|
427 | abort: unresolved conflicts, can't continue | |
2084 | (use 'hg resolve' and 'hg graft --continue') |
|
428 | (use 'hg resolve' and 'hg graft --continue') | |
2085 | [255] |
|
429 | [255] | |
2086 |
|
430 | |||
2087 | $ hg log -GT "{rev}:{node|short} {desc}" |
|
431 | $ hg log -GT "{rev}:{node|short} {desc}" | |
2088 | @ 6:6ec71c037d94 added x |
|
432 | @ 6:6ec71c037d94 added x | |
2089 | | |
|
433 | | | |
2090 | | o 5:36b793615f78 added foo to c |
|
434 | | o 5:36b793615f78 added foo to c | |
2091 | | | |
|
435 | | | | |
2092 | | | o 4:863a25e1a9ea added x |
|
436 | | | o 4:863a25e1a9ea added x | |
2093 | | |/ |
|
437 | | |/ | |
2094 | o | 3:9150fe93bec6 added d |
|
438 | o | 3:9150fe93bec6 added d | |
2095 | | | |
|
439 | | | | |
2096 | o | 2:155349b645be added c |
|
440 | o | 2:155349b645be added c | |
2097 | |/ |
|
441 | |/ | |
2098 | o 1:5f6d8a4bf34a added b |
|
442 | o 1:5f6d8a4bf34a added b | |
2099 | | |
|
443 | | | |
2100 | o 0:9092f1db7931 added a |
|
444 | o 0:9092f1db7931 added a | |
2101 |
|
445 | |||
2102 | $ hg phase -r 6 --public |
|
446 | $ hg phase -r 6 --public | |
2103 |
|
447 | |||
2104 | $ hg abort |
|
448 | $ hg abort | |
2105 | cannot clean up public changesets 6ec71c037d94 |
|
449 | cannot clean up public changesets 6ec71c037d94 | |
2106 | graft aborted |
|
450 | graft aborted | |
2107 | working directory is now at 6ec71c037d94 |
|
451 | working directory is now at 6ec71c037d94 | |
2108 |
|
452 | |||
2109 | when we created new changesets on top of existing one |
|
453 | when we created new changesets on top of existing one | |
2110 |
|
454 | |||
2111 | $ hg up '.^^' |
|
455 | $ hg up '.^^' | |
2112 | 0 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
456 | 0 files updated, 0 files merged, 2 files removed, 0 files unresolved | |
2113 | $ echo y > y |
|
457 | $ echo y > y | |
2114 | $ hg ci -Aqm "added y" |
|
458 | $ hg ci -Aqm "added y" | |
2115 | $ echo z > z |
|
459 | $ echo z > z | |
2116 | $ hg ci -Aqm "added z" |
|
460 | $ hg ci -Aqm "added z" | |
2117 |
|
461 | |||
2118 | $ hg up 3 |
|
462 | $ hg up 3 | |
2119 | 1 files updated, 0 files merged, 3 files removed, 0 files unresolved |
|
463 | 1 files updated, 0 files merged, 3 files removed, 0 files unresolved | |
2120 | $ hg log -GT "{rev}:{node|short} {desc}" |
|
464 | $ hg log -GT "{rev}:{node|short} {desc}" | |
2121 | o 8:637f9e9bbfd4 added z |
|
465 | o 8:637f9e9bbfd4 added z | |
2122 | | |
|
466 | | | |
2123 | o 7:123221671fd4 added y |
|
467 | o 7:123221671fd4 added y | |
2124 | | |
|
468 | | | |
2125 | | o 6:6ec71c037d94 added x |
|
469 | | o 6:6ec71c037d94 added x | |
2126 | | | |
|
470 | | | | |
2127 | | | o 5:36b793615f78 added foo to c |
|
471 | | | o 5:36b793615f78 added foo to c | |
2128 | | | | |
|
472 | | | | | |
2129 | | | | o 4:863a25e1a9ea added x |
|
473 | | | | o 4:863a25e1a9ea added x | |
2130 | | | |/ |
|
474 | | | |/ | |
2131 | | @ | 3:9150fe93bec6 added d |
|
475 | | @ | 3:9150fe93bec6 added d | |
2132 | |/ / |
|
476 | |/ / | |
2133 | o / 2:155349b645be added c |
|
477 | o / 2:155349b645be added c | |
2134 | |/ |
|
478 | |/ | |
2135 | o 1:5f6d8a4bf34a added b |
|
479 | o 1:5f6d8a4bf34a added b | |
2136 | | |
|
480 | | | |
2137 | o 0:9092f1db7931 added a |
|
481 | o 0:9092f1db7931 added a | |
2138 |
|
482 | |||
2139 | $ hg graft -r 8 -r 7 -r 5 |
|
483 | $ hg graft -r 8 -r 7 -r 5 | |
2140 | grafting 8:637f9e9bbfd4 "added z" (tip) |
|
484 | grafting 8:637f9e9bbfd4 "added z" (tip) | |
2141 | grafting 7:123221671fd4 "added y" |
|
485 | grafting 7:123221671fd4 "added y" | |
2142 | grafting 5:36b793615f78 "added foo to c" |
|
486 | grafting 5:36b793615f78 "added foo to c" | |
2143 | merging c |
|
487 | merging c | |
2144 | warning: conflicts while merging c! (edit, then use 'hg resolve --mark') |
|
488 | warning: conflicts while merging c! (edit, then use 'hg resolve --mark') | |
2145 | abort: unresolved conflicts, can't continue |
|
489 | abort: unresolved conflicts, can't continue | |
2146 | (use 'hg resolve' and 'hg graft --continue') |
|
490 | (use 'hg resolve' and 'hg graft --continue') | |
2147 | [255] |
|
491 | [255] | |
2148 |
|
492 | |||
2149 | $ cd .. |
|
493 | $ cd .. | |
2150 | $ hg init pullrepo |
|
494 | $ hg init pullrepo | |
2151 | $ cd pullrepo |
|
495 | $ cd pullrepo | |
2152 | $ cat >> .hg/hgrc <<EOF |
|
496 | $ cat >> .hg/hgrc <<EOF | |
2153 | > [phases] |
|
497 | > [phases] | |
2154 | > publish=False |
|
498 | > publish=False | |
2155 | > EOF |
|
499 | > EOF | |
2156 | $ hg pull ../abortgraft --config phases.publish=False |
|
500 | $ hg pull ../abortgraft --config phases.publish=False | |
2157 | pulling from ../abortgraft |
|
501 | pulling from ../abortgraft | |
2158 | requesting all changes |
|
502 | requesting all changes | |
2159 | adding changesets |
|
503 | adding changesets | |
2160 | adding manifests |
|
504 | adding manifests | |
2161 | adding file changes |
|
505 | adding file changes | |
2162 | added 11 changesets with 9 changes to 8 files (+4 heads) |
|
506 | added 11 changesets with 9 changes to 8 files (+4 heads) | |
2163 | new changesets 9092f1db7931:6b98ff0062dd (6 drafts) |
|
507 | new changesets 9092f1db7931:6b98ff0062dd (6 drafts) | |
2164 | (run 'hg heads' to see heads, 'hg merge' to merge) |
|
508 | (run 'hg heads' to see heads, 'hg merge' to merge) | |
2165 | $ hg up 9 |
|
509 | $ hg up 9 | |
2166 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
510 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
2167 | $ echo w > w |
|
511 | $ echo w > w | |
2168 | $ hg ci -Aqm "added w" --config phases.publish=False |
|
512 | $ hg ci -Aqm "added w" --config phases.publish=False | |
2169 |
|
513 | |||
2170 | $ cd ../abortgraft |
|
514 | $ cd ../abortgraft | |
2171 | $ hg pull ../pullrepo |
|
515 | $ hg pull ../pullrepo | |
2172 | pulling from ../pullrepo |
|
516 | pulling from ../pullrepo | |
2173 | searching for changes |
|
517 | searching for changes | |
2174 | adding changesets |
|
518 | adding changesets | |
2175 | adding manifests |
|
519 | adding manifests | |
2176 | adding file changes |
|
520 | adding file changes | |
2177 | added 1 changesets with 1 changes to 1 files (+1 heads) |
|
521 | added 1 changesets with 1 changes to 1 files (+1 heads) | |
2178 | new changesets 311dfc6cf3bf (1 drafts) |
|
522 | new changesets 311dfc6cf3bf (1 drafts) | |
2179 | (run 'hg heads .' to see heads, 'hg merge' to merge) |
|
523 | (run 'hg heads .' to see heads, 'hg merge' to merge) | |
2180 |
|
524 | |||
2181 | $ hg abort |
|
525 | $ hg abort | |
2182 | new changesets detected on destination branch, can't strip |
|
526 | new changesets detected on destination branch, can't strip | |
2183 | graft aborted |
|
527 | graft aborted | |
2184 | working directory is now at 6b98ff0062dd |
|
528 | working directory is now at 6b98ff0062dd | |
2185 |
|
529 | |||
2186 | $ cd .. |
|
530 | $ cd .. | |
2187 |
|
531 | |||
2188 | ============================ |
|
532 | ============================ | |
2189 | Testing --no-commit option:| |
|
533 | Testing --no-commit option:| | |
2190 | ============================ |
|
534 | ============================ | |
2191 |
|
535 | |||
2192 | $ hg init nocommit |
|
536 | $ hg init nocommit | |
2193 | $ cd nocommit |
|
537 | $ cd nocommit | |
2194 | $ echo a > a |
|
538 | $ echo a > a | |
2195 | $ hg ci -qAma |
|
539 | $ hg ci -qAma | |
2196 | $ echo b > b |
|
540 | $ echo b > b | |
2197 | $ hg ci -qAmb |
|
541 | $ hg ci -qAmb | |
2198 | $ hg up -q 0 |
|
542 | $ hg up -q 0 | |
2199 | $ echo c > c |
|
543 | $ echo c > c | |
2200 | $ hg ci -qAmc |
|
544 | $ hg ci -qAmc | |
2201 | $ hg log -GT "{rev}:{node|short} {desc}\n" |
|
545 | $ hg log -GT "{rev}:{node|short} {desc}\n" | |
2202 | @ 2:d36c0562f908 c |
|
546 | @ 2:d36c0562f908 c | |
2203 | | |
|
547 | | | |
2204 | | o 1:d2ae7f538514 b |
|
548 | | o 1:d2ae7f538514 b | |
2205 | |/ |
|
549 | |/ | |
2206 | o 0:cb9a9f314b8b a |
|
550 | o 0:cb9a9f314b8b a | |
2207 |
|
551 | |||
2208 |
|
552 | |||
2209 | Check reporting when --no-commit used with non-applicable options: |
|
553 | Check reporting when --no-commit used with non-applicable options: | |
2210 |
|
554 | |||
2211 | $ hg graft 1 --no-commit -e |
|
555 | $ hg graft 1 --no-commit -e | |
2212 | abort: cannot specify --no-commit and --edit together |
|
556 | abort: cannot specify --no-commit and --edit together | |
2213 | [255] |
|
557 | [255] | |
2214 |
|
558 | |||
2215 | $ hg graft 1 --no-commit --log |
|
559 | $ hg graft 1 --no-commit --log | |
2216 | abort: cannot specify --no-commit and --log together |
|
560 | abort: cannot specify --no-commit and --log together | |
2217 | [255] |
|
561 | [255] | |
2218 |
|
562 | |||
2219 | $ hg graft 1 --no-commit -D |
|
563 | $ hg graft 1 --no-commit -D | |
2220 | abort: cannot specify --no-commit and --currentdate together |
|
564 | abort: cannot specify --no-commit and --currentdate together | |
2221 | [255] |
|
565 | [255] | |
2222 |
|
566 | |||
2223 | Test --no-commit is working: |
|
567 | Test --no-commit is working: | |
2224 | $ hg graft 1 --no-commit |
|
568 | $ hg graft 1 --no-commit | |
2225 | grafting 1:d2ae7f538514 "b" |
|
569 | grafting 1:d2ae7f538514 "b" | |
2226 |
|
570 | |||
2227 | $ hg log -GT "{rev}:{node|short} {desc}\n" |
|
571 | $ hg log -GT "{rev}:{node|short} {desc}\n" | |
2228 | @ 2:d36c0562f908 c |
|
572 | @ 2:d36c0562f908 c | |
2229 | | |
|
573 | | | |
2230 | | o 1:d2ae7f538514 b |
|
574 | | o 1:d2ae7f538514 b | |
2231 | |/ |
|
575 | |/ | |
2232 | o 0:cb9a9f314b8b a |
|
576 | o 0:cb9a9f314b8b a | |
2233 |
|
577 | |||
2234 |
|
578 | |||
2235 | $ hg diff |
|
579 | $ hg diff | |
2236 | diff -r d36c0562f908 b |
|
580 | diff -r d36c0562f908 b | |
2237 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
581 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
2238 | +++ b/b Thu Jan 01 00:00:00 1970 +0000 |
|
582 | +++ b/b Thu Jan 01 00:00:00 1970 +0000 | |
2239 | @@ -0,0 +1,1 @@ |
|
583 | @@ -0,0 +1,1 @@ | |
2240 | +b |
|
584 | +b | |
2241 |
|
585 | |||
2242 | Prepare wrdir to check --no-commit is resepected after --continue: |
|
586 | Prepare wrdir to check --no-commit is resepected after --continue: | |
2243 |
|
587 | |||
2244 | $ hg up -qC |
|
588 | $ hg up -qC | |
2245 | $ echo A>a |
|
589 | $ echo A>a | |
2246 | $ hg ci -qm "A in file a" |
|
590 | $ hg ci -qm "A in file a" | |
2247 | $ hg up -q 1 |
|
591 | $ hg up -q 1 | |
2248 | $ echo B>a |
|
592 | $ echo B>a | |
2249 | $ hg ci -qm "B in file a" |
|
593 | $ hg ci -qm "B in file a" | |
2250 | $ hg log -GT "{rev}:{node|short} {desc}\n" |
|
594 | $ hg log -GT "{rev}:{node|short} {desc}\n" | |
2251 | @ 4:2aa9ad1006ff B in file a |
|
595 | @ 4:2aa9ad1006ff B in file a | |
2252 | | |
|
596 | | | |
2253 | | o 3:09e253b87e17 A in file a |
|
597 | | o 3:09e253b87e17 A in file a | |
2254 | | | |
|
598 | | | | |
2255 | | o 2:d36c0562f908 c |
|
599 | | o 2:d36c0562f908 c | |
2256 | | | |
|
600 | | | | |
2257 | o | 1:d2ae7f538514 b |
|
601 | o | 1:d2ae7f538514 b | |
2258 | |/ |
|
602 | |/ | |
2259 | o 0:cb9a9f314b8b a |
|
603 | o 0:cb9a9f314b8b a | |
2260 |
|
604 | |||
2261 |
|
605 | |||
2262 | $ hg graft 3 --no-commit |
|
606 | $ hg graft 3 --no-commit | |
2263 | grafting 3:09e253b87e17 "A in file a" |
|
607 | grafting 3:09e253b87e17 "A in file a" | |
2264 | merging a |
|
608 | merging a | |
2265 | warning: conflicts while merging a! (edit, then use 'hg resolve --mark') |
|
609 | warning: conflicts while merging a! (edit, then use 'hg resolve --mark') | |
2266 | abort: unresolved conflicts, can't continue |
|
610 | abort: unresolved conflicts, can't continue | |
2267 | (use 'hg resolve' and 'hg graft --continue') |
|
611 | (use 'hg resolve' and 'hg graft --continue') | |
2268 | [255] |
|
612 | [255] | |
2269 |
|
613 | |||
2270 | Resolve conflict: |
|
614 | Resolve conflict: | |
2271 | $ echo A>a |
|
615 | $ echo A>a | |
2272 | $ hg resolve --mark |
|
616 | $ hg resolve --mark | |
2273 | (no more unresolved files) |
|
617 | (no more unresolved files) | |
2274 | continue: hg graft --continue |
|
618 | continue: hg graft --continue | |
2275 |
|
619 | |||
2276 | $ hg graft --continue |
|
620 | $ hg graft --continue | |
2277 | grafting 3:09e253b87e17 "A in file a" |
|
621 | grafting 3:09e253b87e17 "A in file a" | |
2278 | $ hg log -GT "{rev}:{node|short} {desc}\n" |
|
622 | $ hg log -GT "{rev}:{node|short} {desc}\n" | |
2279 | @ 4:2aa9ad1006ff B in file a |
|
623 | @ 4:2aa9ad1006ff B in file a | |
2280 | | |
|
624 | | | |
2281 | | o 3:09e253b87e17 A in file a |
|
625 | | o 3:09e253b87e17 A in file a | |
2282 | | | |
|
626 | | | | |
2283 | | o 2:d36c0562f908 c |
|
627 | | o 2:d36c0562f908 c | |
2284 | | | |
|
628 | | | | |
2285 | o | 1:d2ae7f538514 b |
|
629 | o | 1:d2ae7f538514 b | |
2286 | |/ |
|
630 | |/ | |
2287 | o 0:cb9a9f314b8b a |
|
631 | o 0:cb9a9f314b8b a | |
2288 |
|
632 | |||
2289 | $ hg diff |
|
633 | $ hg diff | |
2290 | diff -r 2aa9ad1006ff a |
|
634 | diff -r 2aa9ad1006ff a | |
2291 | --- a/a Thu Jan 01 00:00:00 1970 +0000 |
|
635 | --- a/a Thu Jan 01 00:00:00 1970 +0000 | |
2292 | +++ b/a Thu Jan 01 00:00:00 1970 +0000 |
|
636 | +++ b/a Thu Jan 01 00:00:00 1970 +0000 | |
2293 | @@ -1,1 +1,1 @@ |
|
637 | @@ -1,1 +1,1 @@ | |
2294 | -B |
|
638 | -B | |
2295 | +A |
|
639 | +A | |
2296 |
|
640 | |||
2297 | $ hg up -qC |
|
641 | $ hg up -qC | |
2298 |
|
642 | |||
2299 | Check --no-commit is resepected when passed with --continue: |
|
643 | Check --no-commit is resepected when passed with --continue: | |
2300 |
|
644 | |||
2301 | $ hg graft 3 |
|
645 | $ hg graft 3 | |
2302 | grafting 3:09e253b87e17 "A in file a" |
|
646 | grafting 3:09e253b87e17 "A in file a" | |
2303 | merging a |
|
647 | merging a | |
2304 | warning: conflicts while merging a! (edit, then use 'hg resolve --mark') |
|
648 | warning: conflicts while merging a! (edit, then use 'hg resolve --mark') | |
2305 | abort: unresolved conflicts, can't continue |
|
649 | abort: unresolved conflicts, can't continue | |
2306 | (use 'hg resolve' and 'hg graft --continue') |
|
650 | (use 'hg resolve' and 'hg graft --continue') | |
2307 | [255] |
|
651 | [255] | |
2308 |
|
652 | |||
2309 | Resolve conflict: |
|
653 | Resolve conflict: | |
2310 | $ echo A>a |
|
654 | $ echo A>a | |
2311 | $ hg resolve --mark |
|
655 | $ hg resolve --mark | |
2312 | (no more unresolved files) |
|
656 | (no more unresolved files) | |
2313 | continue: hg graft --continue |
|
657 | continue: hg graft --continue | |
2314 |
|
658 | |||
2315 | $ hg graft --continue --no-commit |
|
659 | $ hg graft --continue --no-commit | |
2316 | grafting 3:09e253b87e17 "A in file a" |
|
660 | grafting 3:09e253b87e17 "A in file a" | |
2317 | $ hg diff |
|
661 | $ hg diff | |
2318 | diff -r 2aa9ad1006ff a |
|
662 | diff -r 2aa9ad1006ff a | |
2319 | --- a/a Thu Jan 01 00:00:00 1970 +0000 |
|
663 | --- a/a Thu Jan 01 00:00:00 1970 +0000 | |
2320 | +++ b/a Thu Jan 01 00:00:00 1970 +0000 |
|
664 | +++ b/a Thu Jan 01 00:00:00 1970 +0000 | |
2321 | @@ -1,1 +1,1 @@ |
|
665 | @@ -1,1 +1,1 @@ | |
2322 | -B |
|
666 | -B | |
2323 | +A |
|
667 | +A | |
2324 |
|
668 | |||
2325 | $ hg log -GT "{rev}:{node|short} {desc}\n" |
|
669 | $ hg log -GT "{rev}:{node|short} {desc}\n" | |
2326 | @ 4:2aa9ad1006ff B in file a |
|
670 | @ 4:2aa9ad1006ff B in file a | |
2327 | | |
|
671 | | | |
2328 | | o 3:09e253b87e17 A in file a |
|
672 | | o 3:09e253b87e17 A in file a | |
2329 | | | |
|
673 | | | | |
2330 | | o 2:d36c0562f908 c |
|
674 | | o 2:d36c0562f908 c | |
2331 | | | |
|
675 | | | | |
2332 | o | 1:d2ae7f538514 b |
|
676 | o | 1:d2ae7f538514 b | |
2333 | |/ |
|
677 | |/ | |
2334 | o 0:cb9a9f314b8b a |
|
678 | o 0:cb9a9f314b8b a | |
2335 |
|
679 | |||
2336 | $ hg up -qC |
|
680 | $ hg up -qC | |
2337 |
|
681 | |||
2338 | Test --no-commit when graft multiple revisions: |
|
682 | Test --no-commit when graft multiple revisions: | |
2339 | When there is conflict: |
|
683 | When there is conflict: | |
2340 | $ hg graft -r "2::3" --no-commit |
|
684 | $ hg graft -r "2::3" --no-commit | |
2341 | grafting 2:d36c0562f908 "c" |
|
685 | grafting 2:d36c0562f908 "c" | |
2342 | grafting 3:09e253b87e17 "A in file a" |
|
686 | grafting 3:09e253b87e17 "A in file a" | |
2343 | merging a |
|
687 | merging a | |
2344 | warning: conflicts while merging a! (edit, then use 'hg resolve --mark') |
|
688 | warning: conflicts while merging a! (edit, then use 'hg resolve --mark') | |
2345 | abort: unresolved conflicts, can't continue |
|
689 | abort: unresolved conflicts, can't continue | |
2346 | (use 'hg resolve' and 'hg graft --continue') |
|
690 | (use 'hg resolve' and 'hg graft --continue') | |
2347 | [255] |
|
691 | [255] | |
2348 |
|
692 | |||
2349 | $ echo A>a |
|
693 | $ echo A>a | |
2350 | $ hg resolve --mark |
|
694 | $ hg resolve --mark | |
2351 | (no more unresolved files) |
|
695 | (no more unresolved files) | |
2352 | continue: hg graft --continue |
|
696 | continue: hg graft --continue | |
2353 | $ hg graft --continue |
|
697 | $ hg graft --continue | |
2354 | grafting 3:09e253b87e17 "A in file a" |
|
698 | grafting 3:09e253b87e17 "A in file a" | |
2355 | $ hg diff |
|
699 | $ hg diff | |
2356 | diff -r 2aa9ad1006ff a |
|
700 | diff -r 2aa9ad1006ff a | |
2357 | --- a/a Thu Jan 01 00:00:00 1970 +0000 |
|
701 | --- a/a Thu Jan 01 00:00:00 1970 +0000 | |
2358 | +++ b/a Thu Jan 01 00:00:00 1970 +0000 |
|
702 | +++ b/a Thu Jan 01 00:00:00 1970 +0000 | |
2359 | @@ -1,1 +1,1 @@ |
|
703 | @@ -1,1 +1,1 @@ | |
2360 | -B |
|
704 | -B | |
2361 | +A |
|
705 | +A | |
2362 | diff -r 2aa9ad1006ff c |
|
706 | diff -r 2aa9ad1006ff c | |
2363 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
707 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
2364 | +++ b/c Thu Jan 01 00:00:00 1970 +0000 |
|
708 | +++ b/c Thu Jan 01 00:00:00 1970 +0000 | |
2365 | @@ -0,0 +1,1 @@ |
|
709 | @@ -0,0 +1,1 @@ | |
2366 | +c |
|
710 | +c | |
2367 |
|
711 | |||
2368 | $ hg log -GT "{rev}:{node|short} {desc}\n" |
|
712 | $ hg log -GT "{rev}:{node|short} {desc}\n" | |
2369 | @ 4:2aa9ad1006ff B in file a |
|
713 | @ 4:2aa9ad1006ff B in file a | |
2370 | | |
|
714 | | | |
2371 | | o 3:09e253b87e17 A in file a |
|
715 | | o 3:09e253b87e17 A in file a | |
2372 | | | |
|
716 | | | | |
2373 | | o 2:d36c0562f908 c |
|
717 | | o 2:d36c0562f908 c | |
2374 | | | |
|
718 | | | | |
2375 | o | 1:d2ae7f538514 b |
|
719 | o | 1:d2ae7f538514 b | |
2376 | |/ |
|
720 | |/ | |
2377 | o 0:cb9a9f314b8b a |
|
721 | o 0:cb9a9f314b8b a | |
2378 |
|
722 | |||
2379 | $ hg up -qC |
|
723 | $ hg up -qC | |
2380 |
|
724 | |||
2381 | When there is no conflict: |
|
725 | When there is no conflict: | |
2382 | $ echo d>d |
|
726 | $ echo d>d | |
2383 | $ hg add d -q |
|
727 | $ hg add d -q | |
2384 | $ hg ci -qmd |
|
728 | $ hg ci -qmd | |
2385 | $ hg up 3 -q |
|
729 | $ hg up 3 -q | |
2386 | $ hg log -GT "{rev}:{node|short} {desc}\n" |
|
730 | $ hg log -GT "{rev}:{node|short} {desc}\n" | |
2387 | o 5:baefa8927fc0 d |
|
731 | o 5:baefa8927fc0 d | |
2388 | | |
|
732 | | | |
2389 | o 4:2aa9ad1006ff B in file a |
|
733 | o 4:2aa9ad1006ff B in file a | |
2390 | | |
|
734 | | | |
2391 | | @ 3:09e253b87e17 A in file a |
|
735 | | @ 3:09e253b87e17 A in file a | |
2392 | | | |
|
736 | | | | |
2393 | | o 2:d36c0562f908 c |
|
737 | | o 2:d36c0562f908 c | |
2394 | | | |
|
738 | | | | |
2395 | o | 1:d2ae7f538514 b |
|
739 | o | 1:d2ae7f538514 b | |
2396 | |/ |
|
740 | |/ | |
2397 | o 0:cb9a9f314b8b a |
|
741 | o 0:cb9a9f314b8b a | |
2398 |
|
742 | |||
2399 |
|
743 | |||
2400 | $ hg graft -r 1 -r 5 --no-commit |
|
744 | $ hg graft -r 1 -r 5 --no-commit | |
2401 | grafting 1:d2ae7f538514 "b" |
|
745 | grafting 1:d2ae7f538514 "b" | |
2402 | grafting 5:baefa8927fc0 "d" (tip) |
|
746 | grafting 5:baefa8927fc0 "d" (tip) | |
2403 | $ hg diff |
|
747 | $ hg diff | |
2404 | diff -r 09e253b87e17 b |
|
748 | diff -r 09e253b87e17 b | |
2405 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
749 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
2406 | +++ b/b Thu Jan 01 00:00:00 1970 +0000 |
|
750 | +++ b/b Thu Jan 01 00:00:00 1970 +0000 | |
2407 | @@ -0,0 +1,1 @@ |
|
751 | @@ -0,0 +1,1 @@ | |
2408 | +b |
|
752 | +b | |
2409 | diff -r 09e253b87e17 d |
|
753 | diff -r 09e253b87e17 d | |
2410 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
754 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
2411 | +++ b/d Thu Jan 01 00:00:00 1970 +0000 |
|
755 | +++ b/d Thu Jan 01 00:00:00 1970 +0000 | |
2412 | @@ -0,0 +1,1 @@ |
|
756 | @@ -0,0 +1,1 @@ | |
2413 | +d |
|
757 | +d | |
2414 | $ hg log -GT "{rev}:{node|short} {desc}\n" |
|
758 | $ hg log -GT "{rev}:{node|short} {desc}\n" | |
2415 | o 5:baefa8927fc0 d |
|
759 | o 5:baefa8927fc0 d | |
2416 | | |
|
760 | | | |
2417 | o 4:2aa9ad1006ff B in file a |
|
761 | o 4:2aa9ad1006ff B in file a | |
2418 | | |
|
762 | | | |
2419 | | @ 3:09e253b87e17 A in file a |
|
763 | | @ 3:09e253b87e17 A in file a | |
2420 | | | |
|
764 | | | | |
2421 | | o 2:d36c0562f908 c |
|
765 | | o 2:d36c0562f908 c | |
2422 | | | |
|
766 | | | | |
2423 | o | 1:d2ae7f538514 b |
|
767 | o | 1:d2ae7f538514 b | |
2424 | |/ |
|
768 | |/ | |
2425 | o 0:cb9a9f314b8b a |
|
769 | o 0:cb9a9f314b8b a | |
2426 |
|
770 | |||
2427 | $ cd .. |
|
771 | $ cd .. |
This diff has been collapsed as it changes many lines, (771 lines changed) Show them Hide them | |||||
@@ -1,2427 +1,1656 | |||||
1 | #testcases abortcommand abortflag |
|
|||
2 |
|
||||
3 |
|
|
1 | $ cat >> $HGRCPATH <<EOF | |
4 | > [extdiff] |
|
2 | > [extdiff] | |
5 | > # for portability: |
|
3 | > # for portability: | |
6 | > pdiff = sh "$RUNTESTDIR/pdiff" |
|
4 | > pdiff = sh "$RUNTESTDIR/pdiff" | |
7 | > EOF |
|
5 | > EOF | |
8 |
|
6 | |||
9 | #if abortflag |
|
|||
10 | $ cat >> $HGRCPATH <<EOF |
|
|||
11 | > [alias] |
|
|||
12 | > abort = graft --abort |
|
|||
13 | > EOF |
|
|||
14 | #endif |
|
|||
15 |
|
||||
16 | Create a repo with some stuff in it: |
|
7 | Create a repo with some stuff in it: | |
17 |
|
8 | |||
18 | $ hg init a |
|
9 | $ hg init a | |
19 | $ cd a |
|
10 | $ cd a | |
20 | $ echo a > a |
|
11 | $ echo a > a | |
21 | $ echo a > d |
|
12 | $ echo a > d | |
22 | $ echo a > e |
|
13 | $ echo a > e | |
23 | $ hg ci -qAm0 |
|
14 | $ hg ci -qAm0 | |
24 | $ echo b > a |
|
15 | $ echo b > a | |
25 | $ hg ci -m1 -u bar |
|
16 | $ hg ci -m1 -u bar | |
26 | $ hg mv a b |
|
17 | $ hg mv a b | |
27 | $ hg ci -m2 |
|
18 | $ hg ci -m2 | |
28 | $ hg cp b c |
|
19 | $ hg cp b c | |
29 | $ hg ci -m3 -u baz |
|
20 | $ hg ci -m3 -u baz | |
30 | $ echo b > d |
|
21 | $ echo b > d | |
31 | $ echo f > e |
|
22 | $ echo f > e | |
32 | $ hg ci -m4 |
|
23 | $ hg ci -m4 | |
33 | $ hg up -q 3 |
|
24 | $ hg up -q 3 | |
34 | $ echo b > e |
|
25 | $ echo b > e | |
35 | $ hg branch -q stable |
|
26 | $ hg branch -q stable | |
36 | $ hg ci -m5 |
|
27 | $ hg ci -m5 | |
37 | $ hg merge -q default --tool internal:local # for conflicts in e, choose 5 and ignore 4 |
|
28 | $ hg merge -q default --tool internal:local # for conflicts in e, choose 5 and ignore 4 | |
38 | $ hg branch -q default |
|
29 | $ hg branch -q default | |
39 | $ hg ci -m6 |
|
30 | $ hg ci -m6 | |
40 | $ hg phase --public 3 |
|
31 | $ hg phase --public 3 | |
41 | $ hg phase --force --secret 6 |
|
32 | $ hg phase --force --secret 6 | |
42 |
|
33 | |||
43 | $ hg log -G --template '{author}@{rev}.{phase}: {desc}\n' |
|
34 | $ hg log -G --template '{author}@{rev}.{phase}: {desc}\n' | |
44 | @ test@6.secret: 6 |
|
35 | @ test@6.secret: 6 | |
45 | |\ |
|
36 | |\ | |
46 | | o test@5.draft: 5 |
|
37 | | o test@5.draft: 5 | |
47 | | | |
|
38 | | | | |
48 | o | test@4.draft: 4 |
|
39 | o | test@4.draft: 4 | |
49 | |/ |
|
40 | |/ | |
50 | o baz@3.public: 3 |
|
41 | o baz@3.public: 3 | |
51 | | |
|
42 | | | |
52 | o test@2.public: 2 |
|
43 | o test@2.public: 2 | |
53 | | |
|
44 | | | |
54 | o bar@1.public: 1 |
|
45 | o bar@1.public: 1 | |
55 | | |
|
46 | | | |
56 | o test@0.public: 0 |
|
47 | o test@0.public: 0 | |
57 |
|
48 | |||
58 | Test --base for grafting the merge of 4 from the perspective of 5, thus only getting the change to d |
|
49 | Test --base for grafting the merge of 4 from the perspective of 5, thus only getting the change to d | |
59 |
|
50 | |||
60 | $ hg up -cqr 3 |
|
51 | $ hg up -cqr 3 | |
61 | $ hg graft -r 6 --base 5 |
|
52 | $ hg graft -r 6 --base 5 | |
62 | grafting 6:25a2b029d3ae "6" (tip) |
|
53 | grafting 6:25a2b029d3ae "6" (tip) | |
63 | merging e |
|
54 | merging e | |
64 | $ hg st --change . |
|
55 | $ hg st --change . | |
65 | M d |
|
56 | M d | |
66 |
|
57 | |||
67 | $ hg -q strip . --config extensions.strip= |
|
58 | $ hg -q strip . --config extensions.strip= | |
68 |
|
59 | |||
69 | Test --base for collapsing changesets 2 and 3, thus getting both b and c |
|
60 | Test --base for collapsing changesets 2 and 3, thus getting both b and c | |
70 |
|
61 | |||
71 | $ hg up -cqr 0 |
|
62 | $ hg up -cqr 0 | |
72 | $ hg graft -r 3 --base 1 |
|
63 | $ hg graft -r 3 --base 1 | |
73 | grafting 3:4c60f11aa304 "3" |
|
64 | grafting 3:4c60f11aa304 "3" | |
74 | merging a and b to b |
|
65 | merging a and b to b | |
75 | merging a and c to c |
|
66 | merging a and c to c | |
76 | $ hg st --change . |
|
67 | $ hg st --change . | |
77 | A b |
|
68 | A b | |
78 | A c |
|
69 | A c | |
79 | R a |
|
70 | R a | |
80 |
|
71 | |||
81 | $ hg -q strip . --config extensions.strip= |
|
72 | $ hg -q strip . --config extensions.strip= | |
82 |
|
73 | |||
83 | Specifying child as --base revision fails safely (perhaps slightly confusing, but consistent) |
|
74 | Specifying child as --base revision fails safely (perhaps slightly confusing, but consistent) | |
84 |
|
75 | |||
85 | $ hg graft -r 2 --base 3 |
|
76 | $ hg graft -r 2 --base 3 | |
86 | grafting 2:5c095ad7e90f "2" |
|
77 | grafting 2:5c095ad7e90f "2" | |
87 | note: possible conflict - c was deleted and renamed to: |
|
78 | note: possible conflict - c was deleted and renamed to: | |
88 | a |
|
79 | a | |
89 | note: graft of 2:5c095ad7e90f created no changes to commit |
|
80 | note: graft of 2:5c095ad7e90f created no changes to commit | |
90 |
|
81 | |||
91 | Can't continue without starting: |
|
82 | Can't continue without starting: | |
92 |
|
83 | |||
93 | $ hg -q up -cr tip |
|
84 | $ hg -q up -cr tip | |
94 | $ hg rm -q e |
|
85 | $ hg rm -q e | |
95 | $ hg graft --continue |
|
86 | $ hg graft --continue | |
96 | abort: no graft in progress |
|
87 | abort: no graft in progress | |
97 | [255] |
|
88 | [255] | |
98 | $ hg revert -r . -q e |
|
89 | $ hg revert -r . -q e | |
99 |
|
90 | |||
100 | Need to specify a rev: |
|
91 | Need to specify a rev: | |
101 |
|
92 | |||
102 | $ hg graft |
|
93 | $ hg graft | |
103 | abort: no revisions specified |
|
94 | abort: no revisions specified | |
104 | [255] |
|
95 | [255] | |
105 |
|
96 | |||
106 | Can't graft ancestor: |
|
97 | Can't graft ancestor: | |
107 |
|
98 | |||
108 | $ hg graft 1 2 |
|
99 | $ hg graft 1 2 | |
109 | skipping ancestor revision 1:5d205f8b35b6 |
|
100 | skipping ancestor revision 1:5d205f8b35b6 | |
110 | skipping ancestor revision 2:5c095ad7e90f |
|
101 | skipping ancestor revision 2:5c095ad7e90f | |
111 | [255] |
|
102 | [255] | |
112 |
|
103 | |||
113 | Specify revisions with -r: |
|
104 | Specify revisions with -r: | |
114 |
|
105 | |||
115 | $ hg graft -r 1 -r 2 |
|
106 | $ hg graft -r 1 -r 2 | |
116 | skipping ancestor revision 1:5d205f8b35b6 |
|
107 | skipping ancestor revision 1:5d205f8b35b6 | |
117 | skipping ancestor revision 2:5c095ad7e90f |
|
108 | skipping ancestor revision 2:5c095ad7e90f | |
118 | [255] |
|
109 | [255] | |
119 |
|
110 | |||
120 | $ hg graft -r 1 2 |
|
111 | $ hg graft -r 1 2 | |
121 | warning: inconsistent use of --rev might give unexpected revision ordering! |
|
112 | warning: inconsistent use of --rev might give unexpected revision ordering! | |
122 | skipping ancestor revision 2:5c095ad7e90f |
|
113 | skipping ancestor revision 2:5c095ad7e90f | |
123 | skipping ancestor revision 1:5d205f8b35b6 |
|
114 | skipping ancestor revision 1:5d205f8b35b6 | |
124 | [255] |
|
115 | [255] | |
125 |
|
116 | |||
126 | Conflicting date/user options: |
|
117 | Conflicting date/user options: | |
127 |
|
118 | |||
128 | $ hg up -q 0 |
|
119 | $ hg up -q 0 | |
129 | $ hg graft -U --user foo 2 |
|
120 | $ hg graft -U --user foo 2 | |
130 | abort: cannot specify both --user and --currentuser |
|
121 | abort: cannot specify both --user and --currentuser | |
131 | [255] |
|
122 | [255] | |
132 | $ hg graft -D --date '0 0' 2 |
|
123 | $ hg graft -D --date '0 0' 2 | |
133 | abort: cannot specify both --date and --currentdate |
|
124 | abort: cannot specify both --date and --currentdate | |
134 | [255] |
|
125 | [255] | |
135 |
|
126 | |||
136 | Can't graft with dirty wd: |
|
127 | Can't graft with dirty wd: | |
137 |
|
128 | |||
138 | $ hg up -q 0 |
|
129 | $ hg up -q 0 | |
139 | $ echo foo > a |
|
130 | $ echo foo > a | |
140 | $ hg graft 1 |
|
131 | $ hg graft 1 | |
141 | abort: uncommitted changes |
|
132 | abort: uncommitted changes | |
142 | [255] |
|
133 | [255] | |
143 | $ hg revert a |
|
134 | $ hg revert a | |
144 |
|
135 | |||
145 | Graft a rename: |
|
136 | Graft a rename: | |
146 | (this also tests that editor is invoked if '--edit' is specified) |
|
137 | (this also tests that editor is invoked if '--edit' is specified) | |
147 |
|
138 | |||
148 | $ hg status --rev "2^1" --rev 2 |
|
139 | $ hg status --rev "2^1" --rev 2 | |
149 | A b |
|
140 | A b | |
150 | R a |
|
141 | R a | |
151 | $ HGEDITOR=cat hg graft 2 -u foo --edit |
|
142 | $ HGEDITOR=cat hg graft 2 -u foo --edit | |
152 | grafting 2:5c095ad7e90f "2" |
|
143 | grafting 2:5c095ad7e90f "2" | |
153 | merging a and b to b |
|
144 | merging a and b to b | |
154 | 2 |
|
145 | 2 | |
155 |
|
146 | |||
156 |
|
147 | |||
157 | HG: Enter commit message. Lines beginning with 'HG:' are removed. |
|
148 | HG: Enter commit message. Lines beginning with 'HG:' are removed. | |
158 | HG: Leave message empty to abort commit. |
|
149 | HG: Leave message empty to abort commit. | |
159 | HG: -- |
|
150 | HG: -- | |
160 | HG: user: foo |
|
151 | HG: user: foo | |
161 | HG: branch 'default' |
|
152 | HG: branch 'default' | |
162 | HG: added b |
|
153 | HG: added b | |
163 | HG: removed a |
|
154 | HG: removed a | |
164 | $ hg export tip --git |
|
155 | $ hg export tip --git | |
165 | # HG changeset patch |
|
156 | # HG changeset patch | |
166 | # User foo |
|
157 | # User foo | |
167 | # Date 0 0 |
|
158 | # Date 0 0 | |
168 | # Thu Jan 01 00:00:00 1970 +0000 |
|
159 | # Thu Jan 01 00:00:00 1970 +0000 | |
169 | # Node ID ef0ef43d49e79e81ddafdc7997401ba0041efc82 |
|
160 | # Node ID ef0ef43d49e79e81ddafdc7997401ba0041efc82 | |
170 | # Parent 68795b066622ca79a25816a662041d8f78f3cd9e |
|
161 | # Parent 68795b066622ca79a25816a662041d8f78f3cd9e | |
171 | 2 |
|
162 | 2 | |
172 |
|
163 | |||
173 | diff --git a/a b/b |
|
164 | diff --git a/a b/b | |
174 | rename from a |
|
165 | rename from a | |
175 | rename to b |
|
166 | rename to b | |
176 |
|
167 | |||
177 | Look for extra:source |
|
168 | Look for extra:source | |
178 |
|
169 | |||
179 | $ hg log --debug -r tip |
|
170 | $ hg log --debug -r tip | |
180 | changeset: 7:ef0ef43d49e79e81ddafdc7997401ba0041efc82 |
|
171 | changeset: 7:ef0ef43d49e79e81ddafdc7997401ba0041efc82 | |
181 | tag: tip |
|
172 | tag: tip | |
182 | phase: draft |
|
173 | phase: draft | |
183 | parent: 0:68795b066622ca79a25816a662041d8f78f3cd9e |
|
174 | parent: 0:68795b066622ca79a25816a662041d8f78f3cd9e | |
184 | parent: -1:0000000000000000000000000000000000000000 |
|
175 | parent: -1:0000000000000000000000000000000000000000 | |
185 | manifest: 7:e59b6b228f9cbf9903d5e9abf996e083a1f533eb |
|
176 | manifest: 7:e59b6b228f9cbf9903d5e9abf996e083a1f533eb | |
186 | user: foo |
|
177 | user: foo | |
187 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
178 | date: Thu Jan 01 00:00:00 1970 +0000 | |
188 | files+: b |
|
179 | files+: b | |
189 | files-: a |
|
180 | files-: a | |
190 | extra: branch=default |
|
181 | extra: branch=default | |
191 | extra: source=5c095ad7e90f871700f02dd1fa5012cb4498a2d4 |
|
182 | extra: source=5c095ad7e90f871700f02dd1fa5012cb4498a2d4 | |
192 | description: |
|
183 | description: | |
193 | 2 |
|
184 | 2 | |
194 |
|
185 | |||
195 |
|
186 | |||
196 |
|
187 | |||
197 | Graft out of order, skipping a merge and a duplicate |
|
188 | Graft out of order, skipping a merge and a duplicate | |
198 | (this also tests that editor is not invoked if '--edit' is not specified) |
|
189 | (this also tests that editor is not invoked if '--edit' is not specified) | |
199 |
|
190 | |||
200 | $ hg graft 1 5 4 3 'merge()' 2 -n |
|
191 | $ hg graft 1 5 4 3 'merge()' 2 -n | |
201 | skipping ungraftable merge revision 6 |
|
192 | skipping ungraftable merge revision 6 | |
202 | skipping revision 2:5c095ad7e90f (already grafted to 7:ef0ef43d49e7) |
|
193 | skipping revision 2:5c095ad7e90f (already grafted to 7:ef0ef43d49e7) | |
203 | grafting 1:5d205f8b35b6 "1" |
|
194 | grafting 1:5d205f8b35b6 "1" | |
204 | grafting 5:97f8bfe72746 "5" |
|
195 | grafting 5:97f8bfe72746 "5" | |
205 | grafting 4:9c233e8e184d "4" |
|
196 | grafting 4:9c233e8e184d "4" | |
206 | grafting 3:4c60f11aa304 "3" |
|
197 | grafting 3:4c60f11aa304 "3" | |
207 |
|
198 | |||
208 | $ HGEDITOR=cat hg graft 1 5 'merge()' 2 --debug |
|
199 | $ HGEDITOR=cat hg graft 1 5 'merge()' 2 --debug | |
209 | skipping ungraftable merge revision 6 |
|
200 | skipping ungraftable merge revision 6 | |
210 | scanning for duplicate grafts |
|
201 | scanning for duplicate grafts | |
211 | skipping revision 2:5c095ad7e90f (already grafted to 7:ef0ef43d49e7) |
|
202 | skipping revision 2:5c095ad7e90f (already grafted to 7:ef0ef43d49e7) | |
212 | grafting 1:5d205f8b35b6 "1" |
|
203 | grafting 1:5d205f8b35b6 "1" | |
213 | unmatched files in local: |
|
204 | unmatched files in local: | |
214 | b |
|
205 | b | |
215 | all copies found (* = to merge, ! = divergent, % = renamed and deleted): |
|
206 | all copies found (* = to merge, ! = divergent, % = renamed and deleted): | |
216 | src: 'a' -> dst: 'b' * |
|
207 | src: 'a' -> dst: 'b' * | |
217 | checking for directory renames |
|
208 | checking for directory renames | |
218 | resolving manifests |
|
209 | resolving manifests | |
219 | branchmerge: True, force: True, partial: False |
|
210 | branchmerge: True, force: True, partial: False | |
220 | ancestor: 68795b066622, local: ef0ef43d49e7+, remote: 5d205f8b35b6 |
|
211 | ancestor: 68795b066622, local: ef0ef43d49e7+, remote: 5d205f8b35b6 | |
221 | preserving b for resolve of b |
|
212 | preserving b for resolve of b | |
222 | starting 4 threads for background file closing (?) |
|
213 | starting 4 threads for background file closing (?) | |
223 | b: local copied/moved from a -> m (premerge) |
|
214 | b: local copied/moved from a -> m (premerge) | |
224 | picked tool ':merge' for b (binary False symlink False changedelete False) |
|
215 | picked tool ':merge' for b (binary False symlink False changedelete False) | |
225 | merging b and a to b |
|
216 | merging b and a to b | |
226 | my b@ef0ef43d49e7+ other a@5d205f8b35b6 ancestor a@68795b066622 |
|
217 | my b@ef0ef43d49e7+ other a@5d205f8b35b6 ancestor a@68795b066622 | |
227 | premerge successful |
|
218 | premerge successful | |
228 | committing files: |
|
219 | committing files: | |
229 | b |
|
220 | b | |
230 | committing manifest |
|
221 | committing manifest | |
231 | committing changelog |
|
222 | committing changelog | |
232 | updating the branch cache |
|
223 | updating the branch cache | |
233 | grafting 5:97f8bfe72746 "5" |
|
224 | grafting 5:97f8bfe72746 "5" | |
234 | all copies found (* = to merge, ! = divergent, % = renamed and deleted): |
|
225 | all copies found (* = to merge, ! = divergent, % = renamed and deleted): | |
235 | src: 'c' -> dst: 'b' |
|
226 | src: 'c' -> dst: 'b' | |
236 | checking for directory renames |
|
227 | checking for directory renames | |
237 | resolving manifests |
|
228 | resolving manifests | |
238 | branchmerge: True, force: True, partial: False |
|
229 | branchmerge: True, force: True, partial: False | |
239 | ancestor: 4c60f11aa304, local: 6b9e5368ca4e+, remote: 97f8bfe72746 |
|
230 | ancestor: 4c60f11aa304, local: 6b9e5368ca4e+, remote: 97f8bfe72746 | |
240 | e: remote is newer -> g |
|
231 | e: remote is newer -> g | |
241 | getting e |
|
232 | getting e | |
242 | committing files: |
|
233 | committing files: | |
243 | e |
|
234 | e | |
244 | committing manifest |
|
235 | committing manifest | |
245 | committing changelog |
|
236 | committing changelog | |
246 | updating the branch cache |
|
237 | updating the branch cache | |
247 | $ HGEDITOR=cat hg graft 4 3 --log --debug |
|
238 | $ HGEDITOR=cat hg graft 4 3 --log --debug | |
248 | scanning for duplicate grafts |
|
239 | scanning for duplicate grafts | |
249 | grafting 4:9c233e8e184d "4" |
|
240 | grafting 4:9c233e8e184d "4" | |
250 | all copies found (* = to merge, ! = divergent, % = renamed and deleted): |
|
241 | all copies found (* = to merge, ! = divergent, % = renamed and deleted): | |
251 | src: 'c' -> dst: 'b' |
|
242 | src: 'c' -> dst: 'b' | |
252 | checking for directory renames |
|
243 | checking for directory renames | |
253 | resolving manifests |
|
244 | resolving manifests | |
254 | branchmerge: True, force: True, partial: False |
|
245 | branchmerge: True, force: True, partial: False | |
255 | ancestor: 4c60f11aa304, local: 1905859650ec+, remote: 9c233e8e184d |
|
246 | ancestor: 4c60f11aa304, local: 1905859650ec+, remote: 9c233e8e184d | |
256 | preserving e for resolve of e |
|
247 | preserving e for resolve of e | |
257 | d: remote is newer -> g |
|
248 | d: remote is newer -> g | |
258 | getting d |
|
249 | getting d | |
259 | e: versions differ -> m (premerge) |
|
250 | e: versions differ -> m (premerge) | |
260 | picked tool ':merge' for e (binary False symlink False changedelete False) |
|
251 | picked tool ':merge' for e (binary False symlink False changedelete False) | |
261 | merging e |
|
252 | merging e | |
262 | my e@1905859650ec+ other e@9c233e8e184d ancestor e@4c60f11aa304 |
|
253 | my e@1905859650ec+ other e@9c233e8e184d ancestor e@4c60f11aa304 | |
263 | e: versions differ -> m (merge) |
|
254 | e: versions differ -> m (merge) | |
264 | picked tool ':merge' for e (binary False symlink False changedelete False) |
|
255 | picked tool ':merge' for e (binary False symlink False changedelete False) | |
265 | my e@1905859650ec+ other e@9c233e8e184d ancestor e@4c60f11aa304 |
|
256 | my e@1905859650ec+ other e@9c233e8e184d ancestor e@4c60f11aa304 | |
266 | warning: conflicts while merging e! (edit, then use 'hg resolve --mark') |
|
257 | warning: conflicts while merging e! (edit, then use 'hg resolve --mark') | |
267 | abort: unresolved conflicts, can't continue |
|
258 | abort: unresolved conflicts, can't continue | |
268 | (use 'hg resolve' and 'hg graft --continue') |
|
259 | (use 'hg resolve' and 'hg graft --continue') | |
269 | [255] |
|
260 | [255] | |
270 |
|
261 | |||
271 | Summary should mention graft: |
|
262 | Summary should mention graft: | |
272 |
|
263 | |||
273 | $ hg summary |grep graft |
|
264 | $ hg summary |grep graft | |
274 | commit: 2 modified, 2 unknown, 1 unresolved (graft in progress) |
|
265 | commit: 2 modified, 2 unknown, 1 unresolved (graft in progress) | |
275 |
|
266 | |||
276 | Using status to get more context |
|
267 | Using status to get more context | |
277 |
|
268 | |||
278 | $ hg status --verbose |
|
269 | $ hg status --verbose | |
279 | M d |
|
270 | M d | |
280 | M e |
|
271 | M e | |
281 | ? a.orig |
|
272 | ? a.orig | |
282 | ? e.orig |
|
273 | ? e.orig | |
283 | # The repository is in an unfinished *graft* state. |
|
274 | # The repository is in an unfinished *graft* state. | |
284 |
|
275 | |||
285 | # Unresolved merge conflicts: |
|
276 | # Unresolved merge conflicts: | |
286 | # |
|
277 | # | |
287 | # e |
|
278 | # e | |
288 | # |
|
279 | # | |
289 | # To mark files as resolved: hg resolve --mark FILE |
|
280 | # To mark files as resolved: hg resolve --mark FILE | |
290 |
|
281 | |||
291 | # To continue: hg graft --continue |
|
282 | # To continue: hg graft --continue | |
292 | # To abort: hg graft --abort |
|
283 | # To abort: hg graft --abort | |
293 | # To stop: hg graft --stop |
|
284 | # To stop: hg graft --stop | |
294 |
|
285 | |||
295 |
|
286 | |||
296 | Commit while interrupted should fail: |
|
287 | Commit while interrupted should fail: | |
297 |
|
288 | |||
298 | $ hg ci -m 'commit interrupted graft' |
|
289 | $ hg ci -m 'commit interrupted graft' | |
299 | abort: graft in progress |
|
290 | abort: graft in progress | |
300 | (use 'hg graft --continue' or 'hg graft --stop' to stop) |
|
291 | (use 'hg graft --continue' or 'hg graft --stop' to stop) | |
301 | [255] |
|
292 | [255] | |
302 |
|
293 | |||
303 | Abort the graft and try committing: |
|
294 | Abort the graft and try committing: | |
304 |
|
295 | |||
305 | $ hg up -C . |
|
296 | $ hg up -C . | |
306 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
297 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
307 | $ echo c >> e |
|
298 | $ echo c >> e | |
308 | $ hg ci -mtest |
|
299 | $ hg ci -mtest | |
309 |
|
300 | |||
310 | $ hg strip . --config extensions.strip= |
|
301 | $ hg strip . --config extensions.strip= | |
311 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
302 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
312 | saved backup bundle to $TESTTMP/a/.hg/strip-backup/*-backup.hg (glob) |
|
303 | saved backup bundle to $TESTTMP/a/.hg/strip-backup/*-backup.hg (glob) | |
313 |
|
304 | |||
314 | Graft again: |
|
305 | Graft again: | |
315 |
|
306 | |||
316 | $ hg graft 1 5 4 3 'merge()' 2 |
|
307 | $ hg graft 1 5 4 3 'merge()' 2 | |
317 | skipping ungraftable merge revision 6 |
|
308 | skipping ungraftable merge revision 6 | |
318 | skipping revision 2:5c095ad7e90f (already grafted to 7:ef0ef43d49e7) |
|
309 | skipping revision 2:5c095ad7e90f (already grafted to 7:ef0ef43d49e7) | |
319 | skipping revision 1:5d205f8b35b6 (already grafted to 8:6b9e5368ca4e) |
|
310 | skipping revision 1:5d205f8b35b6 (already grafted to 8:6b9e5368ca4e) | |
320 | skipping revision 5:97f8bfe72746 (already grafted to 9:1905859650ec) |
|
311 | skipping revision 5:97f8bfe72746 (already grafted to 9:1905859650ec) | |
321 | grafting 4:9c233e8e184d "4" |
|
312 | grafting 4:9c233e8e184d "4" | |
322 | merging e |
|
313 | merging e | |
323 | warning: conflicts while merging e! (edit, then use 'hg resolve --mark') |
|
314 | warning: conflicts while merging e! (edit, then use 'hg resolve --mark') | |
324 | abort: unresolved conflicts, can't continue |
|
315 | abort: unresolved conflicts, can't continue | |
325 | (use 'hg resolve' and 'hg graft --continue') |
|
316 | (use 'hg resolve' and 'hg graft --continue') | |
326 | [255] |
|
317 | [255] | |
327 |
|
318 | |||
328 | Continue without resolve should fail: |
|
319 | Continue without resolve should fail: | |
329 |
|
320 | |||
330 | $ hg graft -c |
|
321 | $ hg graft -c | |
331 | grafting 4:9c233e8e184d "4" |
|
322 | grafting 4:9c233e8e184d "4" | |
332 | abort: unresolved merge conflicts (see 'hg help resolve') |
|
323 | abort: unresolved merge conflicts (see 'hg help resolve') | |
333 | [255] |
|
324 | [255] | |
334 |
|
325 | |||
335 | Fix up: |
|
326 | Fix up: | |
336 |
|
327 | |||
337 | $ echo b > e |
|
328 | $ echo b > e | |
338 | $ hg resolve -m e |
|
329 | $ hg resolve -m e | |
339 | (no more unresolved files) |
|
330 | (no more unresolved files) | |
340 | continue: hg graft --continue |
|
331 | continue: hg graft --continue | |
341 |
|
332 | |||
342 | Continue with a revision should fail: |
|
333 | Continue with a revision should fail: | |
343 |
|
334 | |||
344 | $ hg graft -c 6 |
|
335 | $ hg graft -c 6 | |
345 | abort: can't specify --continue and revisions |
|
336 | abort: can't specify --continue and revisions | |
346 | [255] |
|
337 | [255] | |
347 |
|
338 | |||
348 | $ hg graft -c -r 6 |
|
339 | $ hg graft -c -r 6 | |
349 | abort: can't specify --continue and revisions |
|
340 | abort: can't specify --continue and revisions | |
350 | [255] |
|
341 | [255] | |
351 |
|
342 | |||
352 | Continue for real, clobber usernames |
|
343 | Continue for real, clobber usernames | |
353 |
|
344 | |||
354 | $ hg graft -c -U |
|
345 | $ hg graft -c -U | |
355 | grafting 4:9c233e8e184d "4" |
|
346 | grafting 4:9c233e8e184d "4" | |
356 | grafting 3:4c60f11aa304 "3" |
|
347 | grafting 3:4c60f11aa304 "3" | |
357 |
|
348 | |||
358 | Compare with original: |
|
349 | Compare with original: | |
359 |
|
350 | |||
360 | $ hg diff -r 6 |
|
351 | $ hg diff -r 6 | |
361 | $ hg status --rev 0:. -C |
|
352 | $ hg status --rev 0:. -C | |
362 | M d |
|
353 | M d | |
363 | M e |
|
354 | M e | |
364 | A b |
|
355 | A b | |
365 | a |
|
356 | a | |
366 | A c |
|
357 | A c | |
367 | a |
|
358 | a | |
368 | R a |
|
359 | R a | |
369 |
|
360 | |||
370 | View graph: |
|
361 | View graph: | |
371 |
|
362 | |||
372 | $ hg log -G --template '{author}@{rev}.{phase}: {desc}\n' |
|
363 | $ hg log -G --template '{author}@{rev}.{phase}: {desc}\n' | |
373 | @ test@11.draft: 3 |
|
364 | @ test@11.draft: 3 | |
374 | | |
|
365 | | | |
375 | o test@10.draft: 4 |
|
366 | o test@10.draft: 4 | |
376 | | |
|
367 | | | |
377 | o test@9.draft: 5 |
|
368 | o test@9.draft: 5 | |
378 | | |
|
369 | | | |
379 | o bar@8.draft: 1 |
|
370 | o bar@8.draft: 1 | |
380 | | |
|
371 | | | |
381 | o foo@7.draft: 2 |
|
372 | o foo@7.draft: 2 | |
382 | | |
|
373 | | | |
383 | | o test@6.secret: 6 |
|
374 | | o test@6.secret: 6 | |
384 | | |\ |
|
375 | | |\ | |
385 | | | o test@5.draft: 5 |
|
376 | | | o test@5.draft: 5 | |
386 | | | | |
|
377 | | | | | |
387 | | o | test@4.draft: 4 |
|
378 | | o | test@4.draft: 4 | |
388 | | |/ |
|
379 | | |/ | |
389 | | o baz@3.public: 3 |
|
380 | | o baz@3.public: 3 | |
390 | | | |
|
381 | | | | |
391 | | o test@2.public: 2 |
|
382 | | o test@2.public: 2 | |
392 | | | |
|
383 | | | | |
393 | | o bar@1.public: 1 |
|
384 | | o bar@1.public: 1 | |
394 | |/ |
|
385 | |/ | |
395 | o test@0.public: 0 |
|
386 | o test@0.public: 0 | |
396 |
|
387 | |||
397 | Graft again onto another branch should preserve the original source |
|
388 | Graft again onto another branch should preserve the original source | |
398 | $ hg up -q 0 |
|
389 | $ hg up -q 0 | |
399 | $ echo 'g'>g |
|
390 | $ echo 'g'>g | |
400 | $ hg add g |
|
391 | $ hg add g | |
401 | $ hg ci -m 7 |
|
392 | $ hg ci -m 7 | |
402 | created new head |
|
393 | created new head | |
403 | $ hg graft 7 |
|
394 | $ hg graft 7 | |
404 | grafting 7:ef0ef43d49e7 "2" |
|
395 | grafting 7:ef0ef43d49e7 "2" | |
405 |
|
396 | |||
406 | $ hg log -r 7 --template '{rev}:{node}\n' |
|
397 | $ hg log -r 7 --template '{rev}:{node}\n' | |
407 | 7:ef0ef43d49e79e81ddafdc7997401ba0041efc82 |
|
398 | 7:ef0ef43d49e79e81ddafdc7997401ba0041efc82 | |
408 | $ hg log -r 2 --template '{rev}:{node}\n' |
|
399 | $ hg log -r 2 --template '{rev}:{node}\n' | |
409 | 2:5c095ad7e90f871700f02dd1fa5012cb4498a2d4 |
|
400 | 2:5c095ad7e90f871700f02dd1fa5012cb4498a2d4 | |
410 |
|
401 | |||
411 | $ hg log --debug -r tip |
|
402 | $ hg log --debug -r tip | |
412 | changeset: 13:7a4785234d87ec1aa420ed6b11afe40fa73e12a9 |
|
403 | changeset: 13:7a4785234d87ec1aa420ed6b11afe40fa73e12a9 | |
413 | tag: tip |
|
404 | tag: tip | |
414 | phase: draft |
|
405 | phase: draft | |
415 | parent: 12:b592ea63bb0c19a6c5c44685ee29a2284f9f1b8f |
|
406 | parent: 12:b592ea63bb0c19a6c5c44685ee29a2284f9f1b8f | |
416 | parent: -1:0000000000000000000000000000000000000000 |
|
407 | parent: -1:0000000000000000000000000000000000000000 | |
417 | manifest: 13:dc313617b8c32457c0d589e0dbbedfe71f3cd637 |
|
408 | manifest: 13:dc313617b8c32457c0d589e0dbbedfe71f3cd637 | |
418 | user: foo |
|
409 | user: foo | |
419 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
410 | date: Thu Jan 01 00:00:00 1970 +0000 | |
420 | files+: b |
|
411 | files+: b | |
421 | files-: a |
|
412 | files-: a | |
422 | extra: branch=default |
|
413 | extra: branch=default | |
423 | extra: intermediate-source=ef0ef43d49e79e81ddafdc7997401ba0041efc82 |
|
414 | extra: intermediate-source=ef0ef43d49e79e81ddafdc7997401ba0041efc82 | |
424 | extra: source=5c095ad7e90f871700f02dd1fa5012cb4498a2d4 |
|
415 | extra: source=5c095ad7e90f871700f02dd1fa5012cb4498a2d4 | |
425 | description: |
|
416 | description: | |
426 | 2 |
|
417 | 2 | |
427 |
|
418 | |||
428 |
|
419 | |||
429 | Disallow grafting an already grafted cset onto its original branch |
|
420 | Disallow grafting an already grafted cset onto its original branch | |
430 | $ hg up -q 6 |
|
421 | $ hg up -q 6 | |
431 | $ hg graft 7 |
|
422 | $ hg graft 7 | |
432 | skipping already grafted revision 7:ef0ef43d49e7 (was grafted from 2:5c095ad7e90f) |
|
423 | skipping already grafted revision 7:ef0ef43d49e7 (was grafted from 2:5c095ad7e90f) | |
433 | [255] |
|
424 | [255] | |
434 |
|
425 | |||
435 | $ hg pdiff --config extensions.extdiff= --patch -r 2 -r 13 |
|
426 | $ hg pdiff --config extensions.extdiff= --patch -r 2 -r 13 | |
436 | --- */hg-5c095ad7e90f.patch * (glob) |
|
427 | --- */hg-5c095ad7e90f.patch * (glob) | |
437 | +++ */hg-7a4785234d87.patch * (glob) |
|
428 | +++ */hg-7a4785234d87.patch * (glob) | |
438 | @@ -1,18 +1,18 @@ |
|
429 | @@ -1,18 +1,18 @@ | |
439 | # HG changeset patch |
|
430 | # HG changeset patch | |
440 | -# User test |
|
431 | -# User test | |
441 | +# User foo |
|
432 | +# User foo | |
442 | # Date 0 0 |
|
433 | # Date 0 0 | |
443 | # Thu Jan 01 00:00:00 1970 +0000 |
|
434 | # Thu Jan 01 00:00:00 1970 +0000 | |
444 | -# Node ID 5c095ad7e90f871700f02dd1fa5012cb4498a2d4 |
|
435 | -# Node ID 5c095ad7e90f871700f02dd1fa5012cb4498a2d4 | |
445 | -# Parent 5d205f8b35b66bc36375c9534ffd3237730e8f04 |
|
436 | -# Parent 5d205f8b35b66bc36375c9534ffd3237730e8f04 | |
446 | +# Node ID 7a4785234d87ec1aa420ed6b11afe40fa73e12a9 |
|
437 | +# Node ID 7a4785234d87ec1aa420ed6b11afe40fa73e12a9 | |
447 | +# Parent b592ea63bb0c19a6c5c44685ee29a2284f9f1b8f |
|
438 | +# Parent b592ea63bb0c19a6c5c44685ee29a2284f9f1b8f | |
448 | 2 |
|
439 | 2 | |
449 |
|
440 | |||
450 | -diff -r 5d205f8b35b6 -r 5c095ad7e90f a |
|
441 | -diff -r 5d205f8b35b6 -r 5c095ad7e90f a | |
451 | +diff -r b592ea63bb0c -r 7a4785234d87 a |
|
442 | +diff -r b592ea63bb0c -r 7a4785234d87 a | |
452 | --- a/a Thu Jan 01 00:00:00 1970 +0000 |
|
443 | --- a/a Thu Jan 01 00:00:00 1970 +0000 | |
453 | +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
444 | +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
454 | @@ -1,1 +0,0 @@ |
|
445 | @@ -1,1 +0,0 @@ | |
455 | --b |
|
446 | --b | |
456 | -diff -r 5d205f8b35b6 -r 5c095ad7e90f b |
|
447 | -diff -r 5d205f8b35b6 -r 5c095ad7e90f b | |
457 | +-a |
|
448 | +-a | |
458 | +diff -r b592ea63bb0c -r 7a4785234d87 b |
|
449 | +diff -r b592ea63bb0c -r 7a4785234d87 b | |
459 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
450 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
460 | +++ b/b Thu Jan 01 00:00:00 1970 +0000 |
|
451 | +++ b/b Thu Jan 01 00:00:00 1970 +0000 | |
461 | @@ -0,0 +1,1 @@ |
|
452 | @@ -0,0 +1,1 @@ | |
462 | -+b |
|
453 | -+b | |
463 | ++a |
|
454 | ++a | |
464 | [1] |
|
455 | [1] | |
465 |
|
456 | |||
466 | $ hg pdiff --config extensions.extdiff= --patch -r 2 -r 13 -X . |
|
457 | $ hg pdiff --config extensions.extdiff= --patch -r 2 -r 13 -X . | |
467 | --- */hg-5c095ad7e90f.patch * (glob) |
|
458 | --- */hg-5c095ad7e90f.patch * (glob) | |
468 | +++ */hg-7a4785234d87.patch * (glob) |
|
459 | +++ */hg-7a4785234d87.patch * (glob) | |
469 | @@ -1,8 +1,8 @@ |
|
460 | @@ -1,8 +1,8 @@ | |
470 | # HG changeset patch |
|
461 | # HG changeset patch | |
471 | -# User test |
|
462 | -# User test | |
472 | +# User foo |
|
463 | +# User foo | |
473 | # Date 0 0 |
|
464 | # Date 0 0 | |
474 | # Thu Jan 01 00:00:00 1970 +0000 |
|
465 | # Thu Jan 01 00:00:00 1970 +0000 | |
475 | -# Node ID 5c095ad7e90f871700f02dd1fa5012cb4498a2d4 |
|
466 | -# Node ID 5c095ad7e90f871700f02dd1fa5012cb4498a2d4 | |
476 | -# Parent 5d205f8b35b66bc36375c9534ffd3237730e8f04 |
|
467 | -# Parent 5d205f8b35b66bc36375c9534ffd3237730e8f04 | |
477 | +# Node ID 7a4785234d87ec1aa420ed6b11afe40fa73e12a9 |
|
468 | +# Node ID 7a4785234d87ec1aa420ed6b11afe40fa73e12a9 | |
478 | +# Parent b592ea63bb0c19a6c5c44685ee29a2284f9f1b8f |
|
469 | +# Parent b592ea63bb0c19a6c5c44685ee29a2284f9f1b8f | |
479 | 2 |
|
470 | 2 | |
480 |
|
471 | |||
481 | [1] |
|
472 | [1] | |
482 |
|
473 | |||
483 | Disallow grafting already grafted csets with the same origin onto each other |
|
474 | Disallow grafting already grafted csets with the same origin onto each other | |
484 | $ hg up -q 13 |
|
475 | $ hg up -q 13 | |
485 | $ hg graft 2 |
|
476 | $ hg graft 2 | |
486 | skipping revision 2:5c095ad7e90f (already grafted to 13:7a4785234d87) |
|
477 | skipping revision 2:5c095ad7e90f (already grafted to 13:7a4785234d87) | |
487 | [255] |
|
478 | [255] | |
488 | $ hg graft 7 |
|
479 | $ hg graft 7 | |
489 | skipping already grafted revision 7:ef0ef43d49e7 (13:7a4785234d87 also has origin 2:5c095ad7e90f) |
|
480 | skipping already grafted revision 7:ef0ef43d49e7 (13:7a4785234d87 also has origin 2:5c095ad7e90f) | |
490 | [255] |
|
481 | [255] | |
491 |
|
482 | |||
492 | $ hg up -q 7 |
|
483 | $ hg up -q 7 | |
493 | $ hg graft 2 |
|
484 | $ hg graft 2 | |
494 | skipping revision 2:5c095ad7e90f (already grafted to 7:ef0ef43d49e7) |
|
485 | skipping revision 2:5c095ad7e90f (already grafted to 7:ef0ef43d49e7) | |
495 | [255] |
|
486 | [255] | |
496 | $ hg graft tip |
|
487 | $ hg graft tip | |
497 | skipping already grafted revision 13:7a4785234d87 (7:ef0ef43d49e7 also has origin 2:5c095ad7e90f) |
|
488 | skipping already grafted revision 13:7a4785234d87 (7:ef0ef43d49e7 also has origin 2:5c095ad7e90f) | |
498 | [255] |
|
489 | [255] | |
499 |
|
490 | |||
500 | Graft with --log |
|
491 | Graft with --log | |
501 |
|
492 | |||
502 | $ hg up -Cq 1 |
|
493 | $ hg up -Cq 1 | |
503 | $ hg graft 3 --log -u foo |
|
494 | $ hg graft 3 --log -u foo | |
504 | grafting 3:4c60f11aa304 "3" |
|
495 | grafting 3:4c60f11aa304 "3" | |
505 | warning: can't find ancestor for 'c' copied from 'b'! |
|
496 | warning: can't find ancestor for 'c' copied from 'b'! | |
506 | $ hg log --template '{rev}:{node|short} {parents} {desc}\n' -r tip |
|
497 | $ hg log --template '{rev}:{node|short} {parents} {desc}\n' -r tip | |
507 | 14:0c921c65ef1e 1:5d205f8b35b6 3 |
|
498 | 14:0c921c65ef1e 1:5d205f8b35b6 3 | |
508 | (grafted from 4c60f11aa304a54ae1c199feb94e7fc771e51ed8) |
|
499 | (grafted from 4c60f11aa304a54ae1c199feb94e7fc771e51ed8) | |
509 |
|
500 | |||
510 | Resolve conflicted graft |
|
501 | Resolve conflicted graft | |
511 | $ hg up -q 0 |
|
502 | $ hg up -q 0 | |
512 | $ echo b > a |
|
503 | $ echo b > a | |
513 | $ hg ci -m 8 |
|
504 | $ hg ci -m 8 | |
514 | created new head |
|
505 | created new head | |
515 | $ echo c > a |
|
506 | $ echo c > a | |
516 | $ hg ci -m 9 |
|
507 | $ hg ci -m 9 | |
517 | $ hg graft 1 --tool internal:fail |
|
508 | $ hg graft 1 --tool internal:fail | |
518 | grafting 1:5d205f8b35b6 "1" |
|
509 | grafting 1:5d205f8b35b6 "1" | |
519 | abort: unresolved conflicts, can't continue |
|
510 | abort: unresolved conflicts, can't continue | |
520 | (use 'hg resolve' and 'hg graft --continue') |
|
511 | (use 'hg resolve' and 'hg graft --continue') | |
521 | [255] |
|
512 | [255] | |
522 | $ hg resolve --all |
|
513 | $ hg resolve --all | |
523 | merging a |
|
514 | merging a | |
524 | warning: conflicts while merging a! (edit, then use 'hg resolve --mark') |
|
515 | warning: conflicts while merging a! (edit, then use 'hg resolve --mark') | |
525 | [1] |
|
516 | [1] | |
526 | $ cat a |
|
517 | $ cat a | |
527 | <<<<<<< local: aaa4406d4f0a - test: 9 |
|
518 | <<<<<<< local: aaa4406d4f0a - test: 9 | |
528 | c |
|
519 | c | |
529 | ======= |
|
520 | ======= | |
530 | b |
|
521 | b | |
531 | >>>>>>> graft: 5d205f8b35b6 - bar: 1 |
|
522 | >>>>>>> graft: 5d205f8b35b6 - bar: 1 | |
532 | $ echo b > a |
|
523 | $ echo b > a | |
533 | $ hg resolve -m a |
|
524 | $ hg resolve -m a | |
534 | (no more unresolved files) |
|
525 | (no more unresolved files) | |
535 | continue: hg graft --continue |
|
526 | continue: hg graft --continue | |
536 | $ hg graft -c |
|
527 | $ hg graft -c | |
537 | grafting 1:5d205f8b35b6 "1" |
|
528 | grafting 1:5d205f8b35b6 "1" | |
538 | $ hg export tip --git |
|
529 | $ hg export tip --git | |
539 | # HG changeset patch |
|
530 | # HG changeset patch | |
540 | # User bar |
|
531 | # User bar | |
541 | # Date 0 0 |
|
532 | # Date 0 0 | |
542 | # Thu Jan 01 00:00:00 1970 +0000 |
|
533 | # Thu Jan 01 00:00:00 1970 +0000 | |
543 | # Node ID f67661df0c4804d301f064f332b57e7d5ddaf2be |
|
534 | # Node ID f67661df0c4804d301f064f332b57e7d5ddaf2be | |
544 | # Parent aaa4406d4f0ae9befd6e58c82ec63706460cbca6 |
|
535 | # Parent aaa4406d4f0ae9befd6e58c82ec63706460cbca6 | |
545 | 1 |
|
536 | 1 | |
546 |
|
537 | |||
547 | diff --git a/a b/a |
|
538 | diff --git a/a b/a | |
548 | --- a/a |
|
539 | --- a/a | |
549 | +++ b/a |
|
540 | +++ b/a | |
550 | @@ -1,1 +1,1 @@ |
|
541 | @@ -1,1 +1,1 @@ | |
551 | -c |
|
542 | -c | |
552 | +b |
|
543 | +b | |
553 |
|
544 | |||
554 | Resolve conflicted graft with rename |
|
545 | Resolve conflicted graft with rename | |
555 | $ echo c > a |
|
546 | $ echo c > a | |
556 | $ hg ci -m 10 |
|
547 | $ hg ci -m 10 | |
557 | $ hg graft 2 --tool internal:fail |
|
548 | $ hg graft 2 --tool internal:fail | |
558 | grafting 2:5c095ad7e90f "2" |
|
549 | grafting 2:5c095ad7e90f "2" | |
559 | abort: unresolved conflicts, can't continue |
|
550 | abort: unresolved conflicts, can't continue | |
560 | (use 'hg resolve' and 'hg graft --continue') |
|
551 | (use 'hg resolve' and 'hg graft --continue') | |
561 | [255] |
|
552 | [255] | |
562 | $ hg resolve --all |
|
553 | $ hg resolve --all | |
563 | merging a and b to b |
|
554 | merging a and b to b | |
564 | (no more unresolved files) |
|
555 | (no more unresolved files) | |
565 | continue: hg graft --continue |
|
556 | continue: hg graft --continue | |
566 | $ hg graft -c |
|
557 | $ hg graft -c | |
567 | grafting 2:5c095ad7e90f "2" |
|
558 | grafting 2:5c095ad7e90f "2" | |
568 | $ hg export tip --git |
|
559 | $ hg export tip --git | |
569 | # HG changeset patch |
|
560 | # HG changeset patch | |
570 | # User test |
|
561 | # User test | |
571 | # Date 0 0 |
|
562 | # Date 0 0 | |
572 | # Thu Jan 01 00:00:00 1970 +0000 |
|
563 | # Thu Jan 01 00:00:00 1970 +0000 | |
573 | # Node ID 9627f653b421c61fc1ea4c4e366745070fa3d2bc |
|
564 | # Node ID 9627f653b421c61fc1ea4c4e366745070fa3d2bc | |
574 | # Parent ee295f490a40b97f3d18dd4c4f1c8936c233b612 |
|
565 | # Parent ee295f490a40b97f3d18dd4c4f1c8936c233b612 | |
575 | 2 |
|
566 | 2 | |
576 |
|
567 | |||
577 | diff --git a/a b/b |
|
568 | diff --git a/a b/b | |
578 | rename from a |
|
569 | rename from a | |
579 | rename to b |
|
570 | rename to b | |
580 |
|
571 | |||
581 | Test simple origin(), with and without args |
|
572 | Test simple origin(), with and without args | |
582 | $ hg log -r 'origin()' |
|
573 | $ hg log -r 'origin()' | |
583 | changeset: 1:5d205f8b35b6 |
|
574 | changeset: 1:5d205f8b35b6 | |
584 | user: bar |
|
575 | user: bar | |
585 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
576 | date: Thu Jan 01 00:00:00 1970 +0000 | |
586 | summary: 1 |
|
577 | summary: 1 | |
587 |
|
578 | |||
588 | changeset: 2:5c095ad7e90f |
|
579 | changeset: 2:5c095ad7e90f | |
589 | user: test |
|
580 | user: test | |
590 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
581 | date: Thu Jan 01 00:00:00 1970 +0000 | |
591 | summary: 2 |
|
582 | summary: 2 | |
592 |
|
583 | |||
593 | changeset: 3:4c60f11aa304 |
|
584 | changeset: 3:4c60f11aa304 | |
594 | user: baz |
|
585 | user: baz | |
595 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
586 | date: Thu Jan 01 00:00:00 1970 +0000 | |
596 | summary: 3 |
|
587 | summary: 3 | |
597 |
|
588 | |||
598 | changeset: 4:9c233e8e184d |
|
589 | changeset: 4:9c233e8e184d | |
599 | user: test |
|
590 | user: test | |
600 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
591 | date: Thu Jan 01 00:00:00 1970 +0000 | |
601 | summary: 4 |
|
592 | summary: 4 | |
602 |
|
593 | |||
603 | changeset: 5:97f8bfe72746 |
|
594 | changeset: 5:97f8bfe72746 | |
604 | branch: stable |
|
595 | branch: stable | |
605 | parent: 3:4c60f11aa304 |
|
596 | parent: 3:4c60f11aa304 | |
606 | user: test |
|
597 | user: test | |
607 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
598 | date: Thu Jan 01 00:00:00 1970 +0000 | |
608 | summary: 5 |
|
599 | summary: 5 | |
609 |
|
600 | |||
610 | $ hg log -r 'origin(7)' |
|
601 | $ hg log -r 'origin(7)' | |
611 | changeset: 2:5c095ad7e90f |
|
602 | changeset: 2:5c095ad7e90f | |
612 | user: test |
|
603 | user: test | |
613 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
604 | date: Thu Jan 01 00:00:00 1970 +0000 | |
614 | summary: 2 |
|
605 | summary: 2 | |
615 |
|
606 | |||
616 | Now transplant a graft to test following through copies |
|
607 | Now transplant a graft to test following through copies | |
617 | $ hg up -q 0 |
|
608 | $ hg up -q 0 | |
618 | $ hg branch -q dev |
|
609 | $ hg branch -q dev | |
619 | $ hg ci -qm "dev branch" |
|
610 | $ hg ci -qm "dev branch" | |
620 | $ hg --config extensions.transplant= transplant -q 7 |
|
611 | $ hg --config extensions.transplant= transplant -q 7 | |
621 | $ hg log -r 'origin(.)' |
|
612 | $ hg log -r 'origin(.)' | |
622 | changeset: 2:5c095ad7e90f |
|
613 | changeset: 2:5c095ad7e90f | |
623 | user: test |
|
614 | user: test | |
624 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
615 | date: Thu Jan 01 00:00:00 1970 +0000 | |
625 | summary: 2 |
|
616 | summary: 2 | |
626 |
|
617 | |||
627 | Test that the graft and transplant markers in extra are converted, allowing |
|
618 | Test that the graft and transplant markers in extra are converted, allowing | |
628 | origin() to still work. Note that these recheck the immediately preceeding two |
|
619 | origin() to still work. Note that these recheck the immediately preceeding two | |
629 | tests. |
|
620 | tests. | |
630 | $ hg --quiet --config extensions.convert= --config convert.hg.saverev=True convert . ../converted |
|
621 | $ hg --quiet --config extensions.convert= --config convert.hg.saverev=True convert . ../converted | |
631 |
|
622 | |||
632 | The graft case |
|
623 | The graft case | |
633 | $ hg -R ../converted log -r 7 --template "{rev}: {node}\n{join(extras, '\n')}\n" |
|
624 | $ hg -R ../converted log -r 7 --template "{rev}: {node}\n{join(extras, '\n')}\n" | |
634 | 7: 7ae846e9111fc8f57745634250c7b9ac0a60689b |
|
625 | 7: 7ae846e9111fc8f57745634250c7b9ac0a60689b | |
635 | branch=default |
|
626 | branch=default | |
636 | convert_revision=ef0ef43d49e79e81ddafdc7997401ba0041efc82 |
|
627 | convert_revision=ef0ef43d49e79e81ddafdc7997401ba0041efc82 | |
637 | source=e0213322b2c1a5d5d236c74e79666441bee67a7d |
|
628 | source=e0213322b2c1a5d5d236c74e79666441bee67a7d | |
638 | $ hg -R ../converted log -r 'origin(7)' |
|
629 | $ hg -R ../converted log -r 'origin(7)' | |
639 | changeset: 2:e0213322b2c1 |
|
630 | changeset: 2:e0213322b2c1 | |
640 | user: test |
|
631 | user: test | |
641 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
632 | date: Thu Jan 01 00:00:00 1970 +0000 | |
642 | summary: 2 |
|
633 | summary: 2 | |
643 |
|
634 | |||
644 | Test that template correctly expands more than one 'extra' (issue4362), and that |
|
635 | Test that template correctly expands more than one 'extra' (issue4362), and that | |
645 | 'intermediate-source' is converted. |
|
636 | 'intermediate-source' is converted. | |
646 | $ hg -R ../converted log -r 13 --template "{extras % ' Extra: {extra}\n'}" |
|
637 | $ hg -R ../converted log -r 13 --template "{extras % ' Extra: {extra}\n'}" | |
647 | Extra: branch=default |
|
638 | Extra: branch=default | |
648 | Extra: convert_revision=7a4785234d87ec1aa420ed6b11afe40fa73e12a9 |
|
639 | Extra: convert_revision=7a4785234d87ec1aa420ed6b11afe40fa73e12a9 | |
649 | Extra: intermediate-source=7ae846e9111fc8f57745634250c7b9ac0a60689b |
|
640 | Extra: intermediate-source=7ae846e9111fc8f57745634250c7b9ac0a60689b | |
650 | Extra: source=e0213322b2c1a5d5d236c74e79666441bee67a7d |
|
641 | Extra: source=e0213322b2c1a5d5d236c74e79666441bee67a7d | |
651 |
|
642 | |||
652 | The transplant case |
|
643 | The transplant case | |
653 | $ hg -R ../converted log -r tip --template "{rev}: {node}\n{join(extras, '\n')}\n" |
|
644 | $ hg -R ../converted log -r tip --template "{rev}: {node}\n{join(extras, '\n')}\n" | |
654 | 21: fbb6c5cc81002f2b4b49c9d731404688bcae5ade |
|
645 | 21: fbb6c5cc81002f2b4b49c9d731404688bcae5ade | |
655 | branch=dev |
|
646 | branch=dev | |
656 | convert_revision=7e61b508e709a11d28194a5359bc3532d910af21 |
|
647 | convert_revision=7e61b508e709a11d28194a5359bc3532d910af21 | |
657 | transplant_source=z\xe8F\xe9\x11\x1f\xc8\xf5wEcBP\xc7\xb9\xac\n`h\x9b |
|
648 | transplant_source=z\xe8F\xe9\x11\x1f\xc8\xf5wEcBP\xc7\xb9\xac\n`h\x9b | |
658 | $ hg -R ../converted log -r 'origin(tip)' |
|
649 | $ hg -R ../converted log -r 'origin(tip)' | |
659 | changeset: 2:e0213322b2c1 |
|
650 | changeset: 2:e0213322b2c1 | |
660 | user: test |
|
651 | user: test | |
661 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
652 | date: Thu Jan 01 00:00:00 1970 +0000 | |
662 | summary: 2 |
|
653 | summary: 2 | |
663 |
|
654 | |||
664 |
|
655 | |||
665 | Test simple destination |
|
656 | Test simple destination | |
666 | $ hg log -r 'destination()' |
|
657 | $ hg log -r 'destination()' | |
667 | changeset: 7:ef0ef43d49e7 |
|
658 | changeset: 7:ef0ef43d49e7 | |
668 | parent: 0:68795b066622 |
|
659 | parent: 0:68795b066622 | |
669 | user: foo |
|
660 | user: foo | |
670 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
661 | date: Thu Jan 01 00:00:00 1970 +0000 | |
671 | summary: 2 |
|
662 | summary: 2 | |
672 |
|
663 | |||
673 | changeset: 8:6b9e5368ca4e |
|
664 | changeset: 8:6b9e5368ca4e | |
674 | user: bar |
|
665 | user: bar | |
675 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
666 | date: Thu Jan 01 00:00:00 1970 +0000 | |
676 | summary: 1 |
|
667 | summary: 1 | |
677 |
|
668 | |||
678 | changeset: 9:1905859650ec |
|
669 | changeset: 9:1905859650ec | |
679 | user: test |
|
670 | user: test | |
680 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
671 | date: Thu Jan 01 00:00:00 1970 +0000 | |
681 | summary: 5 |
|
672 | summary: 5 | |
682 |
|
673 | |||
683 | changeset: 10:52dc0b4c6907 |
|
674 | changeset: 10:52dc0b4c6907 | |
684 | user: test |
|
675 | user: test | |
685 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
676 | date: Thu Jan 01 00:00:00 1970 +0000 | |
686 | summary: 4 |
|
677 | summary: 4 | |
687 |
|
678 | |||
688 | changeset: 11:882b35362a6b |
|
679 | changeset: 11:882b35362a6b | |
689 | user: test |
|
680 | user: test | |
690 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
681 | date: Thu Jan 01 00:00:00 1970 +0000 | |
691 | summary: 3 |
|
682 | summary: 3 | |
692 |
|
683 | |||
693 | changeset: 13:7a4785234d87 |
|
684 | changeset: 13:7a4785234d87 | |
694 | user: foo |
|
685 | user: foo | |
695 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
686 | date: Thu Jan 01 00:00:00 1970 +0000 | |
696 | summary: 2 |
|
687 | summary: 2 | |
697 |
|
688 | |||
698 | changeset: 14:0c921c65ef1e |
|
689 | changeset: 14:0c921c65ef1e | |
699 | parent: 1:5d205f8b35b6 |
|
690 | parent: 1:5d205f8b35b6 | |
700 | user: foo |
|
691 | user: foo | |
701 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
692 | date: Thu Jan 01 00:00:00 1970 +0000 | |
702 | summary: 3 |
|
693 | summary: 3 | |
703 |
|
694 | |||
704 | changeset: 17:f67661df0c48 |
|
695 | changeset: 17:f67661df0c48 | |
705 | user: bar |
|
696 | user: bar | |
706 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
697 | date: Thu Jan 01 00:00:00 1970 +0000 | |
707 | summary: 1 |
|
698 | summary: 1 | |
708 |
|
699 | |||
709 | changeset: 19:9627f653b421 |
|
700 | changeset: 19:9627f653b421 | |
710 | user: test |
|
701 | user: test | |
711 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
702 | date: Thu Jan 01 00:00:00 1970 +0000 | |
712 | summary: 2 |
|
703 | summary: 2 | |
713 |
|
704 | |||
714 | changeset: 21:7e61b508e709 |
|
705 | changeset: 21:7e61b508e709 | |
715 | branch: dev |
|
706 | branch: dev | |
716 | tag: tip |
|
707 | tag: tip | |
717 | user: foo |
|
708 | user: foo | |
718 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
709 | date: Thu Jan 01 00:00:00 1970 +0000 | |
719 | summary: 2 |
|
710 | summary: 2 | |
720 |
|
711 | |||
721 | $ hg log -r 'destination(2)' |
|
712 | $ hg log -r 'destination(2)' | |
722 | changeset: 7:ef0ef43d49e7 |
|
713 | changeset: 7:ef0ef43d49e7 | |
723 | parent: 0:68795b066622 |
|
714 | parent: 0:68795b066622 | |
724 | user: foo |
|
715 | user: foo | |
725 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
716 | date: Thu Jan 01 00:00:00 1970 +0000 | |
726 | summary: 2 |
|
717 | summary: 2 | |
727 |
|
718 | |||
728 | changeset: 13:7a4785234d87 |
|
719 | changeset: 13:7a4785234d87 | |
729 | user: foo |
|
720 | user: foo | |
730 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
721 | date: Thu Jan 01 00:00:00 1970 +0000 | |
731 | summary: 2 |
|
722 | summary: 2 | |
732 |
|
723 | |||
733 | changeset: 19:9627f653b421 |
|
724 | changeset: 19:9627f653b421 | |
734 | user: test |
|
725 | user: test | |
735 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
726 | date: Thu Jan 01 00:00:00 1970 +0000 | |
736 | summary: 2 |
|
727 | summary: 2 | |
737 |
|
728 | |||
738 | changeset: 21:7e61b508e709 |
|
729 | changeset: 21:7e61b508e709 | |
739 | branch: dev |
|
730 | branch: dev | |
740 | tag: tip |
|
731 | tag: tip | |
741 | user: foo |
|
732 | user: foo | |
742 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
733 | date: Thu Jan 01 00:00:00 1970 +0000 | |
743 | summary: 2 |
|
734 | summary: 2 | |
744 |
|
735 | |||
745 | Transplants of grafts can find a destination... |
|
736 | Transplants of grafts can find a destination... | |
746 | $ hg log -r 'destination(7)' |
|
737 | $ hg log -r 'destination(7)' | |
747 | changeset: 21:7e61b508e709 |
|
738 | changeset: 21:7e61b508e709 | |
748 | branch: dev |
|
739 | branch: dev | |
749 | tag: tip |
|
740 | tag: tip | |
750 | user: foo |
|
741 | user: foo | |
751 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
742 | date: Thu Jan 01 00:00:00 1970 +0000 | |
752 | summary: 2 |
|
743 | summary: 2 | |
753 |
|
744 | |||
754 | ... grafts of grafts unfortunately can't |
|
745 | ... grafts of grafts unfortunately can't | |
755 | $ hg graft -q 13 --debug |
|
746 | $ hg graft -q 13 --debug | |
756 | scanning for duplicate grafts |
|
747 | scanning for duplicate grafts | |
757 | grafting 13:7a4785234d87 "2" |
|
748 | grafting 13:7a4785234d87 "2" | |
758 | all copies found (* = to merge, ! = divergent, % = renamed and deleted): |
|
749 | all copies found (* = to merge, ! = divergent, % = renamed and deleted): | |
759 | src: 'a' -> dst: 'b' * |
|
750 | src: 'a' -> dst: 'b' * | |
760 | checking for directory renames |
|
751 | checking for directory renames | |
761 | resolving manifests |
|
752 | resolving manifests | |
762 | branchmerge: True, force: True, partial: False |
|
753 | branchmerge: True, force: True, partial: False | |
763 | ancestor: b592ea63bb0c, local: 7e61b508e709+, remote: 7a4785234d87 |
|
754 | ancestor: b592ea63bb0c, local: 7e61b508e709+, remote: 7a4785234d87 | |
764 | starting 4 threads for background file closing (?) |
|
755 | starting 4 threads for background file closing (?) | |
765 | committing files: |
|
756 | committing files: | |
766 | b |
|
757 | b | |
767 | warning: can't find ancestor for 'b' copied from 'a'! |
|
758 | warning: can't find ancestor for 'b' copied from 'a'! | |
768 | reusing manifest from p1 (listed files actually unchanged) |
|
759 | reusing manifest from p1 (listed files actually unchanged) | |
769 | committing changelog |
|
760 | committing changelog | |
770 | updating the branch cache |
|
761 | updating the branch cache | |
771 | $ hg log -r 'destination(13)' |
|
762 | $ hg log -r 'destination(13)' | |
772 | All copies of a cset |
|
763 | All copies of a cset | |
773 | $ hg log -r 'origin(13) or destination(origin(13))' |
|
764 | $ hg log -r 'origin(13) or destination(origin(13))' | |
774 | changeset: 2:5c095ad7e90f |
|
765 | changeset: 2:5c095ad7e90f | |
775 | user: test |
|
766 | user: test | |
776 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
767 | date: Thu Jan 01 00:00:00 1970 +0000 | |
777 | summary: 2 |
|
768 | summary: 2 | |
778 |
|
769 | |||
779 | changeset: 7:ef0ef43d49e7 |
|
770 | changeset: 7:ef0ef43d49e7 | |
780 | parent: 0:68795b066622 |
|
771 | parent: 0:68795b066622 | |
781 | user: foo |
|
772 | user: foo | |
782 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
773 | date: Thu Jan 01 00:00:00 1970 +0000 | |
783 | summary: 2 |
|
774 | summary: 2 | |
784 |
|
775 | |||
785 | changeset: 13:7a4785234d87 |
|
776 | changeset: 13:7a4785234d87 | |
786 | user: foo |
|
777 | user: foo | |
787 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
778 | date: Thu Jan 01 00:00:00 1970 +0000 | |
788 | summary: 2 |
|
779 | summary: 2 | |
789 |
|
780 | |||
790 | changeset: 19:9627f653b421 |
|
781 | changeset: 19:9627f653b421 | |
791 | user: test |
|
782 | user: test | |
792 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
783 | date: Thu Jan 01 00:00:00 1970 +0000 | |
793 | summary: 2 |
|
784 | summary: 2 | |
794 |
|
785 | |||
795 | changeset: 21:7e61b508e709 |
|
786 | changeset: 21:7e61b508e709 | |
796 | branch: dev |
|
787 | branch: dev | |
797 | user: foo |
|
788 | user: foo | |
798 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
789 | date: Thu Jan 01 00:00:00 1970 +0000 | |
799 | summary: 2 |
|
790 | summary: 2 | |
800 |
|
791 | |||
801 | changeset: 22:3a4e92d81b97 |
|
792 | changeset: 22:3a4e92d81b97 | |
802 | branch: dev |
|
793 | branch: dev | |
803 | tag: tip |
|
794 | tag: tip | |
804 | user: foo |
|
795 | user: foo | |
805 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
796 | date: Thu Jan 01 00:00:00 1970 +0000 | |
806 | summary: 2 |
|
797 | summary: 2 | |
807 |
|
798 | |||
808 |
|
799 | |||
809 | graft works on complex revset |
|
800 | graft works on complex revset | |
810 |
|
801 | |||
811 | $ hg graft 'origin(13) or destination(origin(13))' |
|
802 | $ hg graft 'origin(13) or destination(origin(13))' | |
812 | skipping ancestor revision 21:7e61b508e709 |
|
803 | skipping ancestor revision 21:7e61b508e709 | |
813 | skipping ancestor revision 22:3a4e92d81b97 |
|
804 | skipping ancestor revision 22:3a4e92d81b97 | |
814 | skipping revision 2:5c095ad7e90f (already grafted to 22:3a4e92d81b97) |
|
805 | skipping revision 2:5c095ad7e90f (already grafted to 22:3a4e92d81b97) | |
815 | grafting 7:ef0ef43d49e7 "2" |
|
806 | grafting 7:ef0ef43d49e7 "2" | |
816 | warning: can't find ancestor for 'b' copied from 'a'! |
|
807 | warning: can't find ancestor for 'b' copied from 'a'! | |
817 | grafting 13:7a4785234d87 "2" |
|
808 | grafting 13:7a4785234d87 "2" | |
818 | warning: can't find ancestor for 'b' copied from 'a'! |
|
809 | warning: can't find ancestor for 'b' copied from 'a'! | |
819 | grafting 19:9627f653b421 "2" |
|
810 | grafting 19:9627f653b421 "2" | |
820 | merging b |
|
811 | merging b | |
821 | warning: can't find ancestor for 'b' copied from 'a'! |
|
812 | warning: can't find ancestor for 'b' copied from 'a'! | |
822 |
|
813 | |||
823 | graft with --force (still doesn't graft merges) |
|
814 | graft with --force (still doesn't graft merges) | |
824 |
|
815 | |||
825 | $ hg graft 19 0 6 |
|
816 | $ hg graft 19 0 6 | |
826 | skipping ungraftable merge revision 6 |
|
817 | skipping ungraftable merge revision 6 | |
827 | skipping ancestor revision 0:68795b066622 |
|
818 | skipping ancestor revision 0:68795b066622 | |
828 | skipping already grafted revision 19:9627f653b421 (22:3a4e92d81b97 also has origin 2:5c095ad7e90f) |
|
819 | skipping already grafted revision 19:9627f653b421 (22:3a4e92d81b97 also has origin 2:5c095ad7e90f) | |
829 | [255] |
|
820 | [255] | |
830 | $ hg graft 19 0 6 --force |
|
821 | $ hg graft 19 0 6 --force | |
831 | skipping ungraftable merge revision 6 |
|
822 | skipping ungraftable merge revision 6 | |
832 | grafting 19:9627f653b421 "2" |
|
823 | grafting 19:9627f653b421 "2" | |
833 | merging b |
|
824 | merging b | |
834 | warning: can't find ancestor for 'b' copied from 'a'! |
|
825 | warning: can't find ancestor for 'b' copied from 'a'! | |
835 | grafting 0:68795b066622 "0" |
|
826 | grafting 0:68795b066622 "0" | |
836 |
|
827 | |||
837 | graft --force after backout |
|
828 | graft --force after backout | |
838 |
|
829 | |||
839 | $ echo abc > a |
|
830 | $ echo abc > a | |
840 | $ hg ci -m 28 |
|
831 | $ hg ci -m 28 | |
841 | $ hg backout 28 |
|
832 | $ hg backout 28 | |
842 | reverting a |
|
833 | reverting a | |
843 | changeset 29:9d95e865b00c backs out changeset 28:cc20d29aec8d |
|
834 | changeset 29:9d95e865b00c backs out changeset 28:cc20d29aec8d | |
844 | $ hg graft 28 |
|
835 | $ hg graft 28 | |
845 | skipping ancestor revision 28:cc20d29aec8d |
|
836 | skipping ancestor revision 28:cc20d29aec8d | |
846 | [255] |
|
837 | [255] | |
847 | $ hg graft 28 --force |
|
838 | $ hg graft 28 --force | |
848 | grafting 28:cc20d29aec8d "28" |
|
839 | grafting 28:cc20d29aec8d "28" | |
849 | merging a |
|
840 | merging a | |
850 | $ cat a |
|
841 | $ cat a | |
851 | abc |
|
842 | abc | |
852 |
|
843 | |||
853 | graft --continue after --force |
|
844 | graft --continue after --force | |
854 |
|
845 | |||
855 | $ echo def > a |
|
846 | $ echo def > a | |
856 | $ hg ci -m 31 |
|
847 | $ hg ci -m 31 | |
857 | $ hg graft 28 --force --tool internal:fail |
|
848 | $ hg graft 28 --force --tool internal:fail | |
858 | grafting 28:cc20d29aec8d "28" |
|
849 | grafting 28:cc20d29aec8d "28" | |
859 | abort: unresolved conflicts, can't continue |
|
850 | abort: unresolved conflicts, can't continue | |
860 | (use 'hg resolve' and 'hg graft --continue') |
|
851 | (use 'hg resolve' and 'hg graft --continue') | |
861 | [255] |
|
852 | [255] | |
862 | $ hg resolve --all |
|
853 | $ hg resolve --all | |
863 | merging a |
|
854 | merging a | |
864 | warning: conflicts while merging a! (edit, then use 'hg resolve --mark') |
|
855 | warning: conflicts while merging a! (edit, then use 'hg resolve --mark') | |
865 | [1] |
|
856 | [1] | |
866 | $ echo abc > a |
|
857 | $ echo abc > a | |
867 | $ hg resolve -m a |
|
858 | $ hg resolve -m a | |
868 | (no more unresolved files) |
|
859 | (no more unresolved files) | |
869 | continue: hg graft --continue |
|
860 | continue: hg graft --continue | |
870 | $ hg graft -c |
|
861 | $ hg graft -c | |
871 | grafting 28:cc20d29aec8d "28" |
|
862 | grafting 28:cc20d29aec8d "28" | |
872 | $ cat a |
|
863 | $ cat a | |
873 | abc |
|
864 | abc | |
874 |
|
865 | |||
875 | Continue testing same origin policy, using revision numbers from test above |
|
866 | Continue testing same origin policy, using revision numbers from test above | |
876 | but do some destructive editing of the repo: |
|
867 | but do some destructive editing of the repo: | |
877 |
|
868 | |||
878 | $ hg up -qC 7 |
|
869 | $ hg up -qC 7 | |
879 | $ hg tag -l -r 13 tmp |
|
870 | $ hg tag -l -r 13 tmp | |
880 | $ hg --config extensions.strip= strip 2 |
|
871 | $ hg --config extensions.strip= strip 2 | |
881 | saved backup bundle to $TESTTMP/a/.hg/strip-backup/5c095ad7e90f-d323a1e4-backup.hg |
|
872 | saved backup bundle to $TESTTMP/a/.hg/strip-backup/5c095ad7e90f-d323a1e4-backup.hg | |
882 | $ hg graft tmp |
|
873 | $ hg graft tmp | |
883 | skipping already grafted revision 8:7a4785234d87 (2:ef0ef43d49e7 also has unknown origin 5c095ad7e90f) |
|
874 | skipping already grafted revision 8:7a4785234d87 (2:ef0ef43d49e7 also has unknown origin 5c095ad7e90f) | |
884 | [255] |
|
875 | [255] | |
885 |
|
876 | |||
886 | Empty graft |
|
877 | Empty graft | |
887 |
|
878 | |||
888 | $ hg up -qr 26 |
|
879 | $ hg up -qr 26 | |
889 | $ hg tag -f something |
|
880 | $ hg tag -f something | |
890 | $ hg graft -qr 27 |
|
881 | $ hg graft -qr 27 | |
891 | $ hg graft -f 27 |
|
882 | $ hg graft -f 27 | |
892 | grafting 27:17d42b8f5d50 "28" |
|
883 | grafting 27:17d42b8f5d50 "28" | |
893 | note: graft of 27:17d42b8f5d50 created no changes to commit |
|
884 | note: graft of 27:17d42b8f5d50 created no changes to commit | |
894 |
|
885 | |||
895 | $ cd .. |
|
886 | $ cd .. | |
896 |
|
887 | |||
897 | Graft to duplicate a commit |
|
888 | Graft to duplicate a commit | |
898 |
|
889 | |||
899 | $ hg init graftsibling |
|
890 | $ hg init graftsibling | |
900 | $ cd graftsibling |
|
891 | $ cd graftsibling | |
901 | $ touch a |
|
892 | $ touch a | |
902 | $ hg commit -qAm a |
|
893 | $ hg commit -qAm a | |
903 | $ touch b |
|
894 | $ touch b | |
904 | $ hg commit -qAm b |
|
895 | $ hg commit -qAm b | |
905 | $ hg log -G -T '{rev}\n' |
|
896 | $ hg log -G -T '{rev}\n' | |
906 | @ 1 |
|
897 | @ 1 | |
907 | | |
|
898 | | | |
908 | o 0 |
|
899 | o 0 | |
909 |
|
900 | |||
910 | $ hg up -q 0 |
|
901 | $ hg up -q 0 | |
911 | $ hg graft -r 1 |
|
902 | $ hg graft -r 1 | |
912 | grafting 1:0e067c57feba "b" (tip) |
|
903 | grafting 1:0e067c57feba "b" (tip) | |
913 | $ hg log -G -T '{rev}\n' |
|
904 | $ hg log -G -T '{rev}\n' | |
914 | @ 2 |
|
905 | @ 2 | |
915 | | |
|
906 | | | |
916 | | o 1 |
|
907 | | o 1 | |
917 | |/ |
|
908 | |/ | |
918 | o 0 |
|
909 | o 0 | |
919 |
|
910 | |||
920 | Graft to duplicate a commit twice |
|
911 | Graft to duplicate a commit twice | |
921 |
|
912 | |||
922 | $ hg up -q 0 |
|
913 | $ hg up -q 0 | |
923 | $ hg graft -r 2 |
|
914 | $ hg graft -r 2 | |
924 | grafting 2:044ec77f6389 "b" (tip) |
|
915 | grafting 2:044ec77f6389 "b" (tip) | |
925 | $ hg log -G -T '{rev}\n' |
|
916 | $ hg log -G -T '{rev}\n' | |
926 | @ 3 |
|
917 | @ 3 | |
927 | | |
|
918 | | | |
928 | | o 2 |
|
919 | | o 2 | |
929 | |/ |
|
920 | |/ | |
930 | | o 1 |
|
921 | | o 1 | |
931 | |/ |
|
922 | |/ | |
932 | o 0 |
|
923 | o 0 | |
933 |
|
924 | |||
934 | Graft from behind a move or rename |
|
925 | Graft from behind a move or rename | |
935 | ================================== |
|
926 | ================================== | |
936 |
|
927 | |||
937 | NOTE: This is affected by issue5343, and will need updating when it's fixed |
|
928 | NOTE: This is affected by issue5343, and will need updating when it's fixed | |
938 |
|
929 | |||
939 | Consider this topology for a regular graft: |
|
930 | Consider this topology for a regular graft: | |
940 |
|
931 | |||
941 | o c1 |
|
932 | o c1 | |
942 | | |
|
933 | | | |
943 | | o c2 |
|
934 | | o c2 | |
944 | | | |
|
935 | | | | |
945 | | o ca # stands for "common ancestor" |
|
936 | | o ca # stands for "common ancestor" | |
946 | |/ |
|
937 | |/ | |
947 | o cta # stands for "common topological ancestor" |
|
938 | o cta # stands for "common topological ancestor" | |
948 |
|
939 | |||
949 | Note that in issue5343, ca==cta. |
|
940 | Note that in issue5343, ca==cta. | |
950 |
|
941 | |||
951 | The following table shows the possible cases. Here, "x->y" and, equivalently, |
|
942 | The following table shows the possible cases. Here, "x->y" and, equivalently, | |
952 | "y<-x", where x is an ancestor of y, means that some copy happened from x to y. |
|
943 | "y<-x", where x is an ancestor of y, means that some copy happened from x to y. | |
953 |
|
944 | |||
954 | name | c1<-cta | cta<->ca | ca->c2 |
|
945 | name | c1<-cta | cta<->ca | ca->c2 | |
955 | A.0 | | | |
|
946 | A.0 | | | | |
956 | A.1 | X | | |
|
947 | A.1 | X | | | |
957 | A.2 | | X | |
|
948 | A.2 | | X | | |
958 | A.3 | | | X |
|
949 | A.3 | | | X | |
959 | A.4 | X | X | |
|
950 | A.4 | X | X | | |
960 | A.5 | X | | X |
|
951 | A.5 | X | | X | |
961 | A.6 | | X | X |
|
952 | A.6 | | X | X | |
962 | A.7 | X | X | X |
|
953 | A.7 | X | X | X | |
963 |
|
954 | |||
964 | A.0 is trivial, and doesn't need copy tracking. |
|
955 | A.0 is trivial, and doesn't need copy tracking. | |
965 | For A.1, a forward rename is recorded in the c1 pass, to be followed later. |
|
956 | For A.1, a forward rename is recorded in the c1 pass, to be followed later. | |
966 | In A.2, the rename is recorded in the c2 pass and followed backwards. |
|
957 | In A.2, the rename is recorded in the c2 pass and followed backwards. | |
967 | A.3 is recorded in the c2 pass as a forward rename to be duplicated on target. |
|
958 | A.3 is recorded in the c2 pass as a forward rename to be duplicated on target. | |
968 | In A.4, both passes of checkcopies record incomplete renames, which are |
|
959 | In A.4, both passes of checkcopies record incomplete renames, which are | |
969 | then joined in mergecopies to record a rename to be followed. |
|
960 | then joined in mergecopies to record a rename to be followed. | |
970 | In A.5 and A.7, the c1 pass records an incomplete rename, while the c2 pass |
|
961 | In A.5 and A.7, the c1 pass records an incomplete rename, while the c2 pass | |
971 | records an incomplete divergence. The incomplete rename is then joined to the |
|
962 | records an incomplete divergence. The incomplete rename is then joined to the | |
972 | appropriate side of the incomplete divergence, and the result is recorded as a |
|
963 | appropriate side of the incomplete divergence, and the result is recorded as a | |
973 | divergence. The code doesn't distinguish at all between these two cases, since |
|
964 | divergence. The code doesn't distinguish at all between these two cases, since | |
974 | the end result of them is the same: an incomplete divergence joined with an |
|
965 | the end result of them is the same: an incomplete divergence joined with an | |
975 | incomplete rename into a divergence. |
|
966 | incomplete rename into a divergence. | |
976 | Finally, A.6 records a divergence entirely in the c2 pass. |
|
967 | Finally, A.6 records a divergence entirely in the c2 pass. | |
977 |
|
968 | |||
978 | A.4 has a degenerate case a<-b<-a->a, where checkcopies isn't needed at all. |
|
969 | A.4 has a degenerate case a<-b<-a->a, where checkcopies isn't needed at all. | |
979 | A.5 has a special case a<-b<-b->a, which is treated like a<-b->a in a merge. |
|
970 | A.5 has a special case a<-b<-b->a, which is treated like a<-b->a in a merge. | |
980 | A.5 has issue5343 as a special case. |
|
971 | A.5 has issue5343 as a special case. | |
981 | A.6 has a special case a<-a<-b->a. Here, checkcopies will find a spurious |
|
972 | A.6 has a special case a<-a<-b->a. Here, checkcopies will find a spurious | |
982 | incomplete divergence, which is in fact complete. This is handled later in |
|
973 | incomplete divergence, which is in fact complete. This is handled later in | |
983 | mergecopies. |
|
974 | mergecopies. | |
984 | A.7 has 4 special cases: a<-b<-a->b (the "ping-pong" case), a<-b<-c->b, |
|
975 | A.7 has 4 special cases: a<-b<-a->b (the "ping-pong" case), a<-b<-c->b, | |
985 | a<-b<-a->c and a<-b<-c->a. Of these, only the "ping-pong" case is interesting, |
|
976 | a<-b<-a->c and a<-b<-c->a. Of these, only the "ping-pong" case is interesting, | |
986 | the others are fairly trivial (a<-b<-c->b and a<-b<-a->c proceed like the base |
|
977 | the others are fairly trivial (a<-b<-c->b and a<-b<-a->c proceed like the base | |
987 | case, a<-b<-c->a is treated the same as a<-b<-b->a). |
|
978 | case, a<-b<-c->a is treated the same as a<-b<-b->a). | |
988 |
|
979 | |||
989 | f5a therefore tests the "ping-pong" rename case, where a file is renamed to the |
|
980 | f5a therefore tests the "ping-pong" rename case, where a file is renamed to the | |
990 | same name on both branches, then the rename is backed out on one branch, and |
|
981 | same name on both branches, then the rename is backed out on one branch, and | |
991 | the backout is grafted to the other branch. This creates a challenging rename |
|
982 | the backout is grafted to the other branch. This creates a challenging rename | |
992 | sequence of a<-b<-a->b in the graft target, topological CA, graft CA and graft |
|
983 | sequence of a<-b<-a->b in the graft target, topological CA, graft CA and graft | |
993 | source, respectively. Since rename detection will run on the c1 side for such a |
|
984 | source, respectively. Since rename detection will run on the c1 side for such a | |
994 | sequence (as for technical reasons, we split the c1 and c2 sides not at the |
|
985 | sequence (as for technical reasons, we split the c1 and c2 sides not at the | |
995 | graft CA, but rather at the topological CA), it will pick up a false rename, |
|
986 | graft CA, but rather at the topological CA), it will pick up a false rename, | |
996 | and cause a spurious merge conflict. This false rename is always exactly the |
|
987 | and cause a spurious merge conflict. This false rename is always exactly the | |
997 | reverse of the true rename that would be detected on the c2 side, so we can |
|
988 | reverse of the true rename that would be detected on the c2 side, so we can | |
998 | correct for it by detecting this condition and reversing as necessary. |
|
989 | correct for it by detecting this condition and reversing as necessary. | |
999 |
|
990 | |||
1000 | First, set up the repository with commits to be grafted |
|
991 | First, set up the repository with commits to be grafted | |
1001 |
|
992 | |||
1002 | $ hg init ../graftmove |
|
993 | $ hg init ../graftmove | |
1003 | $ cd ../graftmove |
|
994 | $ cd ../graftmove | |
1004 | $ echo c1a > f1a |
|
995 | $ echo c1a > f1a | |
1005 | $ echo c2a > f2a |
|
996 | $ echo c2a > f2a | |
1006 | $ echo c3a > f3a |
|
997 | $ echo c3a > f3a | |
1007 | $ echo c4a > f4a |
|
998 | $ echo c4a > f4a | |
1008 | $ echo c5a > f5a |
|
999 | $ echo c5a > f5a | |
1009 | $ hg ci -qAm A0 |
|
1000 | $ hg ci -qAm A0 | |
1010 | $ hg mv f1a f1b |
|
1001 | $ hg mv f1a f1b | |
1011 | $ hg mv f3a f3b |
|
1002 | $ hg mv f3a f3b | |
1012 | $ hg mv f5a f5b |
|
1003 | $ hg mv f5a f5b | |
1013 | $ hg ci -qAm B0 |
|
1004 | $ hg ci -qAm B0 | |
1014 | $ echo c1c > f1b |
|
1005 | $ echo c1c > f1b | |
1015 | $ hg mv f2a f2c |
|
1006 | $ hg mv f2a f2c | |
1016 | $ hg mv f5b f5a |
|
1007 | $ hg mv f5b f5a | |
1017 | $ echo c5c > f5a |
|
1008 | $ echo c5c > f5a | |
1018 | $ hg ci -qAm C0 |
|
1009 | $ hg ci -qAm C0 | |
1019 | $ hg mv f3b f3d |
|
1010 | $ hg mv f3b f3d | |
1020 | $ echo c4d > f4a |
|
1011 | $ echo c4d > f4a | |
1021 | $ hg ci -qAm D0 |
|
1012 | $ hg ci -qAm D0 | |
1022 | $ hg log -G |
|
1013 | $ hg log -G | |
1023 | @ changeset: 3:b69f5839d2d9 |
|
1014 | @ changeset: 3:b69f5839d2d9 | |
1024 | | tag: tip |
|
1015 | | tag: tip | |
1025 | | user: test |
|
1016 | | user: test | |
1026 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1017 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
1027 | | summary: D0 |
|
1018 | | summary: D0 | |
1028 | | |
|
1019 | | | |
1029 | o changeset: 2:f58c7e2b28fa |
|
1020 | o changeset: 2:f58c7e2b28fa | |
1030 | | user: test |
|
1021 | | user: test | |
1031 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1022 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
1032 | | summary: C0 |
|
1023 | | summary: C0 | |
1033 | | |
|
1024 | | | |
1034 | o changeset: 1:3d7bba921b5d |
|
1025 | o changeset: 1:3d7bba921b5d | |
1035 | | user: test |
|
1026 | | user: test | |
1036 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1027 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
1037 | | summary: B0 |
|
1028 | | summary: B0 | |
1038 | | |
|
1029 | | | |
1039 | o changeset: 0:11f7a1b56675 |
|
1030 | o changeset: 0:11f7a1b56675 | |
1040 | user: test |
|
1031 | user: test | |
1041 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1032 | date: Thu Jan 01 00:00:00 1970 +0000 | |
1042 | summary: A0 |
|
1033 | summary: A0 | |
1043 |
|
1034 | |||
1044 |
|
1035 | |||
1045 | Test the cases A.2 (f1x), A.3 (f2x) and a special case of A.6 (f5x) where the |
|
1036 | Test the cases A.2 (f1x), A.3 (f2x) and a special case of A.6 (f5x) where the | |
1046 | two renames actually converge to the same name (thus no actual divergence). |
|
1037 | two renames actually converge to the same name (thus no actual divergence). | |
1047 |
|
1038 | |||
1048 | $ hg up -q 'desc("A0")' |
|
1039 | $ hg up -q 'desc("A0")' | |
1049 | $ HGEDITOR="echo C1 >" hg graft -r 'desc("C0")' --edit |
|
1040 | $ HGEDITOR="echo C1 >" hg graft -r 'desc("C0")' --edit | |
1050 | grafting 2:f58c7e2b28fa "C0" |
|
1041 | grafting 2:f58c7e2b28fa "C0" | |
1051 | merging f1a and f1b to f1a |
|
1042 | merging f1a and f1b to f1a | |
1052 | merging f5a |
|
1043 | merging f5a | |
1053 | warning: can't find ancestor for 'f5a' copied from 'f5b'! |
|
1044 | warning: can't find ancestor for 'f5a' copied from 'f5b'! | |
1054 | $ hg status --change . |
|
1045 | $ hg status --change . | |
1055 | M f1a |
|
1046 | M f1a | |
1056 | M f5a |
|
1047 | M f5a | |
1057 | A f2c |
|
1048 | A f2c | |
1058 | R f2a |
|
1049 | R f2a | |
1059 | $ hg cat f1a |
|
1050 | $ hg cat f1a | |
1060 | c1c |
|
1051 | c1c | |
1061 | $ hg cat f1b |
|
1052 | $ hg cat f1b | |
1062 | f1b: no such file in rev c9763722f9bd |
|
1053 | f1b: no such file in rev c9763722f9bd | |
1063 | [1] |
|
1054 | [1] | |
1064 |
|
1055 | |||
1065 | Test the cases A.0 (f4x) and A.6 (f3x) |
|
1056 | Test the cases A.0 (f4x) and A.6 (f3x) | |
1066 |
|
1057 | |||
1067 | $ HGEDITOR="echo D1 >" hg graft -r 'desc("D0")' --edit |
|
1058 | $ HGEDITOR="echo D1 >" hg graft -r 'desc("D0")' --edit | |
1068 | grafting 3:b69f5839d2d9 "D0" |
|
1059 | grafting 3:b69f5839d2d9 "D0" | |
1069 | note: possible conflict - f3b was renamed multiple times to: |
|
1060 | note: possible conflict - f3b was renamed multiple times to: | |
1070 | f3a |
|
1061 | f3a | |
1071 | f3d |
|
1062 | f3d | |
1072 | warning: can't find ancestor for 'f3d' copied from 'f3b'! |
|
1063 | warning: can't find ancestor for 'f3d' copied from 'f3b'! | |
1073 |
|
1064 | |||
1074 | Set up the repository for some further tests |
|
1065 | Set up the repository for some further tests | |
1075 |
|
1066 | |||
1076 | $ hg up -q "min(desc("A0"))" |
|
1067 | $ hg up -q "min(desc("A0"))" | |
1077 | $ hg mv f1a f1e |
|
1068 | $ hg mv f1a f1e | |
1078 | $ echo c2e > f2a |
|
1069 | $ echo c2e > f2a | |
1079 | $ hg mv f3a f3e |
|
1070 | $ hg mv f3a f3e | |
1080 | $ hg mv f4a f4e |
|
1071 | $ hg mv f4a f4e | |
1081 | $ hg mv f5a f5b |
|
1072 | $ hg mv f5a f5b | |
1082 | $ hg ci -qAm "E0" |
|
1073 | $ hg ci -qAm "E0" | |
1083 | $ hg up -q "min(desc("A0"))" |
|
1074 | $ hg up -q "min(desc("A0"))" | |
1084 | $ hg cp f1a f1f |
|
1075 | $ hg cp f1a f1f | |
1085 | $ hg ci -qAm "F0" |
|
1076 | $ hg ci -qAm "F0" | |
1086 | $ hg up -q "min(desc("A0"))" |
|
1077 | $ hg up -q "min(desc("A0"))" | |
1087 | $ hg cp f1a f1g |
|
1078 | $ hg cp f1a f1g | |
1088 | $ echo c1g > f1g |
|
1079 | $ echo c1g > f1g | |
1089 | $ hg ci -qAm "G0" |
|
1080 | $ hg ci -qAm "G0" | |
1090 | $ hg log -G |
|
1081 | $ hg log -G | |
1091 | @ changeset: 8:ba67f08fb15a |
|
1082 | @ changeset: 8:ba67f08fb15a | |
1092 | | tag: tip |
|
1083 | | tag: tip | |
1093 | | parent: 0:11f7a1b56675 |
|
1084 | | parent: 0:11f7a1b56675 | |
1094 | | user: test |
|
1085 | | user: test | |
1095 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1086 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
1096 | | summary: G0 |
|
1087 | | summary: G0 | |
1097 | | |
|
1088 | | | |
1098 | | o changeset: 7:d376ab0d7fda |
|
1089 | | o changeset: 7:d376ab0d7fda | |
1099 | |/ parent: 0:11f7a1b56675 |
|
1090 | |/ parent: 0:11f7a1b56675 | |
1100 | | user: test |
|
1091 | | user: test | |
1101 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1092 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
1102 | | summary: F0 |
|
1093 | | summary: F0 | |
1103 | | |
|
1094 | | | |
1104 | | o changeset: 6:6bd1736cab86 |
|
1095 | | o changeset: 6:6bd1736cab86 | |
1105 | |/ parent: 0:11f7a1b56675 |
|
1096 | |/ parent: 0:11f7a1b56675 | |
1106 | | user: test |
|
1097 | | user: test | |
1107 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1098 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
1108 | | summary: E0 |
|
1099 | | summary: E0 | |
1109 | | |
|
1100 | | | |
1110 | | o changeset: 5:560daee679da |
|
1101 | | o changeset: 5:560daee679da | |
1111 | | | user: test |
|
1102 | | | user: test | |
1112 | | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1103 | | | date: Thu Jan 01 00:00:00 1970 +0000 | |
1113 | | | summary: D1 |
|
1104 | | | summary: D1 | |
1114 | | | |
|
1105 | | | | |
1115 | | o changeset: 4:c9763722f9bd |
|
1106 | | o changeset: 4:c9763722f9bd | |
1116 | |/ parent: 0:11f7a1b56675 |
|
1107 | |/ parent: 0:11f7a1b56675 | |
1117 | | user: test |
|
1108 | | user: test | |
1118 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1109 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
1119 | | summary: C1 |
|
1110 | | summary: C1 | |
1120 | | |
|
1111 | | | |
1121 | | o changeset: 3:b69f5839d2d9 |
|
1112 | | o changeset: 3:b69f5839d2d9 | |
1122 | | | user: test |
|
1113 | | | user: test | |
1123 | | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1114 | | | date: Thu Jan 01 00:00:00 1970 +0000 | |
1124 | | | summary: D0 |
|
1115 | | | summary: D0 | |
1125 | | | |
|
1116 | | | | |
1126 | | o changeset: 2:f58c7e2b28fa |
|
1117 | | o changeset: 2:f58c7e2b28fa | |
1127 | | | user: test |
|
1118 | | | user: test | |
1128 | | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1119 | | | date: Thu Jan 01 00:00:00 1970 +0000 | |
1129 | | | summary: C0 |
|
1120 | | | summary: C0 | |
1130 | | | |
|
1121 | | | | |
1131 | | o changeset: 1:3d7bba921b5d |
|
1122 | | o changeset: 1:3d7bba921b5d | |
1132 | |/ user: test |
|
1123 | |/ user: test | |
1133 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1124 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
1134 | | summary: B0 |
|
1125 | | summary: B0 | |
1135 | | |
|
1126 | | | |
1136 | o changeset: 0:11f7a1b56675 |
|
1127 | o changeset: 0:11f7a1b56675 | |
1137 | user: test |
|
1128 | user: test | |
1138 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1129 | date: Thu Jan 01 00:00:00 1970 +0000 | |
1139 | summary: A0 |
|
1130 | summary: A0 | |
1140 |
|
1131 | |||
1141 |
|
1132 | |||
1142 | Test the cases A.4 (f1x), the "ping-pong" special case of A.7 (f5x), |
|
1133 | Test the cases A.4 (f1x), the "ping-pong" special case of A.7 (f5x), | |
1143 | and A.3 with a local content change to be preserved (f2x). |
|
1134 | and A.3 with a local content change to be preserved (f2x). | |
1144 |
|
1135 | |||
1145 | $ hg up -q "desc("E0")" |
|
1136 | $ hg up -q "desc("E0")" | |
1146 | $ HGEDITOR="echo C2 >" hg graft -r 'desc("C0")' --edit |
|
1137 | $ HGEDITOR="echo C2 >" hg graft -r 'desc("C0")' --edit | |
1147 | grafting 2:f58c7e2b28fa "C0" |
|
1138 | grafting 2:f58c7e2b28fa "C0" | |
1148 | merging f1e and f1b to f1e |
|
1139 | merging f1e and f1b to f1e | |
1149 | merging f2a and f2c to f2c |
|
1140 | merging f2a and f2c to f2c | |
1150 |
|
1141 | |||
1151 | Test the cases A.1 (f4x) and A.7 (f3x). |
|
1142 | Test the cases A.1 (f4x) and A.7 (f3x). | |
1152 |
|
1143 | |||
1153 | $ HGEDITOR="echo D2 >" hg graft -r 'desc("D0")' --edit |
|
1144 | $ HGEDITOR="echo D2 >" hg graft -r 'desc("D0")' --edit | |
1154 | grafting 3:b69f5839d2d9 "D0" |
|
1145 | grafting 3:b69f5839d2d9 "D0" | |
1155 | note: possible conflict - f3b was renamed multiple times to: |
|
1146 | note: possible conflict - f3b was renamed multiple times to: | |
1156 | f3d |
|
1147 | f3d | |
1157 | f3e |
|
1148 | f3e | |
1158 | merging f4e and f4a to f4e |
|
1149 | merging f4e and f4a to f4e | |
1159 | warning: can't find ancestor for 'f3d' copied from 'f3b'! |
|
1150 | warning: can't find ancestor for 'f3d' copied from 'f3b'! | |
1160 |
|
1151 | |||
1161 | $ hg cat f2c |
|
1152 | $ hg cat f2c | |
1162 | c2e |
|
1153 | c2e | |
1163 |
|
1154 | |||
1164 | Test the case A.5 (move case, f1x). |
|
1155 | Test the case A.5 (move case, f1x). | |
1165 |
|
1156 | |||
1166 | $ hg up -q "desc("C0")" |
|
1157 | $ hg up -q "desc("C0")" | |
1167 | BROKEN: Shouldn't get the warning about missing ancestor |
|
1158 | BROKEN: Shouldn't get the warning about missing ancestor | |
1168 | $ HGEDITOR="echo E1 >" hg graft -r 'desc("E0")' --edit |
|
1159 | $ HGEDITOR="echo E1 >" hg graft -r 'desc("E0")' --edit | |
1169 | grafting 6:6bd1736cab86 "E0" |
|
1160 | grafting 6:6bd1736cab86 "E0" | |
1170 | note: possible conflict - f1a was renamed multiple times to: |
|
1161 | note: possible conflict - f1a was renamed multiple times to: | |
1171 | f1b |
|
1162 | f1b | |
1172 | f1e |
|
1163 | f1e | |
1173 | note: possible conflict - f3a was renamed multiple times to: |
|
1164 | note: possible conflict - f3a was renamed multiple times to: | |
1174 | f3b |
|
1165 | f3b | |
1175 | f3e |
|
1166 | f3e | |
1176 | merging f2c and f2a to f2c |
|
1167 | merging f2c and f2a to f2c | |
1177 | merging f5a and f5b to f5b |
|
1168 | merging f5a and f5b to f5b | |
1178 | warning: can't find ancestor for 'f1e' copied from 'f1a'! |
|
1169 | warning: can't find ancestor for 'f1e' copied from 'f1a'! | |
1179 | warning: can't find ancestor for 'f3e' copied from 'f3a'! |
|
1170 | warning: can't find ancestor for 'f3e' copied from 'f3a'! | |
1180 | $ cat f1e |
|
1171 | $ cat f1e | |
1181 | c1a |
|
1172 | c1a | |
1182 |
|
1173 | |||
1183 | Test the case A.5 (copy case, f1x). |
|
1174 | Test the case A.5 (copy case, f1x). | |
1184 |
|
1175 | |||
1185 | $ hg up -q "desc("C0")" |
|
1176 | $ hg up -q "desc("C0")" | |
1186 | BROKEN: Shouldn't get the warning about missing ancestor |
|
1177 | BROKEN: Shouldn't get the warning about missing ancestor | |
1187 | $ HGEDITOR="echo F1 >" hg graft -r 'desc("F0")' --edit |
|
1178 | $ HGEDITOR="echo F1 >" hg graft -r 'desc("F0")' --edit | |
1188 | grafting 7:d376ab0d7fda "F0" |
|
1179 | grafting 7:d376ab0d7fda "F0" | |
1189 | warning: can't find ancestor for 'f1f' copied from 'f1a'! |
|
1180 | warning: can't find ancestor for 'f1f' copied from 'f1a'! | |
1190 | BROKEN: f1f should be marked a copy from f1b |
|
1181 | BROKEN: f1f should be marked a copy from f1b | |
1191 | $ hg st --copies --change . |
|
1182 | $ hg st --copies --change . | |
1192 | A f1f |
|
1183 | A f1f | |
1193 | BROKEN: f1f should have the new content from f1b (i.e. "c1c") |
|
1184 | BROKEN: f1f should have the new content from f1b (i.e. "c1c") | |
1194 | $ cat f1f |
|
1185 | $ cat f1f | |
1195 | c1a |
|
1186 | c1a | |
1196 |
|
1187 | |||
1197 | Test the case A.5 (copy+modify case, f1x). |
|
1188 | Test the case A.5 (copy+modify case, f1x). | |
1198 |
|
1189 | |||
1199 | $ hg up -q "desc("C0")" |
|
1190 | $ hg up -q "desc("C0")" | |
1200 | BROKEN: We should get a merge conflict from the 3-way merge between f1b in C0 |
|
1191 | BROKEN: We should get a merge conflict from the 3-way merge between f1b in C0 | |
1201 | (content "c1c") and f1g in G0 (content "c1g") with f1a in A0 as base (content |
|
1192 | (content "c1c") and f1g in G0 (content "c1g") with f1a in A0 as base (content | |
1202 | "c1a") |
|
1193 | "c1a") | |
1203 | $ HGEDITOR="echo G1 >" hg graft -r 'desc("G0")' --edit |
|
1194 | $ HGEDITOR="echo G1 >" hg graft -r 'desc("G0")' --edit | |
1204 | grafting 8:ba67f08fb15a "G0" |
|
1195 | grafting 8:ba67f08fb15a "G0" | |
1205 | warning: can't find ancestor for 'f1g' copied from 'f1a'! |
|
1196 | warning: can't find ancestor for 'f1g' copied from 'f1a'! | |
1206 |
|
1197 | |||
1207 | Check the results of the grafts tested |
|
1198 | Check the results of the grafts tested | |
1208 |
|
1199 | |||
1209 | $ hg log -CGv --patch --git |
|
1200 | $ hg log -CGv --patch --git | |
1210 | @ changeset: 13:ef3adf6c20a4 |
|
1201 | @ changeset: 13:ef3adf6c20a4 | |
1211 | | tag: tip |
|
1202 | | tag: tip | |
1212 | | parent: 2:f58c7e2b28fa |
|
1203 | | parent: 2:f58c7e2b28fa | |
1213 | | user: test |
|
1204 | | user: test | |
1214 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1205 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
1215 | | files: f1g |
|
1206 | | files: f1g | |
1216 | | description: |
|
1207 | | description: | |
1217 | | G1 |
|
1208 | | G1 | |
1218 | | |
|
1209 | | | |
1219 | | |
|
1210 | | | |
1220 | | diff --git a/f1g b/f1g |
|
1211 | | diff --git a/f1g b/f1g | |
1221 | | new file mode 100644 |
|
1212 | | new file mode 100644 | |
1222 | | --- /dev/null |
|
1213 | | --- /dev/null | |
1223 | | +++ b/f1g |
|
1214 | | +++ b/f1g | |
1224 | | @@ -0,0 +1,1 @@ |
|
1215 | | @@ -0,0 +1,1 @@ | |
1225 | | +c1g |
|
1216 | | +c1g | |
1226 | | |
|
1217 | | | |
1227 | | o changeset: 12:b5542d755b54 |
|
1218 | | o changeset: 12:b5542d755b54 | |
1228 | |/ parent: 2:f58c7e2b28fa |
|
1219 | |/ parent: 2:f58c7e2b28fa | |
1229 | | user: test |
|
1220 | | user: test | |
1230 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1221 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
1231 | | files: f1f |
|
1222 | | files: f1f | |
1232 | | description: |
|
1223 | | description: | |
1233 | | F1 |
|
1224 | | F1 | |
1234 | | |
|
1225 | | | |
1235 | | |
|
1226 | | | |
1236 | | diff --git a/f1f b/f1f |
|
1227 | | diff --git a/f1f b/f1f | |
1237 | | new file mode 100644 |
|
1228 | | new file mode 100644 | |
1238 | | --- /dev/null |
|
1229 | | --- /dev/null | |
1239 | | +++ b/f1f |
|
1230 | | +++ b/f1f | |
1240 | | @@ -0,0 +1,1 @@ |
|
1231 | | @@ -0,0 +1,1 @@ | |
1241 | | +c1a |
|
1232 | | +c1a | |
1242 | | |
|
1233 | | | |
1243 | | o changeset: 11:f8a162271246 |
|
1234 | | o changeset: 11:f8a162271246 | |
1244 | |/ parent: 2:f58c7e2b28fa |
|
1235 | |/ parent: 2:f58c7e2b28fa | |
1245 | | user: test |
|
1236 | | user: test | |
1246 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1237 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
1247 | | files: f1e f2c f3e f4a f4e f5a f5b |
|
1238 | | files: f1e f2c f3e f4a f4e f5a f5b | |
1248 | | copies: f4e (f4a) f5b (f5a) |
|
1239 | | copies: f4e (f4a) f5b (f5a) | |
1249 | | description: |
|
1240 | | description: | |
1250 | | E1 |
|
1241 | | E1 | |
1251 | | |
|
1242 | | | |
1252 | | |
|
1243 | | | |
1253 | | diff --git a/f1e b/f1e |
|
1244 | | diff --git a/f1e b/f1e | |
1254 | | new file mode 100644 |
|
1245 | | new file mode 100644 | |
1255 | | --- /dev/null |
|
1246 | | --- /dev/null | |
1256 | | +++ b/f1e |
|
1247 | | +++ b/f1e | |
1257 | | @@ -0,0 +1,1 @@ |
|
1248 | | @@ -0,0 +1,1 @@ | |
1258 | | +c1a |
|
1249 | | +c1a | |
1259 | | diff --git a/f2c b/f2c |
|
1250 | | diff --git a/f2c b/f2c | |
1260 | | --- a/f2c |
|
1251 | | --- a/f2c | |
1261 | | +++ b/f2c |
|
1252 | | +++ b/f2c | |
1262 | | @@ -1,1 +1,1 @@ |
|
1253 | | @@ -1,1 +1,1 @@ | |
1263 | | -c2a |
|
1254 | | -c2a | |
1264 | | +c2e |
|
1255 | | +c2e | |
1265 | | diff --git a/f3e b/f3e |
|
1256 | | diff --git a/f3e b/f3e | |
1266 | | new file mode 100644 |
|
1257 | | new file mode 100644 | |
1267 | | --- /dev/null |
|
1258 | | --- /dev/null | |
1268 | | +++ b/f3e |
|
1259 | | +++ b/f3e | |
1269 | | @@ -0,0 +1,1 @@ |
|
1260 | | @@ -0,0 +1,1 @@ | |
1270 | | +c3a |
|
1261 | | +c3a | |
1271 | | diff --git a/f4a b/f4e |
|
1262 | | diff --git a/f4a b/f4e | |
1272 | | rename from f4a |
|
1263 | | rename from f4a | |
1273 | | rename to f4e |
|
1264 | | rename to f4e | |
1274 | | diff --git a/f5a b/f5b |
|
1265 | | diff --git a/f5a b/f5b | |
1275 | | rename from f5a |
|
1266 | | rename from f5a | |
1276 | | rename to f5b |
|
1267 | | rename to f5b | |
1277 | | |
|
1268 | | | |
1278 | | o changeset: 10:93ee502e8b0a |
|
1269 | | o changeset: 10:93ee502e8b0a | |
1279 | | | user: test |
|
1270 | | | user: test | |
1280 | | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1271 | | | date: Thu Jan 01 00:00:00 1970 +0000 | |
1281 | | | files: f3d f4e |
|
1272 | | | files: f3d f4e | |
1282 | | | description: |
|
1273 | | | description: | |
1283 | | | D2 |
|
1274 | | | D2 | |
1284 | | | |
|
1275 | | | | |
1285 | | | |
|
1276 | | | | |
1286 | | | diff --git a/f3d b/f3d |
|
1277 | | | diff --git a/f3d b/f3d | |
1287 | | | new file mode 100644 |
|
1278 | | | new file mode 100644 | |
1288 | | | --- /dev/null |
|
1279 | | | --- /dev/null | |
1289 | | | +++ b/f3d |
|
1280 | | | +++ b/f3d | |
1290 | | | @@ -0,0 +1,1 @@ |
|
1281 | | | @@ -0,0 +1,1 @@ | |
1291 | | | +c3a |
|
1282 | | | +c3a | |
1292 | | | diff --git a/f4e b/f4e |
|
1283 | | | diff --git a/f4e b/f4e | |
1293 | | | --- a/f4e |
|
1284 | | | --- a/f4e | |
1294 | | | +++ b/f4e |
|
1285 | | | +++ b/f4e | |
1295 | | | @@ -1,1 +1,1 @@ |
|
1286 | | | @@ -1,1 +1,1 @@ | |
1296 | | | -c4a |
|
1287 | | | -c4a | |
1297 | | | +c4d |
|
1288 | | | +c4d | |
1298 | | | |
|
1289 | | | | |
1299 | | o changeset: 9:539cf145f496 |
|
1290 | | o changeset: 9:539cf145f496 | |
1300 | | | parent: 6:6bd1736cab86 |
|
1291 | | | parent: 6:6bd1736cab86 | |
1301 | | | user: test |
|
1292 | | | user: test | |
1302 | | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1293 | | | date: Thu Jan 01 00:00:00 1970 +0000 | |
1303 | | | files: f1e f2a f2c f5a f5b |
|
1294 | | | files: f1e f2a f2c f5a f5b | |
1304 | | | copies: f2c (f2a) f5a (f5b) |
|
1295 | | | copies: f2c (f2a) f5a (f5b) | |
1305 | | | description: |
|
1296 | | | description: | |
1306 | | | C2 |
|
1297 | | | C2 | |
1307 | | | |
|
1298 | | | | |
1308 | | | |
|
1299 | | | | |
1309 | | | diff --git a/f1e b/f1e |
|
1300 | | | diff --git a/f1e b/f1e | |
1310 | | | --- a/f1e |
|
1301 | | | --- a/f1e | |
1311 | | | +++ b/f1e |
|
1302 | | | +++ b/f1e | |
1312 | | | @@ -1,1 +1,1 @@ |
|
1303 | | | @@ -1,1 +1,1 @@ | |
1313 | | | -c1a |
|
1304 | | | -c1a | |
1314 | | | +c1c |
|
1305 | | | +c1c | |
1315 | | | diff --git a/f2a b/f2c |
|
1306 | | | diff --git a/f2a b/f2c | |
1316 | | | rename from f2a |
|
1307 | | | rename from f2a | |
1317 | | | rename to f2c |
|
1308 | | | rename to f2c | |
1318 | | | diff --git a/f5b b/f5a |
|
1309 | | | diff --git a/f5b b/f5a | |
1319 | | | rename from f5b |
|
1310 | | | rename from f5b | |
1320 | | | rename to f5a |
|
1311 | | | rename to f5a | |
1321 | | | --- a/f5b |
|
1312 | | | --- a/f5b | |
1322 | | | +++ b/f5a |
|
1313 | | | +++ b/f5a | |
1323 | | | @@ -1,1 +1,1 @@ |
|
1314 | | | @@ -1,1 +1,1 @@ | |
1324 | | | -c5a |
|
1315 | | | -c5a | |
1325 | | | +c5c |
|
1316 | | | +c5c | |
1326 | | | |
|
1317 | | | | |
1327 | | | o changeset: 8:ba67f08fb15a |
|
1318 | | | o changeset: 8:ba67f08fb15a | |
1328 | | | | parent: 0:11f7a1b56675 |
|
1319 | | | | parent: 0:11f7a1b56675 | |
1329 | | | | user: test |
|
1320 | | | | user: test | |
1330 | | | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1321 | | | | date: Thu Jan 01 00:00:00 1970 +0000 | |
1331 | | | | files: f1g |
|
1322 | | | | files: f1g | |
1332 | | | | copies: f1g (f1a) |
|
1323 | | | | copies: f1g (f1a) | |
1333 | | | | description: |
|
1324 | | | | description: | |
1334 | | | | G0 |
|
1325 | | | | G0 | |
1335 | | | | |
|
1326 | | | | | |
1336 | | | | |
|
1327 | | | | | |
1337 | | | | diff --git a/f1a b/f1g |
|
1328 | | | | diff --git a/f1a b/f1g | |
1338 | | | | copy from f1a |
|
1329 | | | | copy from f1a | |
1339 | | | | copy to f1g |
|
1330 | | | | copy to f1g | |
1340 | | | | --- a/f1a |
|
1331 | | | | --- a/f1a | |
1341 | | | | +++ b/f1g |
|
1332 | | | | +++ b/f1g | |
1342 | | | | @@ -1,1 +1,1 @@ |
|
1333 | | | | @@ -1,1 +1,1 @@ | |
1343 | | | | -c1a |
|
1334 | | | | -c1a | |
1344 | | | | +c1g |
|
1335 | | | | +c1g | |
1345 | | | | |
|
1336 | | | | | |
1346 | | | | o changeset: 7:d376ab0d7fda |
|
1337 | | | | o changeset: 7:d376ab0d7fda | |
1347 | | | |/ parent: 0:11f7a1b56675 |
|
1338 | | | |/ parent: 0:11f7a1b56675 | |
1348 | | | | user: test |
|
1339 | | | | user: test | |
1349 | | | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1340 | | | | date: Thu Jan 01 00:00:00 1970 +0000 | |
1350 | | | | files: f1f |
|
1341 | | | | files: f1f | |
1351 | | | | copies: f1f (f1a) |
|
1342 | | | | copies: f1f (f1a) | |
1352 | | | | description: |
|
1343 | | | | description: | |
1353 | | | | F0 |
|
1344 | | | | F0 | |
1354 | | | | |
|
1345 | | | | | |
1355 | | | | |
|
1346 | | | | | |
1356 | | | | diff --git a/f1a b/f1f |
|
1347 | | | | diff --git a/f1a b/f1f | |
1357 | | | | copy from f1a |
|
1348 | | | | copy from f1a | |
1358 | | | | copy to f1f |
|
1349 | | | | copy to f1f | |
1359 | | | | |
|
1350 | | | | | |
1360 | | o | changeset: 6:6bd1736cab86 |
|
1351 | | o | changeset: 6:6bd1736cab86 | |
1361 | | |/ parent: 0:11f7a1b56675 |
|
1352 | | |/ parent: 0:11f7a1b56675 | |
1362 | | | user: test |
|
1353 | | | user: test | |
1363 | | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1354 | | | date: Thu Jan 01 00:00:00 1970 +0000 | |
1364 | | | files: f1a f1e f2a f3a f3e f4a f4e f5a f5b |
|
1355 | | | files: f1a f1e f2a f3a f3e f4a f4e f5a f5b | |
1365 | | | copies: f1e (f1a) f3e (f3a) f4e (f4a) f5b (f5a) |
|
1356 | | | copies: f1e (f1a) f3e (f3a) f4e (f4a) f5b (f5a) | |
1366 | | | description: |
|
1357 | | | description: | |
1367 | | | E0 |
|
1358 | | | E0 | |
1368 | | | |
|
1359 | | | | |
1369 | | | |
|
1360 | | | | |
1370 | | | diff --git a/f1a b/f1e |
|
1361 | | | diff --git a/f1a b/f1e | |
1371 | | | rename from f1a |
|
1362 | | | rename from f1a | |
1372 | | | rename to f1e |
|
1363 | | | rename to f1e | |
1373 | | | diff --git a/f2a b/f2a |
|
1364 | | | diff --git a/f2a b/f2a | |
1374 | | | --- a/f2a |
|
1365 | | | --- a/f2a | |
1375 | | | +++ b/f2a |
|
1366 | | | +++ b/f2a | |
1376 | | | @@ -1,1 +1,1 @@ |
|
1367 | | | @@ -1,1 +1,1 @@ | |
1377 | | | -c2a |
|
1368 | | | -c2a | |
1378 | | | +c2e |
|
1369 | | | +c2e | |
1379 | | | diff --git a/f3a b/f3e |
|
1370 | | | diff --git a/f3a b/f3e | |
1380 | | | rename from f3a |
|
1371 | | | rename from f3a | |
1381 | | | rename to f3e |
|
1372 | | | rename to f3e | |
1382 | | | diff --git a/f4a b/f4e |
|
1373 | | | diff --git a/f4a b/f4e | |
1383 | | | rename from f4a |
|
1374 | | | rename from f4a | |
1384 | | | rename to f4e |
|
1375 | | | rename to f4e | |
1385 | | | diff --git a/f5a b/f5b |
|
1376 | | | diff --git a/f5a b/f5b | |
1386 | | | rename from f5a |
|
1377 | | | rename from f5a | |
1387 | | | rename to f5b |
|
1378 | | | rename to f5b | |
1388 | | | |
|
1379 | | | | |
1389 | | | o changeset: 5:560daee679da |
|
1380 | | | o changeset: 5:560daee679da | |
1390 | | | | user: test |
|
1381 | | | | user: test | |
1391 | | | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1382 | | | | date: Thu Jan 01 00:00:00 1970 +0000 | |
1392 | | | | files: f3d f4a |
|
1383 | | | | files: f3d f4a | |
1393 | | | | description: |
|
1384 | | | | description: | |
1394 | | | | D1 |
|
1385 | | | | D1 | |
1395 | | | | |
|
1386 | | | | | |
1396 | | | | |
|
1387 | | | | | |
1397 | | | | diff --git a/f3d b/f3d |
|
1388 | | | | diff --git a/f3d b/f3d | |
1398 | | | | new file mode 100644 |
|
1389 | | | | new file mode 100644 | |
1399 | | | | --- /dev/null |
|
1390 | | | | --- /dev/null | |
1400 | | | | +++ b/f3d |
|
1391 | | | | +++ b/f3d | |
1401 | | | | @@ -0,0 +1,1 @@ |
|
1392 | | | | @@ -0,0 +1,1 @@ | |
1402 | | | | +c3a |
|
1393 | | | | +c3a | |
1403 | | | | diff --git a/f4a b/f4a |
|
1394 | | | | diff --git a/f4a b/f4a | |
1404 | | | | --- a/f4a |
|
1395 | | | | --- a/f4a | |
1405 | | | | +++ b/f4a |
|
1396 | | | | +++ b/f4a | |
1406 | | | | @@ -1,1 +1,1 @@ |
|
1397 | | | | @@ -1,1 +1,1 @@ | |
1407 | | | | -c4a |
|
1398 | | | | -c4a | |
1408 | | | | +c4d |
|
1399 | | | | +c4d | |
1409 | | | | |
|
1400 | | | | | |
1410 | | | o changeset: 4:c9763722f9bd |
|
1401 | | | o changeset: 4:c9763722f9bd | |
1411 | | |/ parent: 0:11f7a1b56675 |
|
1402 | | |/ parent: 0:11f7a1b56675 | |
1412 | | | user: test |
|
1403 | | | user: test | |
1413 | | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1404 | | | date: Thu Jan 01 00:00:00 1970 +0000 | |
1414 | | | files: f1a f2a f2c f5a |
|
1405 | | | files: f1a f2a f2c f5a | |
1415 | | | copies: f2c (f2a) |
|
1406 | | | copies: f2c (f2a) | |
1416 | | | description: |
|
1407 | | | description: | |
1417 | | | C1 |
|
1408 | | | C1 | |
1418 | | | |
|
1409 | | | | |
1419 | | | |
|
1410 | | | | |
1420 | | | diff --git a/f1a b/f1a |
|
1411 | | | diff --git a/f1a b/f1a | |
1421 | | | --- a/f1a |
|
1412 | | | --- a/f1a | |
1422 | | | +++ b/f1a |
|
1413 | | | +++ b/f1a | |
1423 | | | @@ -1,1 +1,1 @@ |
|
1414 | | | @@ -1,1 +1,1 @@ | |
1424 | | | -c1a |
|
1415 | | | -c1a | |
1425 | | | +c1c |
|
1416 | | | +c1c | |
1426 | | | diff --git a/f2a b/f2c |
|
1417 | | | diff --git a/f2a b/f2c | |
1427 | | | rename from f2a |
|
1418 | | | rename from f2a | |
1428 | | | rename to f2c |
|
1419 | | | rename to f2c | |
1429 | | | diff --git a/f5a b/f5a |
|
1420 | | | diff --git a/f5a b/f5a | |
1430 | | | --- a/f5a |
|
1421 | | | --- a/f5a | |
1431 | | | +++ b/f5a |
|
1422 | | | +++ b/f5a | |
1432 | | | @@ -1,1 +1,1 @@ |
|
1423 | | | @@ -1,1 +1,1 @@ | |
1433 | | | -c5a |
|
1424 | | | -c5a | |
1434 | | | +c5c |
|
1425 | | | +c5c | |
1435 | | | |
|
1426 | | | | |
1436 | +---o changeset: 3:b69f5839d2d9 |
|
1427 | +---o changeset: 3:b69f5839d2d9 | |
1437 | | | user: test |
|
1428 | | | user: test | |
1438 | | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1429 | | | date: Thu Jan 01 00:00:00 1970 +0000 | |
1439 | | | files: f3b f3d f4a |
|
1430 | | | files: f3b f3d f4a | |
1440 | | | copies: f3d (f3b) |
|
1431 | | | copies: f3d (f3b) | |
1441 | | | description: |
|
1432 | | | description: | |
1442 | | | D0 |
|
1433 | | | D0 | |
1443 | | | |
|
1434 | | | | |
1444 | | | |
|
1435 | | | | |
1445 | | | diff --git a/f3b b/f3d |
|
1436 | | | diff --git a/f3b b/f3d | |
1446 | | | rename from f3b |
|
1437 | | | rename from f3b | |
1447 | | | rename to f3d |
|
1438 | | | rename to f3d | |
1448 | | | diff --git a/f4a b/f4a |
|
1439 | | | diff --git a/f4a b/f4a | |
1449 | | | --- a/f4a |
|
1440 | | | --- a/f4a | |
1450 | | | +++ b/f4a |
|
1441 | | | +++ b/f4a | |
1451 | | | @@ -1,1 +1,1 @@ |
|
1442 | | | @@ -1,1 +1,1 @@ | |
1452 | | | -c4a |
|
1443 | | | -c4a | |
1453 | | | +c4d |
|
1444 | | | +c4d | |
1454 | | | |
|
1445 | | | | |
1455 | o | changeset: 2:f58c7e2b28fa |
|
1446 | o | changeset: 2:f58c7e2b28fa | |
1456 | | | user: test |
|
1447 | | | user: test | |
1457 | | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1448 | | | date: Thu Jan 01 00:00:00 1970 +0000 | |
1458 | | | files: f1b f2a f2c f5a f5b |
|
1449 | | | files: f1b f2a f2c f5a f5b | |
1459 | | | copies: f2c (f2a) f5a (f5b) |
|
1450 | | | copies: f2c (f2a) f5a (f5b) | |
1460 | | | description: |
|
1451 | | | description: | |
1461 | | | C0 |
|
1452 | | | C0 | |
1462 | | | |
|
1453 | | | | |
1463 | | | |
|
1454 | | | | |
1464 | | | diff --git a/f1b b/f1b |
|
1455 | | | diff --git a/f1b b/f1b | |
1465 | | | --- a/f1b |
|
1456 | | | --- a/f1b | |
1466 | | | +++ b/f1b |
|
1457 | | | +++ b/f1b | |
1467 | | | @@ -1,1 +1,1 @@ |
|
1458 | | | @@ -1,1 +1,1 @@ | |
1468 | | | -c1a |
|
1459 | | | -c1a | |
1469 | | | +c1c |
|
1460 | | | +c1c | |
1470 | | | diff --git a/f2a b/f2c |
|
1461 | | | diff --git a/f2a b/f2c | |
1471 | | | rename from f2a |
|
1462 | | | rename from f2a | |
1472 | | | rename to f2c |
|
1463 | | | rename to f2c | |
1473 | | | diff --git a/f5b b/f5a |
|
1464 | | | diff --git a/f5b b/f5a | |
1474 | | | rename from f5b |
|
1465 | | | rename from f5b | |
1475 | | | rename to f5a |
|
1466 | | | rename to f5a | |
1476 | | | --- a/f5b |
|
1467 | | | --- a/f5b | |
1477 | | | +++ b/f5a |
|
1468 | | | +++ b/f5a | |
1478 | | | @@ -1,1 +1,1 @@ |
|
1469 | | | @@ -1,1 +1,1 @@ | |
1479 | | | -c5a |
|
1470 | | | -c5a | |
1480 | | | +c5c |
|
1471 | | | +c5c | |
1481 | | | |
|
1472 | | | | |
1482 | o | changeset: 1:3d7bba921b5d |
|
1473 | o | changeset: 1:3d7bba921b5d | |
1483 | |/ user: test |
|
1474 | |/ user: test | |
1484 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1475 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
1485 | | files: f1a f1b f3a f3b f5a f5b |
|
1476 | | files: f1a f1b f3a f3b f5a f5b | |
1486 | | copies: f1b (f1a) f3b (f3a) f5b (f5a) |
|
1477 | | copies: f1b (f1a) f3b (f3a) f5b (f5a) | |
1487 | | description: |
|
1478 | | description: | |
1488 | | B0 |
|
1479 | | B0 | |
1489 | | |
|
1480 | | | |
1490 | | |
|
1481 | | | |
1491 | | diff --git a/f1a b/f1b |
|
1482 | | diff --git a/f1a b/f1b | |
1492 | | rename from f1a |
|
1483 | | rename from f1a | |
1493 | | rename to f1b |
|
1484 | | rename to f1b | |
1494 | | diff --git a/f3a b/f3b |
|
1485 | | diff --git a/f3a b/f3b | |
1495 | | rename from f3a |
|
1486 | | rename from f3a | |
1496 | | rename to f3b |
|
1487 | | rename to f3b | |
1497 | | diff --git a/f5a b/f5b |
|
1488 | | diff --git a/f5a b/f5b | |
1498 | | rename from f5a |
|
1489 | | rename from f5a | |
1499 | | rename to f5b |
|
1490 | | rename to f5b | |
1500 | | |
|
1491 | | | |
1501 | o changeset: 0:11f7a1b56675 |
|
1492 | o changeset: 0:11f7a1b56675 | |
1502 | user: test |
|
1493 | user: test | |
1503 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1494 | date: Thu Jan 01 00:00:00 1970 +0000 | |
1504 | files: f1a f2a f3a f4a f5a |
|
1495 | files: f1a f2a f3a f4a f5a | |
1505 | description: |
|
1496 | description: | |
1506 | A0 |
|
1497 | A0 | |
1507 |
|
1498 | |||
1508 |
|
1499 | |||
1509 | diff --git a/f1a b/f1a |
|
1500 | diff --git a/f1a b/f1a | |
1510 | new file mode 100644 |
|
1501 | new file mode 100644 | |
1511 | --- /dev/null |
|
1502 | --- /dev/null | |
1512 | +++ b/f1a |
|
1503 | +++ b/f1a | |
1513 | @@ -0,0 +1,1 @@ |
|
1504 | @@ -0,0 +1,1 @@ | |
1514 | +c1a |
|
1505 | +c1a | |
1515 | diff --git a/f2a b/f2a |
|
1506 | diff --git a/f2a b/f2a | |
1516 | new file mode 100644 |
|
1507 | new file mode 100644 | |
1517 | --- /dev/null |
|
1508 | --- /dev/null | |
1518 | +++ b/f2a |
|
1509 | +++ b/f2a | |
1519 | @@ -0,0 +1,1 @@ |
|
1510 | @@ -0,0 +1,1 @@ | |
1520 | +c2a |
|
1511 | +c2a | |
1521 | diff --git a/f3a b/f3a |
|
1512 | diff --git a/f3a b/f3a | |
1522 | new file mode 100644 |
|
1513 | new file mode 100644 | |
1523 | --- /dev/null |
|
1514 | --- /dev/null | |
1524 | +++ b/f3a |
|
1515 | +++ b/f3a | |
1525 | @@ -0,0 +1,1 @@ |
|
1516 | @@ -0,0 +1,1 @@ | |
1526 | +c3a |
|
1517 | +c3a | |
1527 | diff --git a/f4a b/f4a |
|
1518 | diff --git a/f4a b/f4a | |
1528 | new file mode 100644 |
|
1519 | new file mode 100644 | |
1529 | --- /dev/null |
|
1520 | --- /dev/null | |
1530 | +++ b/f4a |
|
1521 | +++ b/f4a | |
1531 | @@ -0,0 +1,1 @@ |
|
1522 | @@ -0,0 +1,1 @@ | |
1532 | +c4a |
|
1523 | +c4a | |
1533 | diff --git a/f5a b/f5a |
|
1524 | diff --git a/f5a b/f5a | |
1534 | new file mode 100644 |
|
1525 | new file mode 100644 | |
1535 | --- /dev/null |
|
1526 | --- /dev/null | |
1536 | +++ b/f5a |
|
1527 | +++ b/f5a | |
1537 | @@ -0,0 +1,1 @@ |
|
1528 | @@ -0,0 +1,1 @@ | |
1538 | +c5a |
|
1529 | +c5a | |
1539 |
|
1530 | |||
1540 | Check superfluous filemerge of files renamed in the past but untouched by graft |
|
1531 | Check superfluous filemerge of files renamed in the past but untouched by graft | |
1541 |
|
1532 | |||
1542 | $ echo a > a |
|
1533 | $ echo a > a | |
1543 | $ hg ci -qAma |
|
1534 | $ hg ci -qAma | |
1544 | $ hg mv a b |
|
1535 | $ hg mv a b | |
1545 | $ echo b > b |
|
1536 | $ echo b > b | |
1546 | $ hg ci -qAmb |
|
1537 | $ hg ci -qAmb | |
1547 | $ echo c > c |
|
1538 | $ echo c > c | |
1548 | $ hg ci -qAmc |
|
1539 | $ hg ci -qAmc | |
1549 | $ hg up -q .~2 |
|
1540 | $ hg up -q .~2 | |
1550 | $ hg graft tip -qt:fail |
|
1541 | $ hg graft tip -qt:fail | |
1551 |
|
1542 | |||
1552 | $ cd .. |
|
1543 | $ cd .. | |
1553 |
|
1544 | |||
1554 | Graft a change into a new file previously grafted into a renamed directory |
|
1545 | Graft a change into a new file previously grafted into a renamed directory | |
1555 |
|
1546 | |||
1556 | $ hg init dirmovenewfile |
|
1547 | $ hg init dirmovenewfile | |
1557 | $ cd dirmovenewfile |
|
1548 | $ cd dirmovenewfile | |
1558 | $ mkdir a |
|
1549 | $ mkdir a | |
1559 | $ echo a > a/a |
|
1550 | $ echo a > a/a | |
1560 | $ hg ci -qAma |
|
1551 | $ hg ci -qAma | |
1561 | $ echo x > a/x |
|
1552 | $ echo x > a/x | |
1562 | $ hg ci -qAmx |
|
1553 | $ hg ci -qAmx | |
1563 | $ hg up -q 0 |
|
1554 | $ hg up -q 0 | |
1564 | $ hg mv -q a b |
|
1555 | $ hg mv -q a b | |
1565 | $ hg ci -qAmb |
|
1556 | $ hg ci -qAmb | |
1566 | $ hg graft -q 1 # a/x grafted as b/x, but no copy information recorded |
|
1557 | $ hg graft -q 1 # a/x grafted as b/x, but no copy information recorded | |
1567 | $ hg up -q 1 |
|
1558 | $ hg up -q 1 | |
1568 | $ echo y > a/x |
|
1559 | $ echo y > a/x | |
1569 | $ hg ci -qAmy |
|
1560 | $ hg ci -qAmy | |
1570 | $ hg up -q 3 |
|
1561 | $ hg up -q 3 | |
1571 | $ hg graft -q 4 |
|
1562 | $ hg graft -q 4 | |
1572 | $ hg status --change . |
|
1563 | $ hg status --change . | |
1573 | M b/x |
|
1564 | M b/x | |
1574 |
|
1565 | |||
1575 | Prepare for test of skipped changesets and how merges can influence it: |
|
1566 | Prepare for test of skipped changesets and how merges can influence it: | |
1576 |
|
1567 | |||
1577 | $ hg merge -q -r 1 --tool :local |
|
1568 | $ hg merge -q -r 1 --tool :local | |
1578 | $ hg ci -m m |
|
1569 | $ hg ci -m m | |
1579 | $ echo xx >> b/x |
|
1570 | $ echo xx >> b/x | |
1580 | $ hg ci -m xx |
|
1571 | $ hg ci -m xx | |
1581 |
|
1572 | |||
1582 | $ hg log -G -T '{rev} {desc|firstline}' |
|
1573 | $ hg log -G -T '{rev} {desc|firstline}' | |
1583 | @ 7 xx |
|
1574 | @ 7 xx | |
1584 | | |
|
1575 | | | |
1585 | o 6 m |
|
1576 | o 6 m | |
1586 | |\ |
|
1577 | |\ | |
1587 | | o 5 y |
|
1578 | | o 5 y | |
1588 | | | |
|
1579 | | | | |
1589 | +---o 4 y |
|
1580 | +---o 4 y | |
1590 | | | |
|
1581 | | | | |
1591 | | o 3 x |
|
1582 | | o 3 x | |
1592 | | | |
|
1583 | | | | |
1593 | | o 2 b |
|
1584 | | o 2 b | |
1594 | | | |
|
1585 | | | | |
1595 | o | 1 x |
|
1586 | o | 1 x | |
1596 | |/ |
|
1587 | |/ | |
1597 | o 0 a |
|
1588 | o 0 a | |
1598 |
|
1589 | |||
1599 | Grafting of plain changes correctly detects that 3 and 5 should be skipped: |
|
1590 | Grafting of plain changes correctly detects that 3 and 5 should be skipped: | |
1600 |
|
1591 | |||
1601 | $ hg up -qCr 4 |
|
1592 | $ hg up -qCr 4 | |
1602 | $ hg graft --tool :local -r 2::5 |
|
1593 | $ hg graft --tool :local -r 2::5 | |
1603 | skipping already grafted revision 3:ca093ca2f1d9 (was grafted from 1:13ec5badbf2a) |
|
1594 | skipping already grafted revision 3:ca093ca2f1d9 (was grafted from 1:13ec5badbf2a) | |
1604 | skipping already grafted revision 5:43e9eb70dab0 (was grafted from 4:6c9a1289e5f1) |
|
1595 | skipping already grafted revision 5:43e9eb70dab0 (was grafted from 4:6c9a1289e5f1) | |
1605 | grafting 2:42127f193bcd "b" |
|
1596 | grafting 2:42127f193bcd "b" | |
1606 |
|
1597 | |||
1607 | Extending the graft range to include a (skipped) merge of 3 will not prevent us from |
|
1598 | Extending the graft range to include a (skipped) merge of 3 will not prevent us from | |
1608 | also detecting that both 3 and 5 should be skipped: |
|
1599 | also detecting that both 3 and 5 should be skipped: | |
1609 |
|
1600 | |||
1610 | $ hg up -qCr 4 |
|
1601 | $ hg up -qCr 4 | |
1611 | $ hg graft --tool :local -r 2::7 |
|
1602 | $ hg graft --tool :local -r 2::7 | |
1612 | skipping ungraftable merge revision 6 |
|
1603 | skipping ungraftable merge revision 6 | |
1613 | skipping already grafted revision 3:ca093ca2f1d9 (was grafted from 1:13ec5badbf2a) |
|
1604 | skipping already grafted revision 3:ca093ca2f1d9 (was grafted from 1:13ec5badbf2a) | |
1614 | skipping already grafted revision 5:43e9eb70dab0 (was grafted from 4:6c9a1289e5f1) |
|
1605 | skipping already grafted revision 5:43e9eb70dab0 (was grafted from 4:6c9a1289e5f1) | |
1615 | grafting 2:42127f193bcd "b" |
|
1606 | grafting 2:42127f193bcd "b" | |
1616 | grafting 7:d3c3f2b38ecc "xx" |
|
1607 | grafting 7:d3c3f2b38ecc "xx" | |
1617 | note: graft of 7:d3c3f2b38ecc created no changes to commit |
|
1608 | note: graft of 7:d3c3f2b38ecc created no changes to commit | |
1618 |
|
1609 | |||
1619 | $ cd .. |
|
1610 | $ cd .. | |
1620 |
|
1611 | |||
1621 | Grafted revision should be warned and skipped only once. (issue6024) |
|
1612 | Grafted revision should be warned and skipped only once. (issue6024) | |
1622 |
|
1613 | |||
1623 | $ mkdir issue6024 |
|
1614 | $ mkdir issue6024 | |
1624 | $ cd issue6024 |
|
1615 | $ cd issue6024 | |
1625 |
|
1616 | |||
1626 | $ hg init base |
|
1617 | $ hg init base | |
1627 | $ cd base |
|
1618 | $ cd base | |
1628 | $ touch x |
|
1619 | $ touch x | |
1629 | $ hg commit -qAminit |
|
1620 | $ hg commit -qAminit | |
1630 | $ echo a > x |
|
1621 | $ echo a > x | |
1631 | $ hg commit -mchange |
|
1622 | $ hg commit -mchange | |
1632 | $ hg update -q 0 |
|
1623 | $ hg update -q 0 | |
1633 | $ hg graft -r 1 |
|
1624 | $ hg graft -r 1 | |
1634 | grafting 1:a0b923c546aa "change" (tip) |
|
1625 | grafting 1:a0b923c546aa "change" (tip) | |
1635 | $ cd .. |
|
1626 | $ cd .. | |
1636 |
|
1627 | |||
1637 | $ hg clone -qr 2 base clone |
|
1628 | $ hg clone -qr 2 base clone | |
1638 | $ cd clone |
|
1629 | $ cd clone | |
1639 | $ hg pull -q |
|
1630 | $ hg pull -q | |
1640 | $ hg merge -q 2 |
|
1631 | $ hg merge -q 2 | |
1641 | $ hg commit -mmerge |
|
1632 | $ hg commit -mmerge | |
1642 | $ hg update -q 0 |
|
1633 | $ hg update -q 0 | |
1643 | $ hg graft -r 1 |
|
1634 | $ hg graft -r 1 | |
1644 | grafting 1:04fc6d444368 "change" |
|
1635 | grafting 1:04fc6d444368 "change" | |
1645 | $ hg update -q 3 |
|
1636 | $ hg update -q 3 | |
1646 | $ hg log -G -T '{rev}:{node|shortest} <- {extras.source|shortest}\n' |
|
1637 | $ hg log -G -T '{rev}:{node|shortest} <- {extras.source|shortest}\n' | |
1647 | o 4:4e16 <- a0b9 |
|
1638 | o 4:4e16 <- a0b9 | |
1648 | | |
|
1639 | | | |
1649 | | @ 3:f0ac <- |
|
1640 | | @ 3:f0ac <- | |
1650 | | |\ |
|
1641 | | |\ | |
1651 | +---o 2:a0b9 <- |
|
1642 | +---o 2:a0b9 <- | |
1652 | | | |
|
1643 | | | | |
1653 | | o 1:04fc <- a0b9 |
|
1644 | | o 1:04fc <- a0b9 | |
1654 | |/ |
|
1645 | |/ | |
1655 | o 0:7848 <- |
|
1646 | o 0:7848 <- | |
1656 |
|
1647 | |||
1657 |
|
1648 | |||
1658 | the source of rev 4 is an ancestor of the working parent, and was also |
|
1649 | the source of rev 4 is an ancestor of the working parent, and was also | |
1659 | grafted as rev 1. it should be stripped from the target revisions only once. |
|
1650 | grafted as rev 1. it should be stripped from the target revisions only once. | |
1660 |
|
1651 | |||
1661 | $ hg graft -r 4 |
|
1652 | $ hg graft -r 4 | |
1662 | skipping already grafted revision 4:4e16bab40c9c (1:04fc6d444368 also has origin 2:a0b923c546aa) |
|
1653 | skipping already grafted revision 4:4e16bab40c9c (1:04fc6d444368 also has origin 2:a0b923c546aa) | |
1663 | [255] |
|
1654 | [255] | |
1664 |
|
1655 | |||
1665 | $ cd ../.. |
|
1656 | $ cd ../.. | |
1666 |
|
||||
1667 | Testing the reading of old format graftstate file with newer mercurial |
|
|||
1668 |
|
||||
1669 | $ hg init oldgraft |
|
|||
1670 | $ cd oldgraft |
|
|||
1671 | $ for ch in a b c; do echo foo > $ch; hg add $ch; hg ci -Aqm "added "$ch; done; |
|
|||
1672 | $ hg log -GT "{rev}:{node|short} {desc}\n" |
|
|||
1673 | @ 2:8be98ac1a569 added c |
|
|||
1674 | | |
|
|||
1675 | o 1:80e6d2c47cfe added b |
|
|||
1676 | | |
|
|||
1677 | o 0:f7ad41964313 added a |
|
|||
1678 |
|
||||
1679 | $ hg up 0 |
|
|||
1680 | 0 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
|||
1681 | $ echo bar > b |
|
|||
1682 | $ hg add b |
|
|||
1683 | $ hg ci -m "bar to b" |
|
|||
1684 | created new head |
|
|||
1685 | $ hg graft -r 1 -r 2 |
|
|||
1686 | grafting 1:80e6d2c47cfe "added b" |
|
|||
1687 | merging b |
|
|||
1688 | warning: conflicts while merging b! (edit, then use 'hg resolve --mark') |
|
|||
1689 | abort: unresolved conflicts, can't continue |
|
|||
1690 | (use 'hg resolve' and 'hg graft --continue') |
|
|||
1691 | [255] |
|
|||
1692 |
|
||||
1693 | Writing the nodes in old format to graftstate |
|
|||
1694 |
|
||||
1695 | $ hg log -r 1 -r 2 -T '{node}\n' > .hg/graftstate |
|
|||
1696 | $ echo foo > b |
|
|||
1697 | $ hg resolve -m |
|
|||
1698 | (no more unresolved files) |
|
|||
1699 | continue: hg graft --continue |
|
|||
1700 | $ hg graft --continue |
|
|||
1701 | grafting 1:80e6d2c47cfe "added b" |
|
|||
1702 | grafting 2:8be98ac1a569 "added c" |
|
|||
1703 |
|
||||
1704 | Testing that --user is preserved during conflicts and value is reused while |
|
|||
1705 | running `hg graft --continue` |
|
|||
1706 |
|
||||
1707 | $ hg log -G |
|
|||
1708 | @ changeset: 5:711e9fa999f1 |
|
|||
1709 | | tag: tip |
|
|||
1710 | | user: test |
|
|||
1711 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
|||
1712 | | summary: added c |
|
|||
1713 | | |
|
|||
1714 | o changeset: 4:e5ad7353b408 |
|
|||
1715 | | user: test |
|
|||
1716 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
|||
1717 | | summary: added b |
|
|||
1718 | | |
|
|||
1719 | o changeset: 3:9e887f7a939c |
|
|||
1720 | | parent: 0:f7ad41964313 |
|
|||
1721 | | user: test |
|
|||
1722 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
|||
1723 | | summary: bar to b |
|
|||
1724 | | |
|
|||
1725 | | o changeset: 2:8be98ac1a569 |
|
|||
1726 | | | user: test |
|
|||
1727 | | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
|||
1728 | | | summary: added c |
|
|||
1729 | | | |
|
|||
1730 | | o changeset: 1:80e6d2c47cfe |
|
|||
1731 | |/ user: test |
|
|||
1732 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
|||
1733 | | summary: added b |
|
|||
1734 | | |
|
|||
1735 | o changeset: 0:f7ad41964313 |
|
|||
1736 | user: test |
|
|||
1737 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
|||
1738 | summary: added a |
|
|||
1739 |
|
||||
1740 |
|
||||
1741 | $ hg up '.^^' |
|
|||
1742 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
|||
1743 |
|
||||
1744 | $ hg graft -r 1 -r 2 --user batman |
|
|||
1745 | grafting 1:80e6d2c47cfe "added b" |
|
|||
1746 | merging b |
|
|||
1747 | warning: conflicts while merging b! (edit, then use 'hg resolve --mark') |
|
|||
1748 | abort: unresolved conflicts, can't continue |
|
|||
1749 | (use 'hg resolve' and 'hg graft --continue') |
|
|||
1750 | [255] |
|
|||
1751 |
|
||||
1752 | $ echo wat > b |
|
|||
1753 | $ hg resolve -m |
|
|||
1754 | (no more unresolved files) |
|
|||
1755 | continue: hg graft --continue |
|
|||
1756 |
|
||||
1757 | $ hg graft --continue |
|
|||
1758 | grafting 1:80e6d2c47cfe "added b" |
|
|||
1759 | grafting 2:8be98ac1a569 "added c" |
|
|||
1760 |
|
||||
1761 | $ hg log -Gr 3:: |
|
|||
1762 | @ changeset: 7:11a36ffaacf2 |
|
|||
1763 | | tag: tip |
|
|||
1764 | | user: batman |
|
|||
1765 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
|||
1766 | | summary: added c |
|
|||
1767 | | |
|
|||
1768 | o changeset: 6:76803afc6511 |
|
|||
1769 | | parent: 3:9e887f7a939c |
|
|||
1770 | | user: batman |
|
|||
1771 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
|||
1772 | | summary: added b |
|
|||
1773 | | |
|
|||
1774 | | o changeset: 5:711e9fa999f1 |
|
|||
1775 | | | user: test |
|
|||
1776 | | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
|||
1777 | | | summary: added c |
|
|||
1778 | | | |
|
|||
1779 | | o changeset: 4:e5ad7353b408 |
|
|||
1780 | |/ user: test |
|
|||
1781 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
|||
1782 | | summary: added b |
|
|||
1783 | | |
|
|||
1784 | o changeset: 3:9e887f7a939c |
|
|||
1785 | | parent: 0:f7ad41964313 |
|
|||
1786 | ~ user: test |
|
|||
1787 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
|||
1788 | summary: bar to b |
|
|||
1789 |
|
||||
1790 | Test that --date is preserved and reused in `hg graft --continue` |
|
|||
1791 |
|
||||
1792 | $ hg up '.^^' |
|
|||
1793 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
|||
1794 | $ hg graft -r 1 -r 2 --date '1234560000 120' |
|
|||
1795 | grafting 1:80e6d2c47cfe "added b" |
|
|||
1796 | merging b |
|
|||
1797 | warning: conflicts while merging b! (edit, then use 'hg resolve --mark') |
|
|||
1798 | abort: unresolved conflicts, can't continue |
|
|||
1799 | (use 'hg resolve' and 'hg graft --continue') |
|
|||
1800 | [255] |
|
|||
1801 |
|
||||
1802 | $ echo foobar > b |
|
|||
1803 | $ hg resolve -m |
|
|||
1804 | (no more unresolved files) |
|
|||
1805 | continue: hg graft --continue |
|
|||
1806 | $ hg graft --continue |
|
|||
1807 | grafting 1:80e6d2c47cfe "added b" |
|
|||
1808 | grafting 2:8be98ac1a569 "added c" |
|
|||
1809 |
|
||||
1810 | $ hg log -Gr '.^^::.' |
|
|||
1811 | @ changeset: 9:1896b76e007a |
|
|||
1812 | | tag: tip |
|
|||
1813 | | user: test |
|
|||
1814 | | date: Fri Feb 13 21:18:00 2009 -0002 |
|
|||
1815 | | summary: added c |
|
|||
1816 | | |
|
|||
1817 | o changeset: 8:ce2b4f1632af |
|
|||
1818 | | parent: 3:9e887f7a939c |
|
|||
1819 | | user: test |
|
|||
1820 | | date: Fri Feb 13 21:18:00 2009 -0002 |
|
|||
1821 | | summary: added b |
|
|||
1822 | | |
|
|||
1823 | o changeset: 3:9e887f7a939c |
|
|||
1824 | | parent: 0:f7ad41964313 |
|
|||
1825 | ~ user: test |
|
|||
1826 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
|||
1827 | summary: bar to b |
|
|||
1828 |
|
||||
1829 | Test that --log is preserved and reused in `hg graft --continue` |
|
|||
1830 |
|
||||
1831 | $ hg up '.^^' |
|
|||
1832 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
|||
1833 | $ hg graft -r 1 -r 2 --log |
|
|||
1834 | grafting 1:80e6d2c47cfe "added b" |
|
|||
1835 | merging b |
|
|||
1836 | warning: conflicts while merging b! (edit, then use 'hg resolve --mark') |
|
|||
1837 | abort: unresolved conflicts, can't continue |
|
|||
1838 | (use 'hg resolve' and 'hg graft --continue') |
|
|||
1839 | [255] |
|
|||
1840 |
|
||||
1841 | $ echo foobar > b |
|
|||
1842 | $ hg resolve -m |
|
|||
1843 | (no more unresolved files) |
|
|||
1844 | continue: hg graft --continue |
|
|||
1845 |
|
||||
1846 | $ hg graft --continue |
|
|||
1847 | grafting 1:80e6d2c47cfe "added b" |
|
|||
1848 | grafting 2:8be98ac1a569 "added c" |
|
|||
1849 |
|
||||
1850 | $ hg log -GT "{rev}:{node|short} {desc}" -r '.^^::.' |
|
|||
1851 | @ 11:30c1050a58b2 added c |
|
|||
1852 | | (grafted from 8be98ac1a56990c2d9ca6861041b8390af7bd6f3) |
|
|||
1853 | o 10:ec7eda2313e2 added b |
|
|||
1854 | | (grafted from 80e6d2c47cfe5b3185519568327a17a061c7efb6) |
|
|||
1855 | o 3:9e887f7a939c bar to b |
|
|||
1856 | | |
|
|||
1857 | ~ |
|
|||
1858 |
|
||||
1859 | $ cd .. |
|
|||
1860 |
|
||||
1861 | Testing the --stop flag of `hg graft` which stops the interrupted graft |
|
|||
1862 |
|
||||
1863 | $ hg init stopgraft |
|
|||
1864 | $ cd stopgraft |
|
|||
1865 | $ for ch in a b c d; do echo $ch > $ch; hg add $ch; hg ci -Aqm "added "$ch; done; |
|
|||
1866 |
|
||||
1867 | $ hg log -G |
|
|||
1868 | @ changeset: 3:9150fe93bec6 |
|
|||
1869 | | tag: tip |
|
|||
1870 | | user: test |
|
|||
1871 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
|||
1872 | | summary: added d |
|
|||
1873 | | |
|
|||
1874 | o changeset: 2:155349b645be |
|
|||
1875 | | user: test |
|
|||
1876 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
|||
1877 | | summary: added c |
|
|||
1878 | | |
|
|||
1879 | o changeset: 1:5f6d8a4bf34a |
|
|||
1880 | | user: test |
|
|||
1881 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
|||
1882 | | summary: added b |
|
|||
1883 | | |
|
|||
1884 | o changeset: 0:9092f1db7931 |
|
|||
1885 | user: test |
|
|||
1886 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
|||
1887 | summary: added a |
|
|||
1888 |
|
||||
1889 | $ hg up '.^^' |
|
|||
1890 | 0 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
|||
1891 |
|
||||
1892 | $ echo foo > d |
|
|||
1893 | $ hg ci -Aqm "added foo to d" |
|
|||
1894 |
|
||||
1895 | $ hg graft --stop |
|
|||
1896 | abort: no interrupted graft found |
|
|||
1897 | [255] |
|
|||
1898 |
|
||||
1899 | $ hg graft -r 3 |
|
|||
1900 | grafting 3:9150fe93bec6 "added d" |
|
|||
1901 | merging d |
|
|||
1902 | warning: conflicts while merging d! (edit, then use 'hg resolve --mark') |
|
|||
1903 | abort: unresolved conflicts, can't continue |
|
|||
1904 | (use 'hg resolve' and 'hg graft --continue') |
|
|||
1905 | [255] |
|
|||
1906 |
|
||||
1907 | $ hg graft --stop --continue |
|
|||
1908 | abort: cannot use '--continue' and '--stop' together |
|
|||
1909 | [255] |
|
|||
1910 |
|
||||
1911 | $ hg graft --stop -U |
|
|||
1912 | abort: cannot specify any other flag with '--stop' |
|
|||
1913 | [255] |
|
|||
1914 | $ hg graft --stop --rev 4 |
|
|||
1915 | abort: cannot specify any other flag with '--stop' |
|
|||
1916 | [255] |
|
|||
1917 | $ hg graft --stop --log |
|
|||
1918 | abort: cannot specify any other flag with '--stop' |
|
|||
1919 | [255] |
|
|||
1920 |
|
||||
1921 | $ hg graft --stop |
|
|||
1922 | stopped the interrupted graft |
|
|||
1923 | working directory is now at a0deacecd59d |
|
|||
1924 |
|
||||
1925 | $ hg diff |
|
|||
1926 |
|
||||
1927 | $ hg log -Gr '.' |
|
|||
1928 | @ changeset: 4:a0deacecd59d |
|
|||
1929 | | tag: tip |
|
|||
1930 | ~ parent: 1:5f6d8a4bf34a |
|
|||
1931 | user: test |
|
|||
1932 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
|||
1933 | summary: added foo to d |
|
|||
1934 |
|
||||
1935 | $ hg graft -r 2 -r 3 |
|
|||
1936 | grafting 2:155349b645be "added c" |
|
|||
1937 | grafting 3:9150fe93bec6 "added d" |
|
|||
1938 | merging d |
|
|||
1939 | warning: conflicts while merging d! (edit, then use 'hg resolve --mark') |
|
|||
1940 | abort: unresolved conflicts, can't continue |
|
|||
1941 | (use 'hg resolve' and 'hg graft --continue') |
|
|||
1942 | [255] |
|
|||
1943 |
|
||||
1944 | $ hg graft --stop |
|
|||
1945 | stopped the interrupted graft |
|
|||
1946 | working directory is now at 75b447541a9e |
|
|||
1947 |
|
||||
1948 | $ hg diff |
|
|||
1949 |
|
||||
1950 | $ hg log -G -T "{rev}:{node|short} {desc}" |
|
|||
1951 | @ 5:75b447541a9e added c |
|
|||
1952 | | |
|
|||
1953 | o 4:a0deacecd59d added foo to d |
|
|||
1954 | | |
|
|||
1955 | | o 3:9150fe93bec6 added d |
|
|||
1956 | | | |
|
|||
1957 | | o 2:155349b645be added c |
|
|||
1958 | |/ |
|
|||
1959 | o 1:5f6d8a4bf34a added b |
|
|||
1960 | | |
|
|||
1961 | o 0:9092f1db7931 added a |
|
|||
1962 |
|
||||
1963 | $ cd .. |
|
|||
1964 |
|
||||
1965 | Testing the --abort flag for `hg graft` which aborts and rollback to state |
|
|||
1966 | before the graft |
|
|||
1967 |
|
||||
1968 | $ hg init abortgraft |
|
|||
1969 | $ cd abortgraft |
|
|||
1970 | $ for ch in a b c d; do echo $ch > $ch; hg add $ch; hg ci -Aqm "added "$ch; done; |
|
|||
1971 |
|
||||
1972 | $ hg up '.^^' |
|
|||
1973 | 0 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
|||
1974 |
|
||||
1975 | $ echo x > x |
|
|||
1976 | $ hg ci -Aqm "added x" |
|
|||
1977 | $ hg up '.^' |
|
|||
1978 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
|||
1979 | $ echo foo > c |
|
|||
1980 | $ hg ci -Aqm "added foo to c" |
|
|||
1981 |
|
||||
1982 | $ hg log -GT "{rev}:{node|short} {desc}" |
|
|||
1983 | @ 5:36b793615f78 added foo to c |
|
|||
1984 | | |
|
|||
1985 | | o 4:863a25e1a9ea added x |
|
|||
1986 | |/ |
|
|||
1987 | | o 3:9150fe93bec6 added d |
|
|||
1988 | | | |
|
|||
1989 | | o 2:155349b645be added c |
|
|||
1990 | |/ |
|
|||
1991 | o 1:5f6d8a4bf34a added b |
|
|||
1992 | | |
|
|||
1993 | o 0:9092f1db7931 added a |
|
|||
1994 |
|
||||
1995 | $ hg up 9150fe93bec6 |
|
|||
1996 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
|||
1997 |
|
||||
1998 | $ hg abort |
|
|||
1999 | abort: no interrupted graft to abort (abortflag !) |
|
|||
2000 | abort: no operation in progress (abortcommand !) |
|
|||
2001 | [255] |
|
|||
2002 |
|
||||
2003 | when stripping is required |
|
|||
2004 | $ hg graft -r 4 -r 5 |
|
|||
2005 | grafting 4:863a25e1a9ea "added x" |
|
|||
2006 | grafting 5:36b793615f78 "added foo to c" (tip) |
|
|||
2007 | merging c |
|
|||
2008 | warning: conflicts while merging c! (edit, then use 'hg resolve --mark') |
|
|||
2009 | abort: unresolved conflicts, can't continue |
|
|||
2010 | (use 'hg resolve' and 'hg graft --continue') |
|
|||
2011 | [255] |
|
|||
2012 |
|
||||
2013 | $ hg graft --continue --abort |
|
|||
2014 | abort: cannot use '--continue' and '--abort' together |
|
|||
2015 | [255] |
|
|||
2016 |
|
||||
2017 | $ hg graft --abort --stop |
|
|||
2018 | abort: cannot use '--abort' and '--stop' together |
|
|||
2019 | [255] |
|
|||
2020 |
|
||||
2021 | $ hg graft --abort --currentuser |
|
|||
2022 | abort: cannot specify any other flag with '--abort' |
|
|||
2023 | [255] |
|
|||
2024 |
|
||||
2025 | $ hg graft --abort --edit |
|
|||
2026 | abort: cannot specify any other flag with '--abort' |
|
|||
2027 | [255] |
|
|||
2028 |
|
||||
2029 | #if abortcommand |
|
|||
2030 | when in dry-run mode |
|
|||
2031 | $ hg abort --dry-run |
|
|||
2032 | graft in progress, will be aborted |
|
|||
2033 | #endif |
|
|||
2034 |
|
||||
2035 | $ hg abort |
|
|||
2036 | graft aborted |
|
|||
2037 | working directory is now at 9150fe93bec6 |
|
|||
2038 | $ hg log -GT "{rev}:{node|short} {desc}" |
|
|||
2039 | o 5:36b793615f78 added foo to c |
|
|||
2040 | | |
|
|||
2041 | | o 4:863a25e1a9ea added x |
|
|||
2042 | |/ |
|
|||
2043 | | @ 3:9150fe93bec6 added d |
|
|||
2044 | | | |
|
|||
2045 | | o 2:155349b645be added c |
|
|||
2046 | |/ |
|
|||
2047 | o 1:5f6d8a4bf34a added b |
|
|||
2048 | | |
|
|||
2049 | o 0:9092f1db7931 added a |
|
|||
2050 |
|
||||
2051 | when stripping is not required |
|
|||
2052 | $ hg graft -r 5 |
|
|||
2053 | grafting 5:36b793615f78 "added foo to c" (tip) |
|
|||
2054 | merging c |
|
|||
2055 | warning: conflicts while merging c! (edit, then use 'hg resolve --mark') |
|
|||
2056 | abort: unresolved conflicts, can't continue |
|
|||
2057 | (use 'hg resolve' and 'hg graft --continue') |
|
|||
2058 | [255] |
|
|||
2059 |
|
||||
2060 | $ hg abort |
|
|||
2061 | graft aborted |
|
|||
2062 | working directory is now at 9150fe93bec6 |
|
|||
2063 | $ hg log -GT "{rev}:{node|short} {desc}" |
|
|||
2064 | o 5:36b793615f78 added foo to c |
|
|||
2065 | | |
|
|||
2066 | | o 4:863a25e1a9ea added x |
|
|||
2067 | |/ |
|
|||
2068 | | @ 3:9150fe93bec6 added d |
|
|||
2069 | | | |
|
|||
2070 | | o 2:155349b645be added c |
|
|||
2071 | |/ |
|
|||
2072 | o 1:5f6d8a4bf34a added b |
|
|||
2073 | | |
|
|||
2074 | o 0:9092f1db7931 added a |
|
|||
2075 |
|
||||
2076 | when some of the changesets became public |
|
|||
2077 |
|
||||
2078 | $ hg graft -r 4 -r 5 |
|
|||
2079 | grafting 4:863a25e1a9ea "added x" |
|
|||
2080 | grafting 5:36b793615f78 "added foo to c" (tip) |
|
|||
2081 | merging c |
|
|||
2082 | warning: conflicts while merging c! (edit, then use 'hg resolve --mark') |
|
|||
2083 | abort: unresolved conflicts, can't continue |
|
|||
2084 | (use 'hg resolve' and 'hg graft --continue') |
|
|||
2085 | [255] |
|
|||
2086 |
|
||||
2087 | $ hg log -GT "{rev}:{node|short} {desc}" |
|
|||
2088 | @ 6:6ec71c037d94 added x |
|
|||
2089 | | |
|
|||
2090 | | o 5:36b793615f78 added foo to c |
|
|||
2091 | | | |
|
|||
2092 | | | o 4:863a25e1a9ea added x |
|
|||
2093 | | |/ |
|
|||
2094 | o | 3:9150fe93bec6 added d |
|
|||
2095 | | | |
|
|||
2096 | o | 2:155349b645be added c |
|
|||
2097 | |/ |
|
|||
2098 | o 1:5f6d8a4bf34a added b |
|
|||
2099 | | |
|
|||
2100 | o 0:9092f1db7931 added a |
|
|||
2101 |
|
||||
2102 | $ hg phase -r 6 --public |
|
|||
2103 |
|
||||
2104 | $ hg abort |
|
|||
2105 | cannot clean up public changesets 6ec71c037d94 |
|
|||
2106 | graft aborted |
|
|||
2107 | working directory is now at 6ec71c037d94 |
|
|||
2108 |
|
||||
2109 | when we created new changesets on top of existing one |
|
|||
2110 |
|
||||
2111 | $ hg up '.^^' |
|
|||
2112 | 0 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
|||
2113 | $ echo y > y |
|
|||
2114 | $ hg ci -Aqm "added y" |
|
|||
2115 | $ echo z > z |
|
|||
2116 | $ hg ci -Aqm "added z" |
|
|||
2117 |
|
||||
2118 | $ hg up 3 |
|
|||
2119 | 1 files updated, 0 files merged, 3 files removed, 0 files unresolved |
|
|||
2120 | $ hg log -GT "{rev}:{node|short} {desc}" |
|
|||
2121 | o 8:637f9e9bbfd4 added z |
|
|||
2122 | | |
|
|||
2123 | o 7:123221671fd4 added y |
|
|||
2124 | | |
|
|||
2125 | | o 6:6ec71c037d94 added x |
|
|||
2126 | | | |
|
|||
2127 | | | o 5:36b793615f78 added foo to c |
|
|||
2128 | | | | |
|
|||
2129 | | | | o 4:863a25e1a9ea added x |
|
|||
2130 | | | |/ |
|
|||
2131 | | @ | 3:9150fe93bec6 added d |
|
|||
2132 | |/ / |
|
|||
2133 | o / 2:155349b645be added c |
|
|||
2134 | |/ |
|
|||
2135 | o 1:5f6d8a4bf34a added b |
|
|||
2136 | | |
|
|||
2137 | o 0:9092f1db7931 added a |
|
|||
2138 |
|
||||
2139 | $ hg graft -r 8 -r 7 -r 5 |
|
|||
2140 | grafting 8:637f9e9bbfd4 "added z" (tip) |
|
|||
2141 | grafting 7:123221671fd4 "added y" |
|
|||
2142 | grafting 5:36b793615f78 "added foo to c" |
|
|||
2143 | merging c |
|
|||
2144 | warning: conflicts while merging c! (edit, then use 'hg resolve --mark') |
|
|||
2145 | abort: unresolved conflicts, can't continue |
|
|||
2146 | (use 'hg resolve' and 'hg graft --continue') |
|
|||
2147 | [255] |
|
|||
2148 |
|
||||
2149 | $ cd .. |
|
|||
2150 | $ hg init pullrepo |
|
|||
2151 | $ cd pullrepo |
|
|||
2152 | $ cat >> .hg/hgrc <<EOF |
|
|||
2153 | > [phases] |
|
|||
2154 | > publish=False |
|
|||
2155 | > EOF |
|
|||
2156 | $ hg pull ../abortgraft --config phases.publish=False |
|
|||
2157 | pulling from ../abortgraft |
|
|||
2158 | requesting all changes |
|
|||
2159 | adding changesets |
|
|||
2160 | adding manifests |
|
|||
2161 | adding file changes |
|
|||
2162 | added 11 changesets with 9 changes to 8 files (+4 heads) |
|
|||
2163 | new changesets 9092f1db7931:6b98ff0062dd (6 drafts) |
|
|||
2164 | (run 'hg heads' to see heads, 'hg merge' to merge) |
|
|||
2165 | $ hg up 9 |
|
|||
2166 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
|||
2167 | $ echo w > w |
|
|||
2168 | $ hg ci -Aqm "added w" --config phases.publish=False |
|
|||
2169 |
|
||||
2170 | $ cd ../abortgraft |
|
|||
2171 | $ hg pull ../pullrepo |
|
|||
2172 | pulling from ../pullrepo |
|
|||
2173 | searching for changes |
|
|||
2174 | adding changesets |
|
|||
2175 | adding manifests |
|
|||
2176 | adding file changes |
|
|||
2177 | added 1 changesets with 1 changes to 1 files (+1 heads) |
|
|||
2178 | new changesets 311dfc6cf3bf (1 drafts) |
|
|||
2179 | (run 'hg heads .' to see heads, 'hg merge' to merge) |
|
|||
2180 |
|
||||
2181 | $ hg abort |
|
|||
2182 | new changesets detected on destination branch, can't strip |
|
|||
2183 | graft aborted |
|
|||
2184 | working directory is now at 6b98ff0062dd |
|
|||
2185 |
|
||||
2186 | $ cd .. |
|
|||
2187 |
|
||||
2188 | ============================ |
|
|||
2189 | Testing --no-commit option:| |
|
|||
2190 | ============================ |
|
|||
2191 |
|
||||
2192 | $ hg init nocommit |
|
|||
2193 | $ cd nocommit |
|
|||
2194 | $ echo a > a |
|
|||
2195 | $ hg ci -qAma |
|
|||
2196 | $ echo b > b |
|
|||
2197 | $ hg ci -qAmb |
|
|||
2198 | $ hg up -q 0 |
|
|||
2199 | $ echo c > c |
|
|||
2200 | $ hg ci -qAmc |
|
|||
2201 | $ hg log -GT "{rev}:{node|short} {desc}\n" |
|
|||
2202 | @ 2:d36c0562f908 c |
|
|||
2203 | | |
|
|||
2204 | | o 1:d2ae7f538514 b |
|
|||
2205 | |/ |
|
|||
2206 | o 0:cb9a9f314b8b a |
|
|||
2207 |
|
||||
2208 |
|
||||
2209 | Check reporting when --no-commit used with non-applicable options: |
|
|||
2210 |
|
||||
2211 | $ hg graft 1 --no-commit -e |
|
|||
2212 | abort: cannot specify --no-commit and --edit together |
|
|||
2213 | [255] |
|
|||
2214 |
|
||||
2215 | $ hg graft 1 --no-commit --log |
|
|||
2216 | abort: cannot specify --no-commit and --log together |
|
|||
2217 | [255] |
|
|||
2218 |
|
||||
2219 | $ hg graft 1 --no-commit -D |
|
|||
2220 | abort: cannot specify --no-commit and --currentdate together |
|
|||
2221 | [255] |
|
|||
2222 |
|
||||
2223 | Test --no-commit is working: |
|
|||
2224 | $ hg graft 1 --no-commit |
|
|||
2225 | grafting 1:d2ae7f538514 "b" |
|
|||
2226 |
|
||||
2227 | $ hg log -GT "{rev}:{node|short} {desc}\n" |
|
|||
2228 | @ 2:d36c0562f908 c |
|
|||
2229 | | |
|
|||
2230 | | o 1:d2ae7f538514 b |
|
|||
2231 | |/ |
|
|||
2232 | o 0:cb9a9f314b8b a |
|
|||
2233 |
|
||||
2234 |
|
||||
2235 | $ hg diff |
|
|||
2236 | diff -r d36c0562f908 b |
|
|||
2237 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
|||
2238 | +++ b/b Thu Jan 01 00:00:00 1970 +0000 |
|
|||
2239 | @@ -0,0 +1,1 @@ |
|
|||
2240 | +b |
|
|||
2241 |
|
||||
2242 | Prepare wrdir to check --no-commit is resepected after --continue: |
|
|||
2243 |
|
||||
2244 | $ hg up -qC |
|
|||
2245 | $ echo A>a |
|
|||
2246 | $ hg ci -qm "A in file a" |
|
|||
2247 | $ hg up -q 1 |
|
|||
2248 | $ echo B>a |
|
|||
2249 | $ hg ci -qm "B in file a" |
|
|||
2250 | $ hg log -GT "{rev}:{node|short} {desc}\n" |
|
|||
2251 | @ 4:2aa9ad1006ff B in file a |
|
|||
2252 | | |
|
|||
2253 | | o 3:09e253b87e17 A in file a |
|
|||
2254 | | | |
|
|||
2255 | | o 2:d36c0562f908 c |
|
|||
2256 | | | |
|
|||
2257 | o | 1:d2ae7f538514 b |
|
|||
2258 | |/ |
|
|||
2259 | o 0:cb9a9f314b8b a |
|
|||
2260 |
|
||||
2261 |
|
||||
2262 | $ hg graft 3 --no-commit |
|
|||
2263 | grafting 3:09e253b87e17 "A in file a" |
|
|||
2264 | merging a |
|
|||
2265 | warning: conflicts while merging a! (edit, then use 'hg resolve --mark') |
|
|||
2266 | abort: unresolved conflicts, can't continue |
|
|||
2267 | (use 'hg resolve' and 'hg graft --continue') |
|
|||
2268 | [255] |
|
|||
2269 |
|
||||
2270 | Resolve conflict: |
|
|||
2271 | $ echo A>a |
|
|||
2272 | $ hg resolve --mark |
|
|||
2273 | (no more unresolved files) |
|
|||
2274 | continue: hg graft --continue |
|
|||
2275 |
|
||||
2276 | $ hg graft --continue |
|
|||
2277 | grafting 3:09e253b87e17 "A in file a" |
|
|||
2278 | $ hg log -GT "{rev}:{node|short} {desc}\n" |
|
|||
2279 | @ 4:2aa9ad1006ff B in file a |
|
|||
2280 | | |
|
|||
2281 | | o 3:09e253b87e17 A in file a |
|
|||
2282 | | | |
|
|||
2283 | | o 2:d36c0562f908 c |
|
|||
2284 | | | |
|
|||
2285 | o | 1:d2ae7f538514 b |
|
|||
2286 | |/ |
|
|||
2287 | o 0:cb9a9f314b8b a |
|
|||
2288 |
|
||||
2289 | $ hg diff |
|
|||
2290 | diff -r 2aa9ad1006ff a |
|
|||
2291 | --- a/a Thu Jan 01 00:00:00 1970 +0000 |
|
|||
2292 | +++ b/a Thu Jan 01 00:00:00 1970 +0000 |
|
|||
2293 | @@ -1,1 +1,1 @@ |
|
|||
2294 | -B |
|
|||
2295 | +A |
|
|||
2296 |
|
||||
2297 | $ hg up -qC |
|
|||
2298 |
|
||||
2299 | Check --no-commit is resepected when passed with --continue: |
|
|||
2300 |
|
||||
2301 | $ hg graft 3 |
|
|||
2302 | grafting 3:09e253b87e17 "A in file a" |
|
|||
2303 | merging a |
|
|||
2304 | warning: conflicts while merging a! (edit, then use 'hg resolve --mark') |
|
|||
2305 | abort: unresolved conflicts, can't continue |
|
|||
2306 | (use 'hg resolve' and 'hg graft --continue') |
|
|||
2307 | [255] |
|
|||
2308 |
|
||||
2309 | Resolve conflict: |
|
|||
2310 | $ echo A>a |
|
|||
2311 | $ hg resolve --mark |
|
|||
2312 | (no more unresolved files) |
|
|||
2313 | continue: hg graft --continue |
|
|||
2314 |
|
||||
2315 | $ hg graft --continue --no-commit |
|
|||
2316 | grafting 3:09e253b87e17 "A in file a" |
|
|||
2317 | $ hg diff |
|
|||
2318 | diff -r 2aa9ad1006ff a |
|
|||
2319 | --- a/a Thu Jan 01 00:00:00 1970 +0000 |
|
|||
2320 | +++ b/a Thu Jan 01 00:00:00 1970 +0000 |
|
|||
2321 | @@ -1,1 +1,1 @@ |
|
|||
2322 | -B |
|
|||
2323 | +A |
|
|||
2324 |
|
||||
2325 | $ hg log -GT "{rev}:{node|short} {desc}\n" |
|
|||
2326 | @ 4:2aa9ad1006ff B in file a |
|
|||
2327 | | |
|
|||
2328 | | o 3:09e253b87e17 A in file a |
|
|||
2329 | | | |
|
|||
2330 | | o 2:d36c0562f908 c |
|
|||
2331 | | | |
|
|||
2332 | o | 1:d2ae7f538514 b |
|
|||
2333 | |/ |
|
|||
2334 | o 0:cb9a9f314b8b a |
|
|||
2335 |
|
||||
2336 | $ hg up -qC |
|
|||
2337 |
|
||||
2338 | Test --no-commit when graft multiple revisions: |
|
|||
2339 | When there is conflict: |
|
|||
2340 | $ hg graft -r "2::3" --no-commit |
|
|||
2341 | grafting 2:d36c0562f908 "c" |
|
|||
2342 | grafting 3:09e253b87e17 "A in file a" |
|
|||
2343 | merging a |
|
|||
2344 | warning: conflicts while merging a! (edit, then use 'hg resolve --mark') |
|
|||
2345 | abort: unresolved conflicts, can't continue |
|
|||
2346 | (use 'hg resolve' and 'hg graft --continue') |
|
|||
2347 | [255] |
|
|||
2348 |
|
||||
2349 | $ echo A>a |
|
|||
2350 | $ hg resolve --mark |
|
|||
2351 | (no more unresolved files) |
|
|||
2352 | continue: hg graft --continue |
|
|||
2353 | $ hg graft --continue |
|
|||
2354 | grafting 3:09e253b87e17 "A in file a" |
|
|||
2355 | $ hg diff |
|
|||
2356 | diff -r 2aa9ad1006ff a |
|
|||
2357 | --- a/a Thu Jan 01 00:00:00 1970 +0000 |
|
|||
2358 | +++ b/a Thu Jan 01 00:00:00 1970 +0000 |
|
|||
2359 | @@ -1,1 +1,1 @@ |
|
|||
2360 | -B |
|
|||
2361 | +A |
|
|||
2362 | diff -r 2aa9ad1006ff c |
|
|||
2363 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
|||
2364 | +++ b/c Thu Jan 01 00:00:00 1970 +0000 |
|
|||
2365 | @@ -0,0 +1,1 @@ |
|
|||
2366 | +c |
|
|||
2367 |
|
||||
2368 | $ hg log -GT "{rev}:{node|short} {desc}\n" |
|
|||
2369 | @ 4:2aa9ad1006ff B in file a |
|
|||
2370 | | |
|
|||
2371 | | o 3:09e253b87e17 A in file a |
|
|||
2372 | | | |
|
|||
2373 | | o 2:d36c0562f908 c |
|
|||
2374 | | | |
|
|||
2375 | o | 1:d2ae7f538514 b |
|
|||
2376 | |/ |
|
|||
2377 | o 0:cb9a9f314b8b a |
|
|||
2378 |
|
||||
2379 | $ hg up -qC |
|
|||
2380 |
|
||||
2381 | When there is no conflict: |
|
|||
2382 | $ echo d>d |
|
|||
2383 | $ hg add d -q |
|
|||
2384 | $ hg ci -qmd |
|
|||
2385 | $ hg up 3 -q |
|
|||
2386 | $ hg log -GT "{rev}:{node|short} {desc}\n" |
|
|||
2387 | o 5:baefa8927fc0 d |
|
|||
2388 | | |
|
|||
2389 | o 4:2aa9ad1006ff B in file a |
|
|||
2390 | | |
|
|||
2391 | | @ 3:09e253b87e17 A in file a |
|
|||
2392 | | | |
|
|||
2393 | | o 2:d36c0562f908 c |
|
|||
2394 | | | |
|
|||
2395 | o | 1:d2ae7f538514 b |
|
|||
2396 | |/ |
|
|||
2397 | o 0:cb9a9f314b8b a |
|
|||
2398 |
|
||||
2399 |
|
||||
2400 | $ hg graft -r 1 -r 5 --no-commit |
|
|||
2401 | grafting 1:d2ae7f538514 "b" |
|
|||
2402 | grafting 5:baefa8927fc0 "d" (tip) |
|
|||
2403 | $ hg diff |
|
|||
2404 | diff -r 09e253b87e17 b |
|
|||
2405 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
|||
2406 | +++ b/b Thu Jan 01 00:00:00 1970 +0000 |
|
|||
2407 | @@ -0,0 +1,1 @@ |
|
|||
2408 | +b |
|
|||
2409 | diff -r 09e253b87e17 d |
|
|||
2410 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
|||
2411 | +++ b/d Thu Jan 01 00:00:00 1970 +0000 |
|
|||
2412 | @@ -0,0 +1,1 @@ |
|
|||
2413 | +d |
|
|||
2414 | $ hg log -GT "{rev}:{node|short} {desc}\n" |
|
|||
2415 | o 5:baefa8927fc0 d |
|
|||
2416 | | |
|
|||
2417 | o 4:2aa9ad1006ff B in file a |
|
|||
2418 | | |
|
|||
2419 | | @ 3:09e253b87e17 A in file a |
|
|||
2420 | | | |
|
|||
2421 | | o 2:d36c0562f908 c |
|
|||
2422 | | | |
|
|||
2423 | o | 1:d2ae7f538514 b |
|
|||
2424 | |/ |
|
|||
2425 | o 0:cb9a9f314b8b a |
|
|||
2426 |
|
||||
2427 | $ cd .. |
|
General Comments 0
You need to be logged in to leave comments.
Login now