comparison mercurial/localrepo.py @ 16422:c0b5bab3fb11

changegroupsubset: avoid setdefault in inner loop
author Matt Mackall <mpm@selenic.com>
date Fri, 13 Apr 2012 22:55:46 -0500
parents 859ef739339e
children 70bf4dc52c91
comparison
equal deleted inserted replaced
16421:859ef739339e 16422:c0b5bab3fb11
1852 unit=_changesets, total=count[1]) 1852 unit=_changesets, total=count[1])
1853 return x 1853 return x
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])
1867 return fstate[1][x] 1867 return fstate[1][x]
1868 1868
1881 yield chunk 1881 yield chunk
1882 progress(_bundling, None) 1882 progress(_bundling, None)
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
1889 progress(_bundling, None) 1891 progress(_bundling, None)
1890 1892