Patchwork [2,of,2] repo: rephrase the "missing requirement" error message

login
register
mail settings
Submitter Mads Kiilerich
Date March 21, 2014, 2:32 a.m.
Message ID <e55fafa14a80f348f9a2.1395369148@localhost.localdomain>
Download mbox | patch
Permalink /patch/4012/
State Accepted
Commit f8e531a3a77cfe8aca930e60e66b5c25122a689e
Headers show

Comments

Mads Kiilerich - March 21, 2014, 2:32 a.m.
# HG changeset patch
# User Mads Kiilerich <madski@unity3d.com>
# Date 1395184710 -3600
#      Wed Mar 19 00:18:30 2014 +0100
# Node ID e55fafa14a80f348f9a22e3b40ee033ebee3f38b
# Parent  2bac025396d7b49d98c9c2298577e083a3f69750
repo: rephrase the "missing requirement" error message

Unknown requirements will now be reported as:
  abort: repository requires features unknown to this Mercurial: largefiles!
  (see http://mercurial.selenic.com/wiki/MissingRequirement for more information)

Some features of this phrasing:
* avoid double ':' in abort message
* make it more clear who requires and knows what
* don't quote the requirement names - it is not something the user entered or
  need the exact spelling of ... and it is "identifiers" that are unambiguous
  anyway
* remove double hint by removing "(upgrade Mercurial)" comment
* don't mention upgrading Mercurial without mentioning enabling the feature -
  instead, just refer to wiki page for both
* don't just talk about "details", talk about "more information"
Mads Kiilerich - March 21, 2014, 2:37 a.m.
I forgot a v2 flag on this series ...


On 03/21/2014 03:32 AM, Mads Kiilerich wrote:
> # HG changeset patch
> # User Mads Kiilerich <madski@unity3d.com>
> # Date 1395184710 -3600
> #      Wed Mar 19 00:18:30 2014 +0100
> # Node ID e55fafa14a80f348f9a22e3b40ee033ebee3f38b
> # Parent  2bac025396d7b49d98c9c2298577e083a3f69750
> repo: rephrase the "missing requirement" error message
>
> Unknown requirements will now be reported as:
>    abort: repository requires features unknown to this Mercurial: largefiles!
>    (see http://mercurial.selenic.com/wiki/MissingRequirement for more information)

I expect some bike shedding of this. Go! But please also check and 
improve the wiki page.

- and shouldn't the wiki page be reanamed to "UnknownRequirements"? The 
message did and do not say "missing" anywhere, and the requirements are 
really not missing - quite the opposite, they are "extra" and unknown.

/Mads

> Some features of this phrasing:
> * avoid double ':' in abort message
> * make it more clear who requires and knows what
> * don't quote the requirement names - it is not something the user entered or
>    need the exact spelling of ... and it is "identifiers" that are unambiguous
>    anyway
> * remove double hint by removing "(upgrade Mercurial)" comment
> * don't mention upgrading Mercurial without mentioning enabling the feature -
>    instead, just refer to wiki page for both
> * don't just talk about "details", talk about "more information"
>
> diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py
> --- a/mercurial/scmutil.py
> +++ b/mercurial/scmutil.py
> @@ -734,10 +734,10 @@ def readrequires(opener, supported):
>       missings.sort()
>       if missings:
>           raise error.RequirementError(
> -            _("unknown repository format: requires features '%s' (upgrade "
> -              "Mercurial)") % "', '".join(missings),
> +            _("repository requires features unknown to this Mercurial: %s")
> +            % " ".join(missings),
>               hint=_("see http://mercurial.selenic.com/wiki/MissingRequirement"
> -                   " for details"))
> +                   " for more information"))
>       return requirements
>
Matt Mackall - March 21, 2014, 10:28 p.m.
On Fri, 2014-03-21 at 03:32 +0100, Mads Kiilerich wrote:
> # HG changeset patch
> # User Mads Kiilerich <madski@unity3d.com>
> # Date 1395184710 -3600
> #      Wed Mar 19 00:18:30 2014 +0100
> # Node ID e55fafa14a80f348f9a22e3b40ee033ebee3f38b
> # Parent  2bac025396d7b49d98c9c2298577e083a3f69750
> repo: rephrase the "missing requirement" error message

These are queued for default, thanks.

Patch

diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py
--- a/mercurial/scmutil.py
+++ b/mercurial/scmutil.py
@@ -734,10 +734,10 @@  def readrequires(opener, supported):
     missings.sort()
     if missings:
         raise error.RequirementError(
-            _("unknown repository format: requires features '%s' (upgrade "
-              "Mercurial)") % "', '".join(missings),
+            _("repository requires features unknown to this Mercurial: %s")
+            % " ".join(missings),
             hint=_("see http://mercurial.selenic.com/wiki/MissingRequirement"
-                   " for details"))
+                   " for more information"))
     return requirements
 
 class filecachesubentry(object):
diff --git a/tests/test-commit.t b/tests/test-commit.t
--- a/tests/test-commit.t
+++ b/tests/test-commit.t
@@ -102,8 +102,8 @@  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)!
-  (see http://mercurial.selenic.com/wiki/MissingRequirement for details)
+  abort: repository requires features unknown to this Mercurial: fake!
+  (see http://mercurial.selenic.com/wiki/MissingRequirement for more information)
   [255]
 
   $ cd ..
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)!
-  (see http://mercurial.selenic.com/wiki/MissingRequirement for details)
+  abort: repository requires features unknown to this Mercurial: fake!
+  (see http://mercurial.selenic.com/wiki/MissingRequirement for more information)
   [255]
 
   $ cd ..
 #if no-outer-repo
   $ hg id test
-  abort: unknown repository format: requires features 'fake' (upgrade Mercurial)!
-  (see http://mercurial.selenic.com/wiki/MissingRequirement for details)
+  abort: repository requires features unknown to this Mercurial: fake!
+  (see http://mercurial.selenic.com/wiki/MissingRequirement for more information)
   [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,8 +2259,8 @@  enabling largefiles extension.
   $ hg -R enabledlocally root
   $TESTTMP/individualenabling/enabledlocally (glob)
   $ hg -R notenabledlocally root
-  abort: unknown repository format: requires features 'largefiles' (upgrade Mercurial)!
-  (see http://mercurial.selenic.com/wiki/MissingRequirement for details)
+  abort: repository requires features unknown to this Mercurial: largefiles!
+  (see http://mercurial.selenic.com/wiki/MissingRequirement for more information)
   [255]
 
   $ hg init push-dst
@@ -2276,8 +2276,8 @@  enabling largefiles extension.
   [255]
 
   $ hg clone enabledlocally clone-dst
-  abort: unknown repository format: requires features 'largefiles' (upgrade Mercurial)!
-  (see http://mercurial.selenic.com/wiki/MissingRequirement for details)
+  abort: repository requires features unknown to this Mercurial: largefiles!
+  (see http://mercurial.selenic.com/wiki/MissingRequirement for more information)
   [255]
   $ test -d clone-dst
   [1]
diff --git a/tests/test-requires.t b/tests/test-requires.t
--- a/tests/test-requires.t
+++ b/tests/test-requires.t
@@ -9,13 +9,13 @@ 
   [255]
   $ echo indoor-pool > .hg/requires
   $ hg tip
-  abort: unknown repository format: requires features 'indoor-pool' (upgrade Mercurial)!
-  (see http://mercurial.selenic.com/wiki/MissingRequirement for details)
+  abort: repository requires features unknown to this Mercurial: indoor-pool!
+  (see http://mercurial.selenic.com/wiki/MissingRequirement for more information)
   [255]
   $ echo outdoor-pool >> .hg/requires
   $ hg tip
-  abort: unknown repository format: requires features 'indoor-pool', 'outdoor-pool' (upgrade Mercurial)!
-  (see http://mercurial.selenic.com/wiki/MissingRequirement for details)
+  abort: repository requires features unknown to this Mercurial: indoor-pool outdoor-pool!
+  (see http://mercurial.selenic.com/wiki/MissingRequirement for more information)
   [255]
   $ cd ..
 
@@ -62,8 +62,8 @@  another repository of push/pull/clone on
   [255]
 
   $ hg clone supported clone-dst
-  abort: unknown repository format: requires features 'featuresetup-test' (upgrade Mercurial)!
-  (see http://mercurial.selenic.com/wiki/MissingRequirement for details)
+  abort: repository requires features unknown to this Mercurial: featuresetup-test!
+  (see http://mercurial.selenic.com/wiki/MissingRequirement for more information)
   [255]
   $ hg clone --pull supported clone-dst
   abort: required features are not supported in the destination: featuresetup-test