Mercurial > public > mercurial-scm > hg
comparison mercurial/localrepo.py @ 13713:ee4f7109457e
changegroup: drop expensive redundant usage of readdelta for progress
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Sun, 20 Mar 2011 20:16:51 -0500 |
parents | c4706accf310 |
children | 7f53ce232d63 |
comparison
equal
deleted
inserted
replaced
13712:c4706accf310 | 13713:ee4f7109457e |
---|---|
1509 # dividing by 3 gives an approximation of how many | 1509 # dividing by 3 gives an approximation of how many |
1510 # nodes have been processed. | 1510 # nodes have been processed. |
1511 self.ui.progress(_('bundling'), count / 3, | 1511 self.ui.progress(_('bundling'), count / 3, |
1512 unit=_('changesets')) | 1512 unit=_('changesets')) |
1513 changecount = count / 3 | 1513 changecount = count / 3 |
1514 efiles = len(changedfiles) | |
1514 self.ui.progress(_('bundling'), None) | 1515 self.ui.progress(_('bundling'), None) |
1515 | 1516 |
1516 prune(mf, mfs) | 1517 prune(mf, mfs) |
1517 # Create a generator for the manifestnodes that calls our lookup | 1518 # Create a generator for the manifestnodes that calls our lookup |
1518 # and data collection functions back. | 1519 # and data collection functions back. |
1519 group = mf.group(sorted(mfs, key=mf.rev), | 1520 group = mf.group(sorted(mfs, key=mf.rev), |
1520 lambda mnode: mfs[mnode], | 1521 lambda mnode: mfs[mnode], |
1521 filenode_collector(changedfiles)) | 1522 filenode_collector(changedfiles)) |
1522 efiles = {} | |
1523 for count, chunk in enumerate(group): | 1523 for count, chunk in enumerate(group): |
1524 if count % 3 == 1: | |
1525 mnode = chunk[:20] | |
1526 efiles.update(mf.readdelta(mnode)) | |
1527 yield chunk | 1524 yield chunk |
1528 # see above comment for why we divide by 3 | 1525 # see above comment for why we divide by 3 |
1529 self.ui.progress(_('bundling'), count / 3, | 1526 self.ui.progress(_('bundling'), count / 3, |
1530 unit=_('manifests'), total=changecount) | 1527 unit=_('manifests'), total=changecount) |
1531 self.ui.progress(_('bundling'), None) | 1528 self.ui.progress(_('bundling'), None) |
1532 efiles = len(efiles) | |
1533 | 1529 |
1534 mfs.clear() | 1530 mfs.clear() |
1535 | 1531 |
1536 # Go through all our files in order sorted by name. | 1532 # Go through all our files in order sorted by name. |
1537 for idx, fname in enumerate(sorted(changedfiles)): | 1533 for idx, fname in enumerate(sorted(changedfiles)): |
1614 # revlog.group yields three entries per node, so | 1610 # revlog.group yields three entries per node, so |
1615 # dividing by 3 gives an approximation of how many | 1611 # dividing by 3 gives an approximation of how many |
1616 # nodes have been processed. | 1612 # nodes have been processed. |
1617 self.ui.progress(_('bundling'), cnt / 3, unit=_('changesets')) | 1613 self.ui.progress(_('bundling'), cnt / 3, unit=_('changesets')) |
1618 yield chnk | 1614 yield chnk |
1615 efiles = len(changedfiles) | |
1619 changecount = cnt / 3 | 1616 changecount = cnt / 3 |
1620 self.ui.progress(_('bundling'), None) | 1617 self.ui.progress(_('bundling'), None) |
1621 | 1618 |
1622 mnfst = self.manifest | 1619 mnfst = self.manifest |
1623 nodeiter = gennodelst(mnfst) | 1620 nodeiter = gennodelst(mnfst) |
1624 efiles = {} | |
1625 for cnt, chnk in enumerate(mnfst.group(nodeiter, | 1621 for cnt, chnk in enumerate(mnfst.group(nodeiter, |
1626 lookuplinkrev_func(mnfst))): | 1622 lookuplinkrev_func(mnfst))): |
1627 if cnt % 3 == 1: | 1623 if cnt % 3 == 1: |
1628 mnode = chnk[:20] | 1624 mnode = chnk[:20] |
1629 efiles.update(mnfst.readdelta(mnode)) | |
1630 # see above comment for why we divide by 3 | 1625 # see above comment for why we divide by 3 |
1631 self.ui.progress(_('bundling'), cnt / 3, | 1626 self.ui.progress(_('bundling'), cnt / 3, |
1632 unit=_('manifests'), total=changecount) | 1627 unit=_('manifests'), total=changecount) |
1633 yield chnk | 1628 yield chnk |
1634 efiles = len(efiles) | |
1635 self.ui.progress(_('bundling'), None) | 1629 self.ui.progress(_('bundling'), None) |
1636 | 1630 |
1637 for idx, fname in enumerate(sorted(changedfiles)): | 1631 for idx, fname in enumerate(sorted(changedfiles)): |
1638 filerevlog = self.file(fname) | 1632 filerevlog = self.file(fname) |
1639 if not len(filerevlog): | 1633 if not len(filerevlog): |