comparison hgext/remotefilelog/shallowbundle.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 3a333a582d7b
children fc2766860796
comparison
equal deleted inserted replaced
40508:354acd0dc637 40509:ed19958dbf5d
15 match, 15 match,
16 mdiff, 16 mdiff,
17 pycompat, 17 pycompat,
18 ) 18 )
19 from . import ( 19 from . import (
20 constants,
20 remotefilelog, 21 remotefilelog,
21 shallowutil, 22 shallowutil,
22 ) 23 )
23 24
24 NoFiles = 0 25 NoFiles = 0
98 if source == "push" or source == "bundle": 99 if source == "push" or source == "bundle":
99 return AllFiles 100 return AllFiles
100 101
101 caps = self._bundlecaps or [] 102 caps = self._bundlecaps or []
102 if source == "serve" or source == "pull": 103 if source == "serve" or source == "pull":
103 if 'remotefilelog' in caps: 104 if constants.BUNDLE2_CAPABLITY in caps:
104 return LocalFiles 105 return LocalFiles
105 else: 106 else:
106 # Serving to a full repo requires us to serve everything 107 # Serving to a full repo requires us to serve everything
107 repo.ui.warn(_("pulling from a shallow repo\n")) 108 repo.ui.warn(_("pulling from a shallow repo\n"))
108 return AllFiles 109 return AllFiles