readrequires: provide easier to understand error message
NEW:
$ hg id
abort: unknown repository format: requires feature 'foo' (upgrade Mercurial)!
OLD:
$ hg id
abort: requirement 'foo' not supported!
--- a/mercurial/scmutil.py Tue May 31 19:16:18 2011 +0200
+++ b/mercurial/scmutil.py Tue May 31 19:16:25 2011 +0200
@@ -698,6 +698,6 @@
requirements = set(opener.read("requires").splitlines())
for r in requirements:
if r not in supported:
- raise error.RequirementError(
- _("requirement '%s' not supported") % r)
+ raise error.RequirementError(_("unknown repository format: "
+ "requires feature '%s' (upgrade Mercurial)") % r)
return requirements
--- a/tests/test-commit.t Tue May 31 19:16:18 2011 +0200
+++ b/tests/test-commit.t Tue May 31 19:16:25 2011 +0200
@@ -98,7 +98,7 @@
$ echo foo >> foo
$ echo fake >> .hg/requires
$ hg commit -m bla
- abort: requirement 'fake' not supported!
+ abort: unknown repository format: requires feature 'fake' (upgrade Mercurial)!
[255]
$ cd ..
--- a/tests/test-identify.t Tue May 31 19:16:18 2011 +0200
+++ b/tests/test-identify.t Tue May 31 19:16:25 2011 +0200
@@ -107,11 +107,11 @@
$ echo fake >> .hg/requires
$ hg id
- abort: requirement 'fake' not supported!
+ abort: unknown repository format: requires feature 'fake' (upgrade Mercurial)!
[255]
$ cd ..
$ hg id test
- abort: requirement 'fake' not supported!
+ abort: unknown repository format: requires feature 'fake' (upgrade Mercurial)!
[255]
--- a/tests/test-requires.t Tue May 31 19:16:18 2011 +0200
+++ b/tests/test-requires.t Tue May 31 19:16:25 2011 +0200
@@ -9,5 +9,5 @@
[255]
$ echo indoor-pool > .hg/requires
$ hg tip
- abort: requirement 'indoor-pool' not supported!
+ abort: unknown repository format: requires feature 'indoor-pool' (upgrade Mercurial)!
[255]