Patchwork [1,of,1] require: provide a link to a wiki page in addition of suggesting upgrade

login
register
mail settings
Submitter Pierre-Yves David
Date March 13, 2014, 8:56 p.m.
Message ID <3b2bd825bcc092ad23f0.1394744199@marginatus.alto.octopoid.net>
Download mbox | patch
Permalink /patch/3942/
State Accepted
Commit 308a39c9d3ddd77b009e27ee240aaa335b503ae6
Headers show

Comments

Pierre-Yves David - March 13, 2014, 8:56 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@ens-lyon.org>
# Date 1308962783 -7200
#      Sat Jun 25 02:46:23 2011 +0200
# Node ID 3b2bd825bcc092ad23f0556beb4dc7c900b33564
# Parent  2764148aa088da248f74d1bf92e5d504f7f4db9a
require: provide a link to a wiki page in addition of suggesting upgrade

The wiki page is intended to describe several solution to the requirement issue.
Some of those solutions does not involve upgrading mercurial. That is very
useful for people that can't easily upgrade they Mercurial in some place.
Augie Fackler - March 13, 2014, 9:27 p.m.
On Thu, Mar 13, 2014 at 01:56:39PM -0700, pierre-yves.david@ens-lyon.org wrote:
> # HG changeset patch
> # User Pierre-Yves David <pierre-yves.david@ens-lyon.org>
> # Date 1308962783 -7200
> #      Sat Jun 25 02:46:23 2011 +0200
> # Node ID 3b2bd825bcc092ad23f0556beb4dc7c900b33564
> # Parent  2764148aa088da248f74d1bf92e5d504f7f4db9a
> require: provide a link to a wiki page in addition of suggesting upgrade

Queued, thanks.

>
> The wiki page is intended to describe several solution to the requirement issue.
> Some of those solutions does not involve upgrading mercurial. That is very
> useful for people that can't easily upgrade they Mercurial in some place.
>
> diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py
> --- a/mercurial/scmutil.py
> +++ b/mercurial/scmutil.py
> @@ -733,11 +733,13 @@ def readrequires(opener, supported):
>              missings.append(r)
>      missings.sort()
>      if missings:
>          raise error.RequirementError(
>              _("unknown repository format: requires features '%s' (upgrade "
> -              "Mercurial)") % "', '".join(missings))
> +              "Mercurial)") % "', '".join(missings),
> +            hint=_("see http://mercurial.selenic.com/wiki/MissingRequirement"
> +                   " for details"))
>      return requirements
>
>  class filecachesubentry(object):
>      def __init__(self, path, stat):
>          self.path = path
> diff --git a/tests/test-commit.t b/tests/test-commit.t
> --- a/tests/test-commit.t
> +++ b/tests/test-commit.t
> @@ -101,10 +101,11 @@ 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)
>    [255]
>
>    $ cd ..
>
>
> diff --git a/tests/test-identify.t b/tests/test-identify.t
> --- a/tests/test-identify.t
> +++ b/tests/test-identify.t
> @@ -112,13 +112,15 @@ test remote identify with bookmarks
>  Make sure we do not obscure unknown requires file entries (issue2649)
>
>    $ echo fake >> .hg/requires
>    $ hg id
>    abort: unknown repository format: requires features 'fake' (upgrade Mercurial)!
> +  (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)!
> +  (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
> @@ -2258,10 +2258,11 @@ enabling largefiles extension.
>    > EOF
>    $ 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)
>    [255]
>
>    $ hg init push-dst
>    $ hg -R enabledlocally push push-dst
>    pushing to push-dst
> @@ -2274,10 +2275,11 @@ enabling largefiles extension.
>    abort: required features are not supported in the destination: largefiles
>    [255]
>
>    $ hg clone enabledlocally clone-dst
>    abort: unknown repository format: requires features 'largefiles' (upgrade Mercurial)!
> +  (see http://mercurial.selenic.com/wiki/MissingRequirement for details)
>    [255]
>    $ test -d clone-dst
>    [1]
>    $ hg clone --pull enabledlocally clone-pull-dst
>    abort: required features are not supported in the destination: largefiles
> diff --git a/tests/test-requires.t b/tests/test-requires.t
> --- a/tests/test-requires.t
> +++ b/tests/test-requires.t
> @@ -8,14 +8,16 @@
>    abort: index 00changelog.i unknown format 2!
>    [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)
>    [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)
>    [255]
>    $ cd ..
>
>  Test checking between features supported locally and ones required in
>  another repository of push/pull/clone on localhost:
> @@ -59,10 +61,11 @@ another repository of push/pull/clone on
>    abort: required features are not supported in the destination: featuresetup-test
>    [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)
>    [255]
>    $ hg clone --pull supported clone-dst
>    abort: required features are not supported in the destination: featuresetup-test
>    [255]
>
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel

Patch

diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py
--- a/mercurial/scmutil.py
+++ b/mercurial/scmutil.py
@@ -733,11 +733,13 @@  def readrequires(opener, supported):
             missings.append(r)
     missings.sort()
     if missings:
         raise error.RequirementError(
             _("unknown repository format: requires features '%s' (upgrade "
-              "Mercurial)") % "', '".join(missings))
+              "Mercurial)") % "', '".join(missings),
+            hint=_("see http://mercurial.selenic.com/wiki/MissingRequirement"
+                   " for details"))
     return requirements
 
 class filecachesubentry(object):
     def __init__(self, path, stat):
         self.path = path
diff --git a/tests/test-commit.t b/tests/test-commit.t
--- a/tests/test-commit.t
+++ b/tests/test-commit.t
@@ -101,10 +101,11 @@  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)
   [255]
 
   $ cd ..
 
 
diff --git a/tests/test-identify.t b/tests/test-identify.t
--- a/tests/test-identify.t
+++ b/tests/test-identify.t
@@ -112,13 +112,15 @@  test remote identify with bookmarks
 Make sure we do not obscure unknown requires file entries (issue2649)
 
   $ echo fake >> .hg/requires
   $ hg id
   abort: unknown repository format: requires features 'fake' (upgrade Mercurial)!
+  (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)!
+  (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
@@ -2258,10 +2258,11 @@  enabling largefiles extension.
   > EOF
   $ 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)
   [255]
 
   $ hg init push-dst
   $ hg -R enabledlocally push push-dst
   pushing to push-dst
@@ -2274,10 +2275,11 @@  enabling largefiles extension.
   abort: required features are not supported in the destination: largefiles
   [255]
 
   $ hg clone enabledlocally clone-dst
   abort: unknown repository format: requires features 'largefiles' (upgrade Mercurial)!
+  (see http://mercurial.selenic.com/wiki/MissingRequirement for details)
   [255]
   $ test -d clone-dst
   [1]
   $ hg clone --pull enabledlocally clone-pull-dst
   abort: required features are not supported in the destination: largefiles
diff --git a/tests/test-requires.t b/tests/test-requires.t
--- a/tests/test-requires.t
+++ b/tests/test-requires.t
@@ -8,14 +8,16 @@ 
   abort: index 00changelog.i unknown format 2!
   [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)
   [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)
   [255]
   $ cd ..
 
 Test checking between features supported locally and ones required in
 another repository of push/pull/clone on localhost:
@@ -59,10 +61,11 @@  another repository of push/pull/clone on
   abort: required features are not supported in the destination: featuresetup-test
   [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)
   [255]
   $ hg clone --pull supported clone-dst
   abort: required features are not supported in the destination: featuresetup-test
   [255]