##// END OF EJS Templates
changegroupsubset: avoid setdefault in inner loop
Matt Mackall -
r16422:c0b5bab3 default
parent child Browse files
Show More
@@ -1854,13 +1854,13 b' class localrepository(repo.repository):'
1854 elif revlog == mf:
1854 elif revlog == mf:
1855 clnode = mfs[x]
1855 clnode = mfs[x]
1856 mdata = mf.readfast(x)
1856 mdata = mf.readfast(x)
1857 for f in mdata:
1857 for f, n in mdata.iteritems():
1858 if f in changedfiles:
1858 if f in changedfiles:
1859 fnodes.setdefault(f, {}).setdefault(mdata[f], clnode)
1859 fnodes[f].setdefault(n, clnode)
1860 count[0] += 1
1860 count[0] += 1
1861 progress(_bundling, count[0],
1861 progress(_bundling, count[0],
1862 unit=_manifests, total=count[1])
1862 unit=_manifests, total=count[1])
1863 return mfs[x]
1863 return clnode
1864 else:
1864 else:
1865 progress(_bundling, count[0], item=fstate[0],
1865 progress(_bundling, count[0], item=fstate[0],
1866 unit=_files, total=count[1])
1866 unit=_files, total=count[1])
@@ -1883,6 +1883,8 b' class localrepository(repo.repository):'
1883
1883
1884 # Create a generator for the manifestnodes that calls our lookup
1884 # Create a generator for the manifestnodes that calls our lookup
1885 # and data collection functions back.
1885 # and data collection functions back.
1886 for f in changedfiles:
1887 fnodes[f] = {}
1886 count[:] = [0, len(mfs)]
1888 count[:] = [0, len(mfs)]
1887 for chunk in mf.group(prune(mf, mfs), bundler, reorder=reorder):
1889 for chunk in mf.group(prune(mf, mfs), bundler, reorder=reorder):
1888 yield chunk
1890 yield chunk
General Comments 0
You need to be logged in to leave comments. Login now