##// END OF EJS Templates
histedit: narrow the scope of discarded ui output...
Rodrigo Damazio Bovendorp -
r42219:15d2afa3 default
parent child Browse files
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 rulectx = repo[self.node]
522 rulectx = repo[self.node]
523 repo.ui.pushbuffer(error=True, labeled=True)
523 repo.ui.pushbuffer(error=True, labeled=True)
524 hg.update(repo, self.state.parentctxnode, quietempty=True)
524 hg.update(repo, self.state.parentctxnode, quietempty=True)
525 repo.ui.popbuffer()
525 stats = applychanges(repo.ui, repo, rulectx, {})
526 stats = applychanges(repo.ui, repo, rulectx, {})
526 repo.dirstate.setbranch(rulectx.branch())
527 repo.dirstate.setbranch(rulectx.branch())
527 if stats.unresolvedcount:
528 if stats.unresolvedcount:
528 buf = repo.ui.popbuffer()
529 repo.ui.write(buf)
530 raise error.InterventionRequired(
529 raise error.InterventionRequired(
531 _('Fix up the change (%s %s)') %
530 _('Fix up the change (%s %s)') %
532 (self.verb, node.short(self.node)),
531 (self.verb, node.short(self.node)),
533 hint=_('hg histedit --continue to resume'))
532 hint=_('hg histedit --continue to resume'))
534 else:
535 repo.ui.popbuffer()
536
533
537 def continuedirty(self):
534 def continuedirty(self):
538 """Continues the action when changes have been applied to the working
535 """Continues the action when changes have been applied to the working
@@ -593,8 +590,10 b' def applychanges(ui, repo, ctx, opts):'
593 if ctx.p1().node() == wcpar:
590 if ctx.p1().node() == wcpar:
594 # edits are "in place" we do not need to make any merge,
591 # edits are "in place" we do not need to make any merge,
595 # just applies changes on parent for editing
592 # just applies changes on parent for editing
593 ui.pushbuffer()
596 cmdutil.revert(ui, repo, ctx, (wcpar, node.nullid), all=True)
594 cmdutil.revert(ui, repo, ctx, (wcpar, node.nullid), all=True)
597 stats = mergemod.updateresult(0, 0, 0, 0)
595 stats = mergemod.updateresult(0, 0, 0, 0)
596 ui.popbuffer()
598 else:
597 else:
599 try:
598 try:
600 # ui.forcemerge is an internal variable, do not document
599 # ui.forcemerge is an internal variable, do not document
@@ -139,7 +139,6 b' temporarily.'
139 > edit 08d98a8350f3 4 five
139 > edit 08d98a8350f3 4 five
140 > EOF
140 > EOF
141 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
141 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
142 reverting alpha
143 Editing (08d98a8350f3), you may commit or record as needed now.
142 Editing (08d98a8350f3), you may commit or record as needed now.
144 (hg histedit --continue to resume)
143 (hg histedit --continue to resume)
145 [1]
144 [1]
@@ -476,7 +475,6 b' in which case this test should be revisi'
476 > pick 8cde254db839
475 > pick 8cde254db839
477 > edit 6f2f0241f119
476 > edit 6f2f0241f119
478 > EOF
477 > EOF
479 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
480 merging foo
478 merging foo
481 warning: conflicts while merging foo! (edit, then use 'hg resolve --mark')
479 warning: conflicts while merging foo! (edit, then use 'hg resolve --mark')
482 Fix up the change (pick 8cde254db839)
480 Fix up the change (pick 8cde254db839)
@@ -433,7 +433,6 b' rollback should not work after a histedi'
433 > edit cb9a9f314b8b a > $EDITED
433 > edit cb9a9f314b8b a > $EDITED
434 > EOF
434 > EOF
435 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
435 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
436 adding a
437 Editing (cb9a9f314b8b), you may commit or record as needed now.
436 Editing (cb9a9f314b8b), you may commit or record as needed now.
438 (hg histedit --continue to resume)
437 (hg histedit --continue to resume)
439 [1]
438 [1]
@@ -94,7 +94,6 b' log before edit'
94
94
95 edit the history
95 edit the history
96 $ hg histedit 3 --commands $EDITED 2>&1 | fixbundle
96 $ hg histedit 3 --commands $EDITED 2>&1 | fixbundle
97 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
98 merging e
97 merging e
99 warning: conflicts while merging e! (edit, then use 'hg resolve --mark')
98 warning: conflicts while merging e! (edit, then use 'hg resolve --mark')
100 Fix up the change (fold 42abbb61bede)
99 Fix up the change (fold 42abbb61bede)
@@ -249,7 +248,6 b' log before edit'
249
248
250 edit the history
249 edit the history
251 $ hg histedit 3 --commands $EDITED 2>&1 | fixbundle
250 $ hg histedit 3 --commands $EDITED 2>&1 | fixbundle
252 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
253 merging e
251 merging e
254 warning: conflicts while merging e! (edit, then use 'hg resolve --mark')
252 warning: conflicts while merging e! (edit, then use 'hg resolve --mark')
255 Fix up the change (roll 42abbb61bede)
253 Fix up the change (roll 42abbb61bede)
@@ -287,7 +287,6 b' folded content is dropped during a merge'
287 > drop 888f9082bf99 2 +5
287 > drop 888f9082bf99 2 +5
288 > fold 251d831eeec5 3 +6
288 > fold 251d831eeec5 3 +6
289 > EOF
289 > EOF
290 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
291 merging file
290 merging file
292 warning: conflicts while merging file! (edit, then use 'hg resolve --mark')
291 warning: conflicts while merging file! (edit, then use 'hg resolve --mark')
293 Fix up the change (fold 251d831eeec5)
292 Fix up the change (fold 251d831eeec5)
@@ -361,7 +360,6 b' dropped revision.'
361 > drop 888f9082bf99 2 +5
360 > drop 888f9082bf99 2 +5
362 > fold 251d831eeec5 3 +6
361 > fold 251d831eeec5 3 +6
363 > EOF
362 > EOF
364 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
365 merging file
363 merging file
366 warning: conflicts while merging file! (edit, then use 'hg resolve --mark')
364 warning: conflicts while merging file! (edit, then use 'hg resolve --mark')
367 Fix up the change (fold 251d831eeec5)
365 Fix up the change (fold 251d831eeec5)
@@ -541,6 +539,7 b' editors.'
541 > fold b7389cc4d66e 3 foo2
539 > fold b7389cc4d66e 3 foo2
542 > fold 21679ff7675c 4 foo3
540 > fold 21679ff7675c 4 foo3
543 > EOF
541 > EOF
542 merging foo
544 $ hg logt
543 $ hg logt
545 2:e8bedbda72c1 merged foos
544 2:e8bedbda72c1 merged foos
546 1:578c7455730c a
545 1:578c7455730c a
@@ -87,7 +87,6 b' log before edit'
87
87
88 edit the history
88 edit the history
89 $ hg histedit 3 --commands $EDITED 2>&1 | fixbundle
89 $ hg histedit 3 --commands $EDITED 2>&1 | fixbundle
90 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
91 merging e
90 merging e
92 warning: conflicts while merging e! (edit, then use 'hg resolve --mark')
91 warning: conflicts while merging e! (edit, then use 'hg resolve --mark')
93 Fix up the change (pick 39522b764e3d)
92 Fix up the change (pick 39522b764e3d)
@@ -145,7 +144,6 b' second edit set'
145
144
146 edit the history
145 edit the history
147 $ hg histedit 3 --commands $EDITED 2>&1 | fixbundle
146 $ hg histedit 3 --commands $EDITED 2>&1 | fixbundle
148 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
149 merging e
147 merging e
150 warning: conflicts while merging e! (edit, then use 'hg resolve --mark')
148 warning: conflicts while merging e! (edit, then use 'hg resolve --mark')
151 Fix up the change (pick 39522b764e3d)
149 Fix up the change (pick 39522b764e3d)
@@ -241,7 +239,6 b' start over'
241
239
242 edit the history, this time with a fold action
240 edit the history, this time with a fold action
243 $ hg histedit 3 --commands $EDITED 2>&1 | fixbundle
241 $ hg histedit 3 --commands $EDITED 2>&1 | fixbundle
244 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
245 merging e
242 merging e
246 warning: conflicts while merging e! (edit, then use 'hg resolve --mark')
243 warning: conflicts while merging e! (edit, then use 'hg resolve --mark')
247 Fix up the change (mess 39522b764e3d)
244 Fix up the change (mess 39522b764e3d)
@@ -216,7 +216,6 b' Test that rewriting leaving instability '
216 > edit b346ab9a313d 6 c
216 > edit b346ab9a313d 6 c
217 > EOF
217 > EOF
218 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
218 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
219 adding c
220 Editing (b346ab9a313d), you may commit or record as needed now.
219 Editing (b346ab9a313d), you may commit or record as needed now.
221 (hg histedit --continue to resume)
220 (hg histedit --continue to resume)
222 [1]
221 [1]
@@ -351,7 +350,6 b' New-commit as draft (default)'
351 > pick ee118ab9fa44 16 k
350 > pick ee118ab9fa44 16 k
352 > EOF
351 > EOF
353 0 files updated, 0 files merged, 6 files removed, 0 files unresolved
352 0 files updated, 0 files merged, 6 files removed, 0 files unresolved
354 adding f
355 Editing (b449568bf7fc), you may commit or record as needed now.
353 Editing (b449568bf7fc), you may commit or record as needed now.
356 (hg histedit --continue to resume)
354 (hg histedit --continue to resume)
357 [1]
355 [1]
@@ -394,7 +392,6 b' New-commit as secret (config)'
394 > pick ee118ab9fa44 16 k
392 > pick ee118ab9fa44 16 k
395 > EOF
393 > EOF
396 0 files updated, 0 files merged, 6 files removed, 0 files unresolved
394 0 files updated, 0 files merged, 6 files removed, 0 files unresolved
397 adding f
398 Editing (b449568bf7fc), you may commit or record as needed now.
395 Editing (b449568bf7fc), you may commit or record as needed now.
399 (hg histedit --continue to resume)
396 (hg histedit --continue to resume)
400 [1]
397 [1]
@@ -446,7 +446,6 b' qrecord should throw an error when histe'
446 > edit ea55e2ae468f foo bar
446 > edit ea55e2ae468f foo bar
447 > EOF
447 > EOF
448 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
448 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
449 adding a
450 Editing (ea55e2ae468f), you may commit or record as needed now.
449 Editing (ea55e2ae468f), you may commit or record as needed now.
451 (hg histedit --continue to resume)
450 (hg histedit --continue to resume)
452 [1]
451 [1]
General Comments 0
You need to be logged in to leave comments. Login now