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.
--- a/hgext/evolve.py Mon Jun 30 13:29:49 2014 -0400
+++ b/hgext/evolve.py Mon Jun 30 13:37:15 2014 -0400
@@ -2138,7 +2138,7 @@
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")
--- a/tests/test-evolve.t Mon Jun 30 13:29:49 2014 -0400
+++ b/tests/test-evolve.t Mon Jun 30 13:37:15 2014 -0400
@@ -623,6 +623,10 @@
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 @@
|
| 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