##// END OF EJS Templates
changegroup: avoid iterating the whole manifest...
Augie Fackler -
r27237:c08814b4 default
parent child Browse files
Show More
@@ -613,7 +613,8 b' class cg1packer(object):'
613 clrevorder = {}
613 clrevorder = {}
614 mfs = {} # needed manifests
614 mfs = {} # needed manifests
615 fnodes = {} # needed file nodes
615 fnodes = {} # needed file nodes
616 changedfiles = set()
616 # maps manifest node id -> set(changed files)
617 mfchangedfiles = {}
617
618
618 # Callback for the changelog, used to collect changed files and manifest
619 # Callback for the changelog, used to collect changed files and manifest
619 # nodes.
620 # nodes.
@@ -621,9 +622,12 b' class cg1packer(object):'
621 def lookupcl(x):
622 def lookupcl(x):
622 c = cl.read(x)
623 c = cl.read(x)
623 clrevorder[x] = len(clrevorder)
624 clrevorder[x] = len(clrevorder)
624 changedfiles.update(c[3])
625 n = c[0]
625 # record the first changeset introducing this manifest version
626 # record the first changeset introducing this manifest version
626 mfs.setdefault(c[0], x)
627 mfs.setdefault(n, x)
628 # Record a complete list of potentially-changed files in
629 # this manifest.
630 mfchangedfiles.setdefault(n, set()).update(c[3])
627 return x
631 return x
628
632
629 self._verbosenote(_('uncompressed size of bundle content:\n'))
633 self._verbosenote(_('uncompressed size of bundle content:\n'))
@@ -668,8 +672,12 b' class cg1packer(object):'
668 clnode = mfs[x]
672 clnode = mfs[x]
669 if not fastpathlinkrev:
673 if not fastpathlinkrev:
670 mdata = ml.readfast(x)
674 mdata = ml.readfast(x)
671 for f, n in mdata.iteritems():
675 for f in mfchangedfiles[x]:
672 if f in changedfiles:
676 if True:
677 try:
678 n = mdata[f]
679 except KeyError:
680 continue
673 # record the first changeset introducing this filelog
681 # record the first changeset introducing this filelog
674 # version
682 # version
675 fclnodes = fnodes.setdefault(f, {})
683 fclnodes = fnodes.setdefault(f, {})
@@ -696,6 +704,9 b' class cg1packer(object):'
696 return dict(genfilenodes())
704 return dict(genfilenodes())
697 return fnodes.get(fname, {})
705 return fnodes.get(fname, {})
698
706
707 changedfiles = set()
708 for x in mfchangedfiles.itervalues():
709 changedfiles.update(x)
699 for chunk in self.generatefiles(changedfiles, linknodes, commonrevs,
710 for chunk in self.generatefiles(changedfiles, linknodes, commonrevs,
700 source):
711 source):
701 yield chunk
712 yield chunk
General Comments 0
You need to be logged in to leave comments. Login now