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]