Patchwork histedit: correct output of error when 'base' is from the edit list

login
register
mail settings
Submitter Augie Fackler
Date Aug. 30, 2016, 5:18 p.m.
Message ID <4e6fc4921eca722aa5c7.1472577534@arthedain.pit.corp.google.com>
Download mbox | patch
Permalink /patch/16485/
State Accepted
Headers show

Comments

Augie Fackler - Aug. 30, 2016, 5:18 p.m.
# HG changeset patch
# User Augie Fackler <augie@google.com>
# Date 1472577230 14400
#      Tue Aug 30 13:13:50 2016 -0400
# Node ID 4e6fc4921eca722aa5c7967408d93ca3c59b1593
# Parent  12f8bef59bfa2739d0c5d8425ab494fd2fe38a81
histedit: correct output of error when 'base' is from the edit list

This was made more obvious by marmoute's recent rearrangement of this code.
Yuya Nishihara - Aug. 31, 2016, 12:59 p.m.
On Tue, 30 Aug 2016 13:18:54 -0400, Augie Fackler wrote:
> # HG changeset patch
> # User Augie Fackler <augie@google.com>
> # Date 1472577230 14400
> #      Tue Aug 30 13:13:50 2016 -0400
> # Node ID 4e6fc4921eca722aa5c7967408d93ca3c59b1593
> # Parent  12f8bef59bfa2739d0c5d8425ab494fd2fe38a81
> histedit: correct output of error when 'base' is from the edit list

LGTM, queued, thanks.

Patch

diff --git a/hgext/histedit.py b/hgext/histedit.py
--- a/hgext/histedit.py
+++ b/hgext/histedit.py
@@ -789,9 +789,10 @@  class base(histeditaction):
     def _verifynodeconstraints(self, prev, expected, seen):
         # base can only be use with a node not in the edited set
         if self.node in expected:
-            msg = _('%s "%s" changeset was not an edited list candidate')
-            raise error.ParseError(msg % (self.verb, node.short(self.node)),
-                                   hint=_('only use listed changesets'))
+            msg = _('%s "%s" changeset was an edited list candidate')
+            raise error.ParseError(
+                msg % (self.verb, node.short(self.node)),
+                hint=_('base must only use unlisted changesets'))
 
 @action(['_multifold'],
         _(
diff --git a/tests/test-histedit-base.t b/tests/test-histedit-base.t
--- a/tests/test-histedit-base.t
+++ b/tests/test-histedit-base.t
@@ -235,8 +235,8 @@  base on a previously picked changeset
   > base d273e35dcdf2 B
   > pick b2f90fd8aa85 I
   > EOF
-  hg: parse error: base "d273e35dcdf2" changeset was not an edited list candidate
-  (only use listed changesets)
+  hg: parse error: base "d273e35dcdf2" changeset was an edited list candidate
+  (base must only use unlisted changesets)
 
   $ hg --config experimental.histeditng=False histedit 5 --commands - 2>&1 << EOF | fixbundle
   > base cd010b8cd998 A