Patchwork [5,of,9] repo: clarify 'requires feature' error further, suggest enabling the feature

login
register
mail settings
Submitter Mads Kiilerich
Date March 18, 2014, 11:33 p.m.
Message ID <41894a7fe54a8b98d45b.1395185633@localhost.localdomain>
Download mbox | patch
Permalink /patch/3978/
State Accepted
Headers show

Comments

Mads Kiilerich - March 18, 2014, 11:33 p.m.
# HG changeset patch
# User Mads Kiilerich <madski@unity3d.com>
# Date 1395184710 -3600
#      Wed Mar 19 00:18:30 2014 +0100
# Node ID 41894a7fe54a8b98d45b782ef49245486f24c0dc
# Parent  707d9e8921215ad47b5b1712f6c06b0d345c6296
repo: clarify 'requires feature' error further, suggest enabling the feature

The error message for unknown 'requires' tries to guess what the root cause of
the problem is and how the user could solve it. It did not consider that an
extension could provide the missing feature. The message was thus quite
misleading if the problem was a missing largefile extension.

This error message was recently improved so it now also gives a hint mentioning
a wiki page. The change done here is however still relevant.
Siddharth Agarwal - March 19, 2014, 2:59 a.m.
On 03/18/2014 04:33 PM, Mads Kiilerich wrote:
>               _("unknown repository format: requires features '%s' (upgrade "
> -              "Mercurial)") % "', '".join(missings),
> +              "Mercurial or enable feature)") % "', '".join(missings),

Could you turn this into a hint, please?

Patch

diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py
--- a/mercurial/scmutil.py
+++ b/mercurial/scmutil.py
@@ -735,7 +735,7 @@  def readrequires(opener, supported):
     if missings:
         raise error.RequirementError(
             _("unknown repository format: requires features '%s' (upgrade "
-              "Mercurial)") % "', '".join(missings),
+              "Mercurial or enable feature)") % "', '".join(missings),
             hint=_("see http://mercurial.selenic.com/wiki/MissingRequirement"
                    " for details"))
     return requirements
diff --git a/tests/test-commit.t b/tests/test-commit.t
--- a/tests/test-commit.t
+++ b/tests/test-commit.t
@@ -102,7 +102,7 @@  Make sure we do not obscure unknown requ
   $ echo foo >> foo
   $ echo fake >> .hg/requires
   $ hg commit -m bla
-  abort: unknown repository format: requires features 'fake' (upgrade Mercurial)!
+  abort: unknown repository format: requires features 'fake' (upgrade Mercurial or enable feature)!
   (see http://mercurial.selenic.com/wiki/MissingRequirement for details)
   [255]
 
diff --git a/tests/test-identify.t b/tests/test-identify.t
--- a/tests/test-identify.t
+++ b/tests/test-identify.t
@@ -113,14 +113,14 @@  Make sure we do not obscure unknown requ
 
   $ echo fake >> .hg/requires
   $ hg id
-  abort: unknown repository format: requires features 'fake' (upgrade Mercurial)!
+  abort: unknown repository format: requires features 'fake' (upgrade Mercurial or enable feature)!
   (see http://mercurial.selenic.com/wiki/MissingRequirement for details)
   [255]
 
   $ cd ..
 #if no-outer-repo
   $ hg id test
-  abort: unknown repository format: requires features 'fake' (upgrade Mercurial)!
+  abort: unknown repository format: requires features 'fake' (upgrade Mercurial or enable feature)!
   (see http://mercurial.selenic.com/wiki/MissingRequirement for details)
   [255]
 #endif
diff --git a/tests/test-largefiles.t b/tests/test-largefiles.t
--- a/tests/test-largefiles.t
+++ b/tests/test-largefiles.t
@@ -2259,7 +2259,7 @@  enabling largefiles extension.
   $ hg -R enabledlocally root
   $TESTTMP/individualenabling/enabledlocally (glob)
   $ hg -R notenabledlocally root
-  abort: unknown repository format: requires features 'largefiles' (upgrade Mercurial)!
+  abort: unknown repository format: requires features 'largefiles' (upgrade Mercurial or enable feature)!
   (see http://mercurial.selenic.com/wiki/MissingRequirement for details)
   [255]
 
@@ -2276,7 +2276,7 @@  enabling largefiles extension.
   [255]
 
   $ hg clone enabledlocally clone-dst
-  abort: unknown repository format: requires features 'largefiles' (upgrade Mercurial)!
+  abort: unknown repository format: requires features 'largefiles' (upgrade Mercurial or enable feature)!
   (see http://mercurial.selenic.com/wiki/MissingRequirement for details)
   [255]
   $ test -d clone-dst
diff --git a/tests/test-requires.t b/tests/test-requires.t
--- a/tests/test-requires.t
+++ b/tests/test-requires.t
@@ -9,12 +9,12 @@ 
   [255]
   $ echo indoor-pool > .hg/requires
   $ hg tip
-  abort: unknown repository format: requires features 'indoor-pool' (upgrade Mercurial)!
+  abort: unknown repository format: requires features 'indoor-pool' (upgrade Mercurial or enable feature)!
   (see http://mercurial.selenic.com/wiki/MissingRequirement for details)
   [255]
   $ echo outdoor-pool >> .hg/requires
   $ hg tip
-  abort: unknown repository format: requires features 'indoor-pool', 'outdoor-pool' (upgrade Mercurial)!
+  abort: unknown repository format: requires features 'indoor-pool', 'outdoor-pool' (upgrade Mercurial or enable feature)!
   (see http://mercurial.selenic.com/wiki/MissingRequirement for details)
   [255]
   $ cd ..
@@ -62,7 +62,7 @@  another repository of push/pull/clone on
   [255]
 
   $ hg clone supported clone-dst
-  abort: unknown repository format: requires features 'featuresetup-test' (upgrade Mercurial)!
+  abort: unknown repository format: requires features 'featuresetup-test' (upgrade Mercurial or enable feature)!
   (see http://mercurial.selenic.com/wiki/MissingRequirement for details)
   [255]
   $ hg clone --pull supported clone-dst