# HG changeset patch # User Martin von Zweigbergk # Date 2018-02-28 18:55:21 # Node ID 94709406f10dac47971eef08acf41f25d7fe330f # Parent 3f0af89e008d048352a4c8434cf115244cc6ec67 narrow: move changegroup.supportedoutgoingversions() override to core Also document why we need cg3 or higher. Differential Revision: https://phab.mercurial-scm.org/D2488 diff --git a/hgext/narrow/narrowchangegroup.py b/hgext/narrow/narrowchangegroup.py --- a/hgext/narrow/narrowchangegroup.py +++ b/hgext/narrow/narrowchangegroup.py @@ -21,16 +21,6 @@ from mercurial import ( def setup(): - def supportedoutgoingversions(orig, repo): - versions = orig(repo) - if changegroup.NARROW_REQUIREMENT in repo.requirements: - versions.discard('01') - versions.discard('02') - return versions - - extensions.wrapfunction(changegroup, 'supportedoutgoingversions', - supportedoutgoingversions) - def prune(orig, self, revlog, missing, commonrevs): if isinstance(revlog, manifest.manifestrevlog): matcher = getattr(self._repo, 'narrowmatch', diff --git a/mercurial/changegroup.py b/mercurial/changegroup.py --- a/mercurial/changegroup.py +++ b/mercurial/changegroup.py @@ -898,6 +898,11 @@ def supportedoutgoingversions(repo): # support versions 01 and 02. versions.discard('01') versions.discard('02') + if NARROW_REQUIREMENT in repo.requirements: + # Versions 01 and 02 don't support revlog flags, and we need to + # support that for stripping and unbundling to work. + versions.discard('01') + versions.discard('02') return versions def localversion(repo):