# HG changeset patch # User Pierre-Yves David # Date 2011-06-25 00:30:24 # Node ID 72e4fcb43227075897ffa0db4969719bb34537d9 # Parent cae09a39b2d26d1b36fcbde541c920df7794db53 requirements: show all missing features in the error message. Displaying all missing featureis help people to solve the issue (choosing the right version, creation the right repo) diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py --- a/mercurial/scmutil.py +++ b/mercurial/scmutil.py @@ -698,10 +698,14 @@ def readrequires(opener, supported): '''Reads and parses .hg/requires and checks if all entries found are in the list of supported features.''' requirements = set(opener.read("requires").splitlines()) + missings = [] for r in requirements: if r not in supported: if not r or not r[0].isalnum(): raise error.RequirementError(_(".hg/requires file is corrupt")) - raise error.RequirementError(_("unknown repository format: " - "requires feature '%s' (upgrade Mercurial)") % r) + missings.append(r) + missings.sort() + if missings: + raise error.RequirementError(_("unknown repository format: " + "requires features '%s' (upgrade Mercurial)") % "', '".join(missings)) return requirements diff --git a/tests/test-commit.t b/tests/test-commit.t --- a/tests/test-commit.t +++ b/tests/test-commit.t @@ -98,7 +98,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 feature 'fake' (upgrade Mercurial)! + abort: unknown repository format: requires features 'fake' (upgrade Mercurial)! [255] $ cd .. diff --git a/tests/test-identify.t b/tests/test-identify.t --- a/tests/test-identify.t +++ b/tests/test-identify.t @@ -107,11 +107,11 @@ Make sure we do not obscure unknown requ $ echo fake >> .hg/requires $ hg id - abort: unknown repository format: requires feature 'fake' (upgrade Mercurial)! + abort: unknown repository format: requires features 'fake' (upgrade Mercurial)! [255] $ cd .. $ hg id test - abort: unknown repository format: requires feature 'fake' (upgrade Mercurial)! + abort: unknown repository format: requires features 'fake' (upgrade Mercurial)! [255] diff --git a/tests/test-requires.t b/tests/test-requires.t --- a/tests/test-requires.t +++ b/tests/test-requires.t @@ -9,5 +9,9 @@ [255] $ echo indoor-pool > .hg/requires $ hg tip - abort: unknown repository format: requires feature 'indoor-pool' (upgrade Mercurial)! + abort: unknown repository format: requires features 'indoor-pool' (upgrade Mercurial)! [255] + $ echo outdoor-pool >> .hg/requires + $ hg tip + abort: unknown repository format: requires features 'indoor-pool', 'outdoor-pool' (upgrade Mercurial)! + [255]