Patchwork [2,of,2] phases: add `hg help phases` hint to failures to edit public commits

login
register
mail settings
Submitter Jordi Gutiérrez Hermoso
Date June 1, 2015, 6:18 p.m.
Message ID <14eeb0e4425cae80e1cf.1433182681@Iris>
Download mbox | patch
Permalink /patch/9432/
State Accepted
Headers show

Comments

Jordi Gutiérrez Hermoso - June 1, 2015, 6:18 p.m.
# HG changeset patch
# User Jordi Gutiérrez Hermoso <jordigh@octave.org>
# Date 1433182612 14400
#      Mon Jun 01 14:16:52 2015 -0400
# Node ID 14eeb0e4425cae80e1cf323e05dbe4beea04da8d
# Parent  6c075f1d088b9ec99876f109c4a51b79c0fbe26c
phases: add `hg help phases` hint to failures to edit public commits

There were a couple of locations that were missing this hint after an
edition of some kind failed due to the public phase.
Pierre-Yves David - June 1, 2015, 7:02 p.m.
On 06/01/2015 11:18 AM, Jordi Gutiérrez Hermoso wrote:
> # HG changeset patch
> # User Jordi Gutiérrez Hermoso <jordigh@octave.org>
> # Date 1433182612 14400
> #      Mon Jun 01 14:16:52 2015 -0400
> # Node ID 14eeb0e4425cae80e1cf323e05dbe4beea04da8d
> # Parent  6c075f1d088b9ec99876f109c4a51b79c0fbe26c
> phases: add `hg help phases` hint to failures to edit public commits
>
> There were a couple of locations that were missing this hint after an
> edition of some kind failed due to the public phase.

ha! that may nail my concern about the first patch.
Augie Fackler - June 1, 2015, 11:59 p.m.
On Mon, Jun 01, 2015 at 12:02:05PM -0700, Pierre-Yves David wrote:
>
>
> On 06/01/2015 11:18 AM, Jordi Gutiérrez Hermoso wrote:
> ># HG changeset patch
> ># User Jordi Gutiérrez Hermoso <jordigh@octave.org>
> ># Date 1433182612 14400
> >#      Mon Jun 01 14:16:52 2015 -0400
> ># Node ID 14eeb0e4425cae80e1cf323e05dbe4beea04da8d
> ># Parent  6c075f1d088b9ec99876f109c4a51b79c0fbe26c
> >phases: add `hg help phases` hint to failures to edit public commits
> >
> >There were a couple of locations that were missing this hint after an
> >edition of some kind failed due to the public phase.
>
> ha! that may nail my concern about the first patch.

My gut is that it's good to banish the word immutable in this context,
and that this series is a net improvement, for what it's worth.

>
> --
> Pierre-Yves David
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@selenic.com
> https://selenic.com/mailman/listinfo/mercurial-devel
Matt Mackall - June 3, 2015, 8:26 p.m.
On Mon, 2015-06-01 at 14:18 -0400, Jordi Gutiérrez Hermoso wrote:
> # HG changeset patch
> # User Jordi Gutiérrez Hermoso <jordigh@octave.org>
> # Date 1433182612 14400
> #      Mon Jun 01 14:16:52 2015 -0400
> # Node ID 14eeb0e4425cae80e1cf323e05dbe4beea04da8d
> # Parent  6c075f1d088b9ec99876f109c4a51b79c0fbe26c
> phases: add `hg help phases` hint to failures to edit public commits

These are queued for default, thanks.

Patch

diff --git a/hgext/histedit.py b/hgext/histedit.py
--- a/hgext/histedit.py
+++ b/hgext/histedit.py
@@ -928,7 +928,8 @@  def between(repo, old, new, keep):
             raise util.Abort(_('cannot edit history that contains merges'))
         root = ctxs[0] # list is already sorted by repo.set
         if not root.mutable():
-            raise util.Abort(_('cannot edit public changeset: %s') % root)
+            raise util.Abort(_('cannot edit public changeset: %s') % root,
+                             hint=_('see "hg help phases" for details'))
     return [c.node() for c in ctxs]
 
 def makedesc(repo, action, rev):
diff --git a/mercurial/obsolete.py b/mercurial/obsolete.py
--- a/mercurial/obsolete.py
+++ b/mercurial/obsolete.py
@@ -1215,7 +1215,8 @@  def createmarkers(repo, relations, flag=
 
             if not prec.mutable():
                 raise util.Abort("cannot obsolete public changeset: %s"
-                                 % prec)
+                                 % prec,
+                                 hint='see "hg help phases" for details')
             nprec = prec.node()
             nsucs = tuple(s.node() for s in sucs)
             npare = None
diff --git a/tests/test-histedit-obsolete.t b/tests/test-histedit-obsolete.t
--- a/tests/test-histedit-obsolete.t
+++ b/tests/test-histedit-obsolete.t
@@ -220,6 +220,7 @@  Check that histedit respect immutability
   
   $ hg histedit -r '.~2'
   abort: cannot edit public changeset: cb9a9f314b8b
+  (see "hg help phases" for details)
   [255]