##// END OF EJS Templates
changegroup: inline prune() logic from narrow...
Gregory Szorc -
r38842:5742d042 default
parent child Browse files
Show More
@@ -12,7 +12,6 b' from mercurial import ('
12 changegroup,
12 changegroup,
13 error,
13 error,
14 extensions,
14 extensions,
15 manifest,
16 mdiff,
15 mdiff,
17 node,
16 node,
18 pycompat,
17 pycompat,
@@ -21,15 +20,6 b' from mercurial import ('
21 )
20 )
22
21
23 def setup():
22 def setup():
24 def prune(orig, self, revlog, missing, commonrevs):
25 if isinstance(revlog, manifest.manifestrevlog):
26 if not self._filematcher.visitdir(revlog._dir[:-1] or '.'):
27 return []
28
29 return orig(self, revlog, missing, commonrevs)
30
31 extensions.wrapfunction(changegroup.cg1packer, 'prune', prune)
32
33 def generatefiles(orig, self, changedfiles, linknodes, commonrevs,
23 def generatefiles(orig, self, changedfiles, linknodes, commonrevs,
34 source):
24 source):
35 changedfiles = list(filter(self._filematcher, changedfiles))
25 changedfiles = list(filter(self._filematcher, changedfiles))
@@ -21,6 +21,7 b' from .node import ('
21 from . import (
21 from . import (
22 dagutil,
22 dagutil,
23 error,
23 error,
24 manifest,
24 match as matchmod,
25 match as matchmod,
25 mdiff,
26 mdiff,
26 phases,
27 phases,
@@ -589,6 +590,11 b' class cg1packer(object):'
589
590
590 # filter any nodes that claim to be part of the known set
591 # filter any nodes that claim to be part of the known set
591 def prune(self, revlog, missing, commonrevs):
592 def prune(self, revlog, missing, commonrevs):
593 # TODO this violates storage abstraction for manifests.
594 if isinstance(revlog, manifest.manifestrevlog):
595 if not self._filematcher.visitdir(revlog._dir[:-1] or '.'):
596 return []
597
592 rr, rl = revlog.rev, revlog.linkrev
598 rr, rl = revlog.rev, revlog.linkrev
593 return [n for n in missing if rl(rr(n)) not in commonrevs]
599 return [n for n in missing if rl(rr(n)) not in commonrevs]
594
600
General Comments 0
You need to be logged in to leave comments. Login now