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

login
register
mail settings
Submitter Jordi Gutiérrez Hermoso
Date June 30, 2014, 6:28 p.m.
Message ID <410a9c3b3232bbb0fd6c.1404152911@Iris>
Download mbox | patch
Permalink /patch/5088/
State Changes Requested
Headers show

Comments

Jordi Gutiérrez Hermoso - June 30, 2014, 6:28 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 410a9c3b3232bbb0fd6cd4427b0174311c3ce803
# Parent  0a970a5c0fecd98f16e4b9591713a5f516905646
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
@@ -2119,7 +2119,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