histedit: list action when intervention is required
authortimeless <timeless@mozdev.org>
Wed, 23 Dec 2015 08:57:04 +0000
changeset 27629 e7ff83b2bcfe
parent 27628 707d66afce21
child 27630 9358124b4a65
histedit: list action when intervention is required
hgext/histedit.py
tests/test-histedit-arguments.t
tests/test-histedit-base.t
tests/test-histedit-commute.t
tests/test-histedit-edit.t
tests/test-histedit-fold-non-commute.t
tests/test-histedit-fold.t
tests/test-histedit-no-change.t
tests/test-histedit-non-commute-abort.t
tests/test-histedit-non-commute.t
tests/test-histedit-obsolete.t
--- a/hgext/histedit.py	Wed Dec 23 08:52:52 2015 +0000
+++ b/hgext/histedit.py	Wed Dec 23 08:57:04 2015 +0000
@@ -423,8 +423,10 @@
         hg.update(repo, self.state.parentctxnode, quietempty=True)
         stats = applychanges(repo.ui, repo, rulectx, {})
         if stats and stats[3] > 0:
-            raise error.InterventionRequired(_('Fix up the change and run '
-                                            'hg histedit --continue'))
+            raise error.InterventionRequired(
+                _('Fix up the change (%s %s)') %
+                (self.verb, node.short(self.node)),
+                hint=_('hg histedit --continue to resume'))
 
     def continuedirty(self):
         """Continues the action when changes have been applied to the working
@@ -616,9 +618,9 @@
         hg.update(repo, self.state.parentctxnode, quietempty=True)
         applychanges(repo.ui, repo, rulectx, {})
         raise error.InterventionRequired(
-            _('Make changes as needed, you may commit or record as needed '
-              'now.\nWhen you are finished, run hg histedit --continue to '
-              'resume.'))
+            _('Editing (%s), you may commit or record as needed now.')
+            % node.short(self.node),
+            hint=_('hg histedit --continue to resume'))
 
     def commiteditor(self):
         return cmdutil.getcommiteditor(edit=True, editform='histedit.edit')
--- a/tests/test-histedit-arguments.t	Wed Dec 23 08:52:52 2015 +0000
+++ b/tests/test-histedit-arguments.t	Wed Dec 23 08:57:04 2015 +0000
@@ -128,8 +128,8 @@
   > EOF
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   reverting alpha
-  Make changes as needed, you may commit or record as needed now.
-  When you are finished, run hg histedit --continue to resume.
+  Editing (08d98a8350f3), you may commit or record as needed now.
+  (hg histedit --continue to resume)
   [1]
 
   $ mv .hg/histedit-state .hg/histedit-state.back
@@ -308,8 +308,8 @@
   > edit eb57da33312f 2 three
   > pick f3cfcca30c44 4 x
   > EOF
-  Make changes as needed, you may commit or record as needed now.
-  When you are finished, run hg histedit --continue to resume.
+  Editing (eb57da33312f), you may commit or record as needed now.
+  (hg histedit --continue to resume)
   [1]
   $ echo edit >> alpha
   $ hg histedit -q --continue
@@ -335,8 +335,8 @@
   $ hg histedit . -q --commands - << EOF
   > edit 8fda0c726bf2 6 x
   > EOF
-  Make changes as needed, you may commit or record as needed now.
-  When you are finished, run hg histedit --continue to resume.
+  Editing (8fda0c726bf2), you may commit or record as needed now.
+  (hg histedit --continue to resume)
   [1]
 Corrupt histedit state file
   $ sed 's/8fda0c726bf2/123456789012/' .hg/histedit-state > ../corrupt-histedit
--- a/tests/test-histedit-base.t	Wed Dec 23 08:52:52 2015 +0000
+++ b/tests/test-histedit-base.t	Wed Dec 23 08:57:04 2015 +0000
@@ -146,7 +146,8 @@
   > EOF
   merging B
   warning: conflicts while merging B! (edit, then use 'hg resolve --mark')
-  Fix up the change and run hg histedit --continue
+  Fix up the change (pick 591369deedfd)
+  (hg histedit --continue to resume)
   $ hg histedit --abort | fixbundle
   2 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ hg tglog
@@ -174,7 +175,8 @@
   > EOF
   merging B
   warning: conflicts while merging B! (edit, then use 'hg resolve --mark')
-  Fix up the change and run hg histedit --continue
+  Fix up the change (pick 591369deedfd)
+  (hg histedit --continue to resume)
   $ echo b2 > B
   $ hg resolve --mark B
   (no more unresolved files)
--- a/tests/test-histedit-commute.t	Wed Dec 23 08:52:52 2015 +0000
+++ b/tests/test-histedit-commute.t	Wed Dec 23 08:57:04 2015 +0000
@@ -84,8 +84,8 @@
   > EOF
   $ HGEDITOR="cat \"$EDITED\" > " hg histedit 177f92b77385 2>&1 | fixbundle
   0 files updated, 0 files merged, 4 files removed, 0 files unresolved
-  Make changes as needed, you may commit or record as needed now.
-  When you are finished, run hg histedit --continue to resume.
+  Editing (177f92b77385), you may commit or record as needed now.
+  (hg histedit --continue to resume)
 
 rules should end up in .hg/histedit-last-edit.txt:
   $ cat .hg/histedit-last-edit.txt
--- a/tests/test-histedit-edit.t	Wed Dec 23 08:52:52 2015 +0000
+++ b/tests/test-histedit-edit.t	Wed Dec 23 08:57:04 2015 +0000
@@ -74,8 +74,8 @@
   > pick 3c6a8ed2ebe8 g
   > EOF
   0 files updated, 0 files merged, 3 files removed, 0 files unresolved
-  Make changes as needed, you may commit or record as needed now.
-  When you are finished, run hg histedit --continue to resume.
+  Editing (e860deea161a), you may commit or record as needed now.
+  (hg histedit --continue to resume)
 
 edit the plan via the editor
   $ cat >> $TESTTMP/editplan.sh <<EOF
@@ -198,8 +198,8 @@
   > pick b5f70786f9b0 g
   > EOF
   0 files updated, 0 files merged, 2 files removed, 0 files unresolved
-  Make changes as needed, you may commit or record as needed now.
-  When you are finished, run hg histedit --continue to resume.
+  Editing (1a60820cd1f6), you may commit or record as needed now.
+  (hg histedit --continue to resume)
 
   $ mv .hg/histedit-state .hg/histedit-state.bak
   $ hg strip -q -r b5f70786f9b0
@@ -240,8 +240,8 @@
   > edit b5f70786f9b0 f
   > EOF
   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
-  Make changes as needed, you may commit or record as needed now.
-  When you are finished, run hg histedit --continue to resume.
+  Editing (b5f70786f9b0), you may commit or record as needed now.
+  (hg histedit --continue to resume)
   $ hg status
   A f
 
@@ -432,8 +432,8 @@
   > EOF
   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
   adding a
-  Make changes as needed, you may commit or record as needed now.
-  When you are finished, run hg histedit --continue to resume.
+  Editing (cb9a9f314b8b), you may commit or record as needed now.
+  (hg histedit --continue to resume)
   [1]
   $ HGEDITOR=true hg histedit --continue
   saved backup bundle to $TESTTMP/r0/.hg/strip-backup/cb9a9f314b8b-cc5ccb0b-backup.hg (glob)
--- a/tests/test-histedit-fold-non-commute.t	Wed Dec 23 08:52:52 2015 +0000
+++ b/tests/test-histedit-fold-non-commute.t	Wed Dec 23 08:57:04 2015 +0000
@@ -89,7 +89,8 @@
   2 files updated, 0 files merged, 0 files removed, 0 files unresolved
   merging e
   warning: conflicts while merging e! (edit, then use 'hg resolve --mark')
-  Fix up the change and run hg histedit --continue
+  Fix up the change (fold 39522b764e3d)
+  (hg histedit --continue to resume)
 
 fix up
   $ echo 'I can haz no commute' > e
@@ -123,7 +124,8 @@
   2 files updated, 0 files merged, 0 files removed, 0 files unresolved
   merging e
   warning: conflicts while merging e! (edit, then use 'hg resolve --mark')
-  Fix up the change and run hg histedit --continue
+  Fix up the change (pick 7b4e2f4b7bcd)
+  (hg histedit --continue to resume)
 
 just continue this time
   $ hg revert -r 'p1()' e
@@ -251,7 +253,8 @@
   2 files updated, 0 files merged, 0 files removed, 0 files unresolved
   merging e
   warning: conflicts while merging e! (edit, then use 'hg resolve --mark')
-  Fix up the change and run hg histedit --continue
+  Fix up the change (roll 39522b764e3d)
+  (hg histedit --continue to resume)
 
 fix up
   $ echo 'I can haz no commute' > e
@@ -263,7 +266,8 @@
   2 files updated, 0 files merged, 0 files removed, 0 files unresolved
   merging e
   warning: conflicts while merging e! (edit, then use 'hg resolve --mark')
-  Fix up the change and run hg histedit --continue
+  Fix up the change (pick 7b4e2f4b7bcd)
+  (hg histedit --continue to resume)
 
 just continue this time
   $ hg revert -r 'p1()' e
--- a/tests/test-histedit-fold.t	Wed Dec 23 08:52:52 2015 +0000
+++ b/tests/test-histedit-fold.t	Wed Dec 23 08:57:04 2015 +0000
@@ -293,7 +293,8 @@
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   merging file
   warning: conflicts while merging file! (edit, then use 'hg resolve --mark')
-  Fix up the change and run hg histedit --continue
+  Fix up the change (fold 251d831eeec5)
+  (hg histedit --continue to resume)
   [1]
 There were conflicts, we keep P1 content. This
 should effectively drop the changes from +6.
@@ -354,7 +355,8 @@
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   merging file
   warning: conflicts while merging file! (edit, then use 'hg resolve --mark')
-  Fix up the change and run hg histedit --continue
+  Fix up the change (fold 251d831eeec5)
+  (hg histedit --continue to resume)
   [1]
   $ cat > file << EOF
   > 1
--- a/tests/test-histedit-no-change.t	Wed Dec 23 08:52:52 2015 +0000
+++ b/tests/test-histedit-no-change.t	Wed Dec 23 08:57:04 2015 +0000
@@ -91,8 +91,8 @@
   | edit e860deea161a 4 e
   | pick 652413bf663e 5 f
   0 files updated, 0 files merged, 2 files removed, 0 files unresolved
-  Make changes as needed, you may commit or record as needed now.
-  When you are finished, run hg histedit --continue to resume.
+  Editing (e860deea161a), you may commit or record as needed now.
+  (hg histedit --continue to resume)
   $ continueediting true "(leaving commit message unaltered)"
   % finalize changeset editing (leaving commit message unaltered)
 
@@ -142,12 +142,12 @@
   | edit e860deea161a 4 e
   | pick 652413bf663e 5 f
   0 files updated, 0 files merged, 3 files removed, 0 files unresolved
-  Make changes as needed, you may commit or record as needed now.
-  When you are finished, run hg histedit --continue to resume.
+  Editing (055a42cdd887), you may commit or record as needed now.
+  (hg histedit --continue to resume)
   $ continueediting true "(leaving commit message unaltered)"
   % finalize changeset editing (leaving commit message unaltered)
-  Make changes as needed, you may commit or record as needed now.
-  When you are finished, run hg histedit --continue to resume.
+  Editing (e860deea161a), you may commit or record as needed now.
+  (hg histedit --continue to resume)
   $ graphlog "log after first edit"
   % log after first edit
   @  6 e5ae3ca2f1ffdbd89ec41ebc273a231f7c3022f2 "d"
@@ -211,8 +211,8 @@
   $ startediting 1 1 "(not changing anything)" # edit the 3rd of 3 changesets
   % start editing the history (not changing anything)
   | edit 292aec348d9e 6 closebranch
-  Make changes as needed, you may commit or record as needed now.
-  When you are finished, run hg histedit --continue to resume.
+  Editing (292aec348d9e), you may commit or record as needed now.
+  (hg histedit --continue to resume)
   $ hg histedit --abort
 
   $ cd ..
--- a/tests/test-histedit-non-commute-abort.t	Wed Dec 23 08:52:52 2015 +0000
+++ b/tests/test-histedit-non-commute-abort.t	Wed Dec 23 08:57:04 2015 +0000
@@ -72,7 +72,8 @@
   0 files updated, 0 files merged, 2 files removed, 0 files unresolved
   merging e
   warning: conflicts while merging e! (edit, then use 'hg resolve --mark')
-  Fix up the change and run hg histedit --continue
+  Fix up the change (pick e860deea161a)
+  (hg histedit --continue to resume)
 
 insert unsupported advisory merge record
   $ hg --config extensions.fakemergerecord=$TESTDIR/fakemergerecord.py fakemergerecord -x
--- a/tests/test-histedit-non-commute.t	Wed Dec 23 08:52:52 2015 +0000
+++ b/tests/test-histedit-non-commute.t	Wed Dec 23 08:57:04 2015 +0000
@@ -90,7 +90,8 @@
   2 files updated, 0 files merged, 0 files removed, 0 files unresolved
   merging e
   warning: conflicts while merging e! (edit, then use 'hg resolve --mark')
-  Fix up the change and run hg histedit --continue
+  Fix up the change (pick 39522b764e3d)
+  (hg histedit --continue to resume)
 
 abort the edit
   $ hg histedit --abort 2>&1 | fixbundle
@@ -147,7 +148,8 @@
   2 files updated, 0 files merged, 0 files removed, 0 files unresolved
   merging e
   warning: conflicts while merging e! (edit, then use 'hg resolve --mark')
-  Fix up the change and run hg histedit --continue
+  Fix up the change (pick 39522b764e3d)
+  (hg histedit --continue to resume)
 
 fix up
   $ echo 'I can haz no commute' > e
@@ -157,7 +159,8 @@
   $ hg histedit --continue 2>&1 | fixbundle
   merging e
   warning: conflicts while merging e! (edit, then use 'hg resolve --mark')
-  Fix up the change and run hg histedit --continue
+  Fix up the change (pick 7b4e2f4b7bcd)
+  (hg histedit --continue to resume)
 
 This failure is caused by 7b4e2f4b7bcd "e" not rebasing the non commutative
 former children.
@@ -233,7 +236,8 @@
   2 files updated, 0 files merged, 0 files removed, 0 files unresolved
   merging e
   warning: conflicts while merging e! (edit, then use 'hg resolve --mark')
-  Fix up the change and run hg histedit --continue
+  Fix up the change (mess 39522b764e3d)
+  (hg histedit --continue to resume)
 
   $ echo 'I can haz no commute' > e
   $ hg resolve --mark e
@@ -242,7 +246,8 @@
   $ hg histedit --continue 2>&1 | fixbundle
   merging e
   warning: conflicts while merging e! (edit, then use 'hg resolve --mark')
-  Fix up the change and run hg histedit --continue
+  Fix up the change (pick 7b4e2f4b7bcd)
+  (hg histedit --continue to resume)
 second edit also fails, but just continue
   $ hg revert -r 'p1()' e
   $ hg resolve --mark e
--- a/tests/test-histedit-obsolete.t	Wed Dec 23 08:52:52 2015 +0000
+++ b/tests/test-histedit-obsolete.t	Wed Dec 23 08:57:04 2015 +0000
@@ -136,8 +136,8 @@
   > EOF
   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
   adding c
-  Make changes as needed, you may commit or record as needed now.
-  When you are finished, run hg histedit --continue to resume.
+  Editing (b346ab9a313d), you may commit or record as needed now.
+  (hg histedit --continue to resume)
   [1]
   $ echo c >> c
   $ hg histedit --continue
@@ -280,8 +280,8 @@
   > EOF
   0 files updated, 0 files merged, 6 files removed, 0 files unresolved
   adding f
-  Make changes as needed, you may commit or record as needed now.
-  When you are finished, run hg histedit --continue to resume.
+  Editing (947ece25170f), you may commit or record as needed now.
+  (hg histedit --continue to resume)
   [1]
   $ echo f >> f
   $ hg histedit --continue
@@ -323,8 +323,8 @@
   > EOF
   0 files updated, 0 files merged, 6 files removed, 0 files unresolved
   adding f
-  Make changes as needed, you may commit or record as needed now.
-  When you are finished, run hg histedit --continue to resume.
+  Editing (947ece25170f), you may commit or record as needed now.
+  (hg histedit --continue to resume)
   [1]
   $ echo f >> f
   $ hg histedit --continue