changeset 25412:443d4635e630

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.
author Jordi Gutiérrez Hermoso <jordigh@octave.org>
date Mon, 01 Jun 2015 14:16:52 -0400
parents d298805fb639
children 4d705f6a3c35
files hgext/histedit.py mercurial/obsolete.py tests/test-histedit-obsolete.t
diffstat 3 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/histedit.py	Mon Jun 01 18:05:38 2015 +0000
+++ b/hgext/histedit.py	Mon Jun 01 14:16:52 2015 -0400
@@ -928,7 +928,8 @@
             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):
--- a/mercurial/obsolete.py	Mon Jun 01 18:05:38 2015 +0000
+++ b/mercurial/obsolete.py	Mon Jun 01 14:16:52 2015 -0400
@@ -1215,7 +1215,8 @@
 
             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
--- a/tests/test-histedit-obsolete.t	Mon Jun 01 18:05:38 2015 +0000
+++ b/tests/test-histedit-obsolete.t	Mon Jun 01 14:16:52 2015 -0400
@@ -220,6 +220,7 @@
   
   $ hg histedit -r '.~2'
   abort: cannot edit public changeset: cb9a9f314b8b
+  (see "hg help phases" for details)
   [255]