# HG changeset patch # User Gregory Szorc # Date 1443985410 25200 # Node ID eda32ee9962f4fe434e016f6839c749f37cd4fb9 # Parent 9a7fc6d4889836e1a4ae4fd26359b61cfc5f7f80 exchange: expose bundle2 availability on pulloperation Like the previous patch, the value is cached and will prevent a function level import in streamclone.py. diff -r 9a7fc6d48898 -r eda32ee9962f mercurial/exchange.py --- a/mercurial/exchange.py Sun Oct 04 18:31:53 2015 -0700 +++ b/mercurial/exchange.py Sun Oct 04 12:03:30 2015 -0700 @@ -894,6 +894,10 @@ return self.heads @util.propertycache + def canusebundle2(self): + return _canusebundle2(self) + + @util.propertycache def remotebundle2caps(self): return bundle2.bundle2caps(self.remote) @@ -970,7 +974,7 @@ pullop.trmanager = transactionmanager(repo, 'pull', remote.url()) streamclone.maybeperformlegacystreamclone(pullop) _pulldiscovery(pullop) - if _canusebundle2(pullop): + if pullop.canusebundle2: _pullbundle2(pullop) _pullchangeset(pullop) _pullphase(pullop) @@ -1021,7 +1025,7 @@ discovery to reduce the chance and impact of race conditions.""" if pullop.remotebookmarks is not None: return - if _canusebundle2(pullop) and 'listkeys' in pullop.remotebundle2caps: + if pullop.canusebundle2 and 'listkeys' in pullop.remotebundle2caps: # all known bundle2 servers now support listkeys, but lets be nice with # new implementation. return