##// END OF EJS Templates
Optimizing manifest reads in changegroupsubset by using deltas.
Eric Hopper -
r1462:12a8d772 default
parent child Browse files
Show More
@@ -963,7 +963,22 class localrepository:
963 return msng_mnfst_set[mnfstnode]
963 return msng_mnfst_set[mnfstnode]
964
964
965 def filenode_collector(changedfiles):
965 def filenode_collector(changedfiles):
966 next_rev = [0]
966 def collect_msng_filenodes(mnfstnode):
967 def collect_msng_filenodes(mnfstnode):
968 r = mnfst.rev(mnfstnode)
969 if r == next_rev[0]:
970 # If the last rev we looked at was the one just previous,
971 # we only need to see a diff.
972 delta = mdiff.patchtext(mnfst.delta(mnfstnode))
973 for dline in delta.splitlines():
974 f, fnode = dline.split('\0')
975 fnode = bin(fnode[:40])
976 f = changedfiles.get(f, None)
977 if f is not None:
978 clnode = msng_mnfst_set[mnfstnode]
979 ndset = msng_filenode_set.setdefault(f, {})
980 ndset.setdefault(fnode, clnode)
981 else:
967 m = mnfst.read(mnfstnode)
982 m = mnfst.read(mnfstnode)
968 for f in changedfiles:
983 for f in changedfiles:
969 fnode = m.get(f, None)
984 fnode = m.get(f, None)
@@ -971,6 +986,7 class localrepository:
971 clnode = msng_mnfst_set[mnfstnode]
986 clnode = msng_mnfst_set[mnfstnode]
972 ndset = msng_filenode_set.setdefault(f, {})
987 ndset = msng_filenode_set.setdefault(f, {})
973 ndset.setdefault(fnode, clnode)
988 ndset.setdefault(fnode, clnode)
989 next_rev[0] = r + 1
974 return collect_msng_filenodes
990 return collect_msng_filenodes
975
991
976 def prune_filenodes(f, filerevlog):
992 def prune_filenodes(f, filerevlog):
@@ -997,14 +1013,14 class localrepository:
997 prune_manifests()
1013 prune_manifests()
998 msng_mnfst_lst = msng_mnfst_set.keys()
1014 msng_mnfst_lst = msng_mnfst_set.keys()
999 msng_mnfst_lst.sort(cmp_by_rev_func(mnfst))
1015 msng_mnfst_lst.sort(cmp_by_rev_func(mnfst))
1000 changedfiles = changedfiles.keys()
1001 changedfiles.sort()
1002 group = mnfst.group(msng_mnfst_lst, lookup_manifest_link,
1016 group = mnfst.group(msng_mnfst_lst, lookup_manifest_link,
1003 filenode_collector(changedfiles))
1017 filenode_collector(changedfiles))
1004 for chnk in group:
1018 for chnk in group:
1005 yield chnk
1019 yield chnk
1006 msng_mnfst_lst = None
1020 msng_mnfst_lst = None
1007 msng_mnfst_set.clear()
1021 msng_mnfst_set.clear()
1022 changedfiles = changedfiles.keys()
1023 changedfiles.sort()
1008 for fname in changedfiles:
1024 for fname in changedfiles:
1009 filerevlog = self.file(fname)
1025 filerevlog = self.file(fname)
1010 prune_filenodes(fname, filerevlog)
1026 prune_filenodes(fname, filerevlog)
General Comments 0
You need to be logged in to leave comments. Login now