Patchwork [7,of,9,v3] bundlerepo: use supportedincomingversions instead of allsupportedversions

login
register
mail settings
Submitter Augie Fackler
Date Aug. 5, 2016, 9:45 p.m.
Message ID <d8942cf57007c0d18dd0.1470433508@arthedain.pit.corp.google.com>
Download mbox | patch
Permalink /patch/16139/
State Accepted
Headers show

Comments

Augie Fackler - Aug. 5, 2016, 9:45 p.m.
# HG changeset patch
# User Augie Fackler <augie@google.com>
# Date 1470334415 14400
#      Thu Aug 04 14:13:35 2016 -0400
# Node ID d8942cf57007c0d18dd0400c3c0ee881c3ca2a31
# Parent  bb22ee33a9f98e3e017288c13993e1cef6dbd4ed
bundlerepo: use supportedincomingversions instead of allsupportedversions

Since bundlerepo is really a pull-like operation, this is the correct
method to use here.

Patch

diff --git a/mercurial/bundlerepo.py b/mercurial/bundlerepo.py
--- a/mercurial/bundlerepo.py
+++ b/mercurial/bundlerepo.py
@@ -290,7 +290,8 @@  class bundlerepository(localrepo.localre
                                                   "multiple changegroups")
                     cgstream = part
                     version = part.params.get('version', '01')
-                    if version not in changegroup.allsupportedversions(ui):
+                    legalcgvers = changegroup.supportedincomingversions(self)
+                    if version not in legalcgvers:
                         msg = _('Unsupported changegroup version: %s')
                         raise error.Abort(msg % version)
                     if self.bundle.compressed():