Show More
@@ -0,0 +1,57 b'' | |||
|
1 | Test histedit extension: Merge tools | |
|
2 | ==================================== | |
|
3 | ||
|
4 | Initialization | |
|
5 | --------------- | |
|
6 | ||
|
7 | $ . "$TESTDIR/histedit-helpers.sh" | |
|
8 | ||
|
9 | $ cat >> $HGRCPATH <<EOF | |
|
10 | > [alias] | |
|
11 | > logt = log --template '{rev}:{node|short} {desc|firstline}\n' | |
|
12 | > [extensions] | |
|
13 | > histedit= | |
|
14 | > mockmakedate = $TESTDIR/mockmakedate.py | |
|
15 | > [ui] | |
|
16 | > pre-merge-tool-output-template='pre-merge message for {node}\n' | |
|
17 | > EOF | |
|
18 | ||
|
19 | Merge conflict | |
|
20 | -------------- | |
|
21 | ||
|
22 | $ hg init r | |
|
23 | $ cd r | |
|
24 | $ echo foo > file | |
|
25 | $ hg add file | |
|
26 | $ hg ci -m "First" -d "1 0" | |
|
27 | $ echo bar > file | |
|
28 | $ hg ci -m "Second" -d "2 0" | |
|
29 | ||
|
30 | $ hg logt --graph | |
|
31 | @ 1:2aa920f62fb9 Second | |
|
32 | | | |
|
33 | o 0:7181f42b8fca First | |
|
34 | ||
|
35 | ||
|
36 | Invert the order of the commits, but fail the merge. | |
|
37 | $ hg histedit --config ui.merge=false --commands - 2>&1 <<EOF | fixbundle | |
|
38 | > pick 2aa920f62fb9 Second | |
|
39 | > pick 7181f42b8fca First | |
|
40 | > EOF | |
|
41 | merging file | |
|
42 | pre-merge message for b90fa2e91a6d11013945a5f684be45b84a8ca6ec | |
|
43 | merging file failed! | |
|
44 | Fix up the change (pick 7181f42b8fca) | |
|
45 | (hg histedit --continue to resume) | |
|
46 | ||
|
47 | $ hg histedit --abort | fixbundle | |
|
48 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
49 | ||
|
50 | Invert the order of the commits, and pretend the merge succeeded. | |
|
51 | $ hg histedit --config ui.merge=true --commands - 2>&1 <<EOF | fixbundle | |
|
52 | > pick 2aa920f62fb9 Second | |
|
53 | > pick 7181f42b8fca First | |
|
54 | > EOF | |
|
55 | merging file | |
|
56 | pre-merge message for b90fa2e91a6d11013945a5f684be45b84a8ca6ec | |
|
57 | 7181f42b8fca: skipping changeset (no changes) |
@@ -522,17 +522,14 b' class histeditaction(object):' | |||
|
522 | 522 | rulectx = repo[self.node] |
|
523 | 523 | repo.ui.pushbuffer(error=True, labeled=True) |
|
524 | 524 | hg.update(repo, self.state.parentctxnode, quietempty=True) |
|
525 | repo.ui.popbuffer() | |
|
525 | 526 | stats = applychanges(repo.ui, repo, rulectx, {}) |
|
526 | 527 | repo.dirstate.setbranch(rulectx.branch()) |
|
527 | 528 | if stats.unresolvedcount: |
|
528 | buf = repo.ui.popbuffer() | |
|
529 | repo.ui.write(buf) | |
|
530 | 529 | raise error.InterventionRequired( |
|
531 | 530 | _('Fix up the change (%s %s)') % |
|
532 | 531 | (self.verb, node.short(self.node)), |
|
533 | 532 | hint=_('hg histedit --continue to resume')) |
|
534 | else: | |
|
535 | repo.ui.popbuffer() | |
|
536 | 533 | |
|
537 | 534 | def continuedirty(self): |
|
538 | 535 | """Continues the action when changes have been applied to the working |
@@ -593,8 +590,10 b' def applychanges(ui, repo, ctx, opts):' | |||
|
593 | 590 | if ctx.p1().node() == wcpar: |
|
594 | 591 | # edits are "in place" we do not need to make any merge, |
|
595 | 592 | # just applies changes on parent for editing |
|
593 | ui.pushbuffer() | |
|
596 | 594 | cmdutil.revert(ui, repo, ctx, (wcpar, node.nullid), all=True) |
|
597 | 595 | stats = mergemod.updateresult(0, 0, 0, 0) |
|
596 | ui.popbuffer() | |
|
598 | 597 | else: |
|
599 | 598 | try: |
|
600 | 599 | # ui.forcemerge is an internal variable, do not document |
@@ -139,7 +139,6 b' temporarily.' | |||
|
139 | 139 | > edit 08d98a8350f3 4 five |
|
140 | 140 | > EOF |
|
141 | 141 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
142 | reverting alpha | |
|
143 | 142 | Editing (08d98a8350f3), you may commit or record as needed now. |
|
144 | 143 | (hg histedit --continue to resume) |
|
145 | 144 | [1] |
@@ -476,7 +475,6 b' in which case this test should be revisi' | |||
|
476 | 475 | > pick 8cde254db839 |
|
477 | 476 | > edit 6f2f0241f119 |
|
478 | 477 | > EOF |
|
479 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
480 | 478 | merging foo |
|
481 | 479 | warning: conflicts while merging foo! (edit, then use 'hg resolve --mark') |
|
482 | 480 | Fix up the change (pick 8cde254db839) |
@@ -433,7 +433,6 b' rollback should not work after a histedi' | |||
|
433 | 433 | > edit cb9a9f314b8b a > $EDITED |
|
434 | 434 | > EOF |
|
435 | 435 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
436 | adding a | |
|
437 | 436 | Editing (cb9a9f314b8b), you may commit or record as needed now. |
|
438 | 437 | (hg histedit --continue to resume) |
|
439 | 438 | [1] |
@@ -94,7 +94,6 b' log before edit' | |||
|
94 | 94 | |
|
95 | 95 | edit the history |
|
96 | 96 | $ hg histedit 3 --commands $EDITED 2>&1 | fixbundle |
|
97 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
98 | 97 | merging e |
|
99 | 98 | warning: conflicts while merging e! (edit, then use 'hg resolve --mark') |
|
100 | 99 | Fix up the change (fold 42abbb61bede) |
@@ -249,7 +248,6 b' log before edit' | |||
|
249 | 248 | |
|
250 | 249 | edit the history |
|
251 | 250 | $ hg histedit 3 --commands $EDITED 2>&1 | fixbundle |
|
252 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
253 | 251 | merging e |
|
254 | 252 | warning: conflicts while merging e! (edit, then use 'hg resolve --mark') |
|
255 | 253 | Fix up the change (roll 42abbb61bede) |
@@ -287,7 +287,6 b' folded content is dropped during a merge' | |||
|
287 | 287 | > drop 888f9082bf99 2 +5 |
|
288 | 288 | > fold 251d831eeec5 3 +6 |
|
289 | 289 | > EOF |
|
290 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
291 | 290 | merging file |
|
292 | 291 | warning: conflicts while merging file! (edit, then use 'hg resolve --mark') |
|
293 | 292 | Fix up the change (fold 251d831eeec5) |
@@ -361,7 +360,6 b' dropped revision.' | |||
|
361 | 360 | > drop 888f9082bf99 2 +5 |
|
362 | 361 | > fold 251d831eeec5 3 +6 |
|
363 | 362 | > EOF |
|
364 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
365 | 363 | merging file |
|
366 | 364 | warning: conflicts while merging file! (edit, then use 'hg resolve --mark') |
|
367 | 365 | Fix up the change (fold 251d831eeec5) |
@@ -541,6 +539,7 b' editors.' | |||
|
541 | 539 | > fold b7389cc4d66e 3 foo2 |
|
542 | 540 | > fold 21679ff7675c 4 foo3 |
|
543 | 541 | > EOF |
|
542 | merging foo | |
|
544 | 543 | $ hg logt |
|
545 | 544 | 2:e8bedbda72c1 merged foos |
|
546 | 545 | 1:578c7455730c a |
@@ -87,7 +87,6 b' log before edit' | |||
|
87 | 87 | |
|
88 | 88 | edit the history |
|
89 | 89 | $ hg histedit 3 --commands $EDITED 2>&1 | fixbundle |
|
90 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
91 | 90 | merging e |
|
92 | 91 | warning: conflicts while merging e! (edit, then use 'hg resolve --mark') |
|
93 | 92 | Fix up the change (pick 39522b764e3d) |
@@ -145,7 +144,6 b' second edit set' | |||
|
145 | 144 | |
|
146 | 145 | edit the history |
|
147 | 146 | $ hg histedit 3 --commands $EDITED 2>&1 | fixbundle |
|
148 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
149 | 147 | merging e |
|
150 | 148 | warning: conflicts while merging e! (edit, then use 'hg resolve --mark') |
|
151 | 149 | Fix up the change (pick 39522b764e3d) |
@@ -241,7 +239,6 b' start over' | |||
|
241 | 239 | |
|
242 | 240 | edit the history, this time with a fold action |
|
243 | 241 | $ hg histedit 3 --commands $EDITED 2>&1 | fixbundle |
|
244 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
245 | 242 | merging e |
|
246 | 243 | warning: conflicts while merging e! (edit, then use 'hg resolve --mark') |
|
247 | 244 | Fix up the change (mess 39522b764e3d) |
@@ -216,7 +216,6 b' Test that rewriting leaving instability ' | |||
|
216 | 216 | > edit b346ab9a313d 6 c |
|
217 | 217 | > EOF |
|
218 | 218 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
219 | adding c | |
|
220 | 219 | Editing (b346ab9a313d), you may commit or record as needed now. |
|
221 | 220 | (hg histedit --continue to resume) |
|
222 | 221 | [1] |
@@ -351,7 +350,6 b' New-commit as draft (default)' | |||
|
351 | 350 | > pick ee118ab9fa44 16 k |
|
352 | 351 | > EOF |
|
353 | 352 | 0 files updated, 0 files merged, 6 files removed, 0 files unresolved |
|
354 | adding f | |
|
355 | 353 | Editing (b449568bf7fc), you may commit or record as needed now. |
|
356 | 354 | (hg histedit --continue to resume) |
|
357 | 355 | [1] |
@@ -394,7 +392,6 b' New-commit as secret (config)' | |||
|
394 | 392 | > pick ee118ab9fa44 16 k |
|
395 | 393 | > EOF |
|
396 | 394 | 0 files updated, 0 files merged, 6 files removed, 0 files unresolved |
|
397 | adding f | |
|
398 | 395 | Editing (b449568bf7fc), you may commit or record as needed now. |
|
399 | 396 | (hg histedit --continue to resume) |
|
400 | 397 | [1] |
@@ -446,7 +446,6 b' qrecord should throw an error when histe' | |||
|
446 | 446 | > edit ea55e2ae468f foo bar |
|
447 | 447 | > EOF |
|
448 | 448 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
449 | adding a | |
|
450 | 449 | Editing (ea55e2ae468f), you may commit or record as needed now. |
|
451 | 450 | (hg histedit --continue to resume) |
|
452 | 451 | [1] |
General Comments 0
You need to be logged in to leave comments.
Login now