diff hgext/remotefilelog/remotefilelogserver.py @ 40509:ed19958dbf5d

remotefilelog: consolidate and rename bundle2 capability Bonus: we catch a spot where the shallowrepo requirement was being misused as the bundle2 capability. Differential Revision: https://phab.mercurial-scm.org/D5127
author Augie Fackler <augie@google.com>
date Tue, 16 Oct 2018 17:30:47 -0400
parents 354acd0dc637
children fc2766860796
line wrap: on
line diff
--- a/hgext/remotefilelog/remotefilelogserver.py	Tue Oct 16 16:38:40 2018 -0400
+++ b/hgext/remotefilelog/remotefilelogserver.py	Tue Oct 16 17:30:47 2018 -0400
@@ -45,7 +45,7 @@
     def generatefiles(orig, self, changedfiles, linknodes, commonrevs, source,
                       *args, **kwargs):
         caps = self._bundlecaps or []
-        if shallowrepo.requirement in caps:
+        if constants.BUNDLE2_CAPABLITY in caps:
             # only send files that don't match the specified patterns
             includepattern = None
             excludepattern = None
@@ -184,7 +184,7 @@
     def getbundleshallow(repo, proto, others):
         bundlecaps = others.get('bundlecaps', '')
         bundlecaps = set(bundlecaps.split(','))
-        bundlecaps.add('remotefilelog')
+        bundlecaps.add(constants.BUNDLE2_CAPABLITY)
         others['bundlecaps'] = ','.join(bundlecaps)
 
         return wireprotov1server.commands["getbundle"][0](repo, proto, others)