Patchwork [5,of,6,EVOLVE,V2] fold: reword error message for public commits

login
register
mail settings
Submitter Jordi Gutiérrez Hermoso
Date July 4, 2014, 2:37 p.m.
Message ID <8f4540dd29bed33a514e.1404484649@Iris>
Download mbox | patch
Permalink /patch/5101/
State Not Applicable
Headers show

Comments

Jordi Gutiérrez Hermoso - July 4, 2014, 2:37 p.m.
# HG changeset patch
# User Jordi Gutiérrez Hermoso <jordigh@octave.org>
# Date 1404149835 14400
#      Mon Jun 30 13:37:15 2014 -0400
# Node ID 8f4540dd29bed33a514e9f50ffcb58920f9ddc9d
# Parent  abf61b77edd9214c75b96a969a72279630cd4d62
fold: reword error message for public commits

This rewords the error message when attempting to fold public csets.
It is somewhat clearer to not use contractions in formal writing. It
also uses i18n for it. This commit also adds a new test for this error
message.

Patch

diff --git a/hgext/evolve.py b/hgext/evolve.py
--- a/hgext/evolve.py
+++ b/hgext/evolve.py
@@ -2138,7 +2138,7 @@  def fold(ui, repo, *revs, **opts):
         raise util.Abort("set has multiple roots")
     root = repo[roots[0]]
     if root.phase() <= phases.public:
-        raise util.Abort("can't fold public revisions")
+        raise util.Abort(_("cannot fold public revisions"))
     heads = repo.revs('heads(%ld)', revs)
     if len(heads) > 1:
         raise util.Abort("set has multiple heads")
diff --git a/tests/test-evolve.t b/tests/test-evolve.t
--- a/tests/test-evolve.t
+++ b/tests/test-evolve.t
@@ -623,6 +623,10 @@  Test fold
   abort: cannot fold non-linear revisions
   (given revisions are unrelated to parent of working directory)
   [255]
+  $ hg phase --public 0
+  $ hg fold -r 0
+  abort: cannot fold public revisions
+  [255]
   $ hg fold -r 5
   3 changesets folded
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
@@ -652,7 +656,7 @@  Test fold with wc parent is not the head
   |
   | o  1:73d38bb17fd7@default(draft) add 1
   |/
-  o  0:8685c6d34325@default(draft) add 0
+  o  0:8685c6d34325@default(public) add 0
   
   $ hg log --template '{rev}: {author}\n'
   12: victor