phases: rewrite "immutable changeset" to "public changeset"
authorJordi Gutiérrez Hermoso <jordigh@octave.org>
Mon, 01 Jun 2015 18:05:38 +0000
changeset 25411 d298805fb639
parent 25410 eee88912db0a
child 25412 443d4635e630
phases: rewrite "immutable changeset" to "public changeset" The phrase "cannot edit immutable changeset" is kind of tautological. Of course unchangeable things can't be changed. We instead mention "public" and provide a hint so that we can point to the actual problem. Even in cases where some operation other than edition cannot be performed, "public" gives the root cause that results in the "immutable" effect. There is a precedent for saying "public" instead of "immutable", for example, in `hg commit --amend`.
hgext/histedit.py
hgext/mq.py
hgext/rebase.py
mercurial/obsolete.py
tests/test-histedit-obsolete.t
tests/test-mq-safety.t
tests/test-rebase-interruptions.t
tests/test-rebase-scenario-global.t
--- a/hgext/histedit.py	Tue Jun 02 15:04:39 2015 -0400
+++ b/hgext/histedit.py	Mon Jun 01 18:05:38 2015 +0000
@@ -928,7 +928,7 @@
             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 immutable changeset: %s') % root)
+            raise util.Abort(_('cannot edit public changeset: %s') % root)
     return [c.node() for c in ctxs]
 
 def makedesc(repo, action, rev):
--- a/hgext/mq.py	Tue Jun 02 15:04:39 2015 -0400
+++ b/hgext/mq.py	Mon Jun 01 18:05:38 2015 +0000
@@ -1526,7 +1526,7 @@
                                    "managed by this patch queue"))
             if not repo[self.applied[-1].node].mutable():
                 raise util.Abort(
-                    _("popping would remove an immutable revision"),
+                    _("popping would remove a public revision"),
                     hint=_('see "hg help phases" for details'))
 
             # we know there are no local changes, so we can make a simplified
@@ -1597,7 +1597,7 @@
             if repo.changelog.heads(top) != [top]:
                 raise util.Abort(_("cannot refresh a revision with children"))
             if not repo[top].mutable():
-                raise util.Abort(_("cannot refresh immutable revision"),
+                raise util.Abort(_("cannot refresh public revision"),
                                  hint=_('see "hg help phases" for details'))
 
             cparents = repo.changelog.parents(top)
--- a/hgext/rebase.py	Tue Jun 02 15:04:39 2015 -0400
+++ b/hgext/rebase.py	Mon Jun 01 18:05:38 2015 +0000
@@ -330,7 +330,7 @@
 
             root = min(rebaseset)
             if not keepf and not repo[root].mutable():
-                raise util.Abort(_("can't rebase immutable changeset %s")
+                raise util.Abort(_("can't rebase public changeset %s")
                                  % repo[root],
                                  hint=_('see "hg help phases" for details'))
 
@@ -869,7 +869,7 @@
     immutable = [d for d in dstates if not repo[d].mutable()]
     cleanup = True
     if immutable:
-        repo.ui.warn(_("warning: can't clean up immutable changesets %s\n")
+        repo.ui.warn(_("warning: can't clean up public changesets %s\n")
                      % ', '.join(str(repo[r]) for r in immutable),
                      hint=_('see "hg help phases" for details'))
         cleanup = False
--- a/mercurial/obsolete.py	Tue Jun 02 15:04:39 2015 -0400
+++ b/mercurial/obsolete.py	Mon Jun 01 18:05:38 2015 +0000
@@ -1214,7 +1214,7 @@
                 localmetadata.update(rel[2])
 
             if not prec.mutable():
-                raise util.Abort("cannot obsolete immutable changeset: %s"
+                raise util.Abort("cannot obsolete public changeset: %s"
                                  % prec)
             nprec = prec.node()
             nsucs = tuple(s.node() for s in sucs)
--- a/tests/test-histedit-obsolete.t	Tue Jun 02 15:04:39 2015 -0400
+++ b/tests/test-histedit-obsolete.t	Mon Jun 01 18:05:38 2015 +0000
@@ -219,7 +219,7 @@
   o  0:cb9a9f314b8b (public) a
   
   $ hg histedit -r '.~2'
-  abort: cannot edit immutable changeset: cb9a9f314b8b
+  abort: cannot edit public changeset: cb9a9f314b8b
   [255]
 
 
--- a/tests/test-mq-safety.t	Tue Jun 02 15:04:39 2015 -0400
+++ b/tests/test-mq-safety.t	Mon Jun 01 18:05:38 2015 +0000
@@ -25,17 +25,17 @@
   $ hg phase --public qbase
   $ echo babar >> foo
   $ hg qref
-  abort: cannot refresh immutable revision
+  abort: cannot refresh public revision
   (see "hg help phases" for details)
   [255]
   $ hg revert -a
   reverting foo
   $ hg qpop
-  abort: popping would remove an immutable revision
+  abort: popping would remove a public revision
   (see "hg help phases" for details)
   [255]
   $ hg qfold bar
-  abort: cannot refresh immutable revision
+  abort: cannot refresh public revision
   (see "hg help phases" for details)
   [255]
   $ hg revert -a
--- a/tests/test-rebase-interruptions.t	Tue Jun 02 15:04:39 2015 -0400
+++ b/tests/test-rebase-interruptions.t	Mon Jun 01 18:05:38 2015 +0000
@@ -258,7 +258,7 @@
 Abort the rebasing:
 
   $ hg rebase --abort
-  warning: can't clean up immutable changesets 45396c49d53b
+  warning: can't clean up public changesets 45396c49d53b
   rebase aborted
 
   $ hg tglogp
--- a/tests/test-rebase-scenario-global.t	Tue Jun 02 15:04:39 2015 -0400
+++ b/tests/test-rebase-scenario-global.t	Mon Jun 01 18:05:38 2015 +0000
@@ -308,7 +308,7 @@
   nothing to rebase
   [1]
   $ hg rebase -d 5 -b 6
-  abort: can't rebase immutable changeset e1c4361dd923
+  abort: can't rebase public changeset e1c4361dd923
   (see "hg help phases" for details)
   [255]