Patchwork [1,of,2] bundlerepo: use supportedincomingversions instead of allsupportedversions

login
register
mail settings
Submitter Augie Fackler
Date Aug. 4, 2016, 6:17 p.m.
Message ID <c6da11db73e97aceabcc.1470334665@arthedain.pit.corp.google.com>
Download mbox | patch
Permalink /patch/16092/
State Changes Requested
Headers show

Comments

Augie Fackler - Aug. 4, 2016, 6:17 p.m.
# HG changeset patch
# User Augie Fackler <augie@google.com>
# Date 1470334415 14400
#      Thu Aug 04 14:13:35 2016 -0400
# Node ID c6da11db73e97aceabcc85c9f5bb893643bf01a7
# Parent  f2846d54664567083fdd8e400b8021e09b498c48
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
@@ -283,7 +283,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():