Mercurial > public > mercurial-scm > hg
comparison mercurial/localrepo.py @ 13709:53826e7a1d22
changegroupsubset: more renaming
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Sun, 20 Mar 2011 19:43:28 -0500 |
parents | ce9b3043b79d |
children | cb8d0bc8c021 |
comparison
equal
deleted
inserted
replaced
13708:ce9b3043b79d | 13709:53826e7a1d22 |
---|---|
1524 collect = changegroup.collector(cl, mfs, changedfiles) | 1524 collect = changegroup.collector(cl, mfs, changedfiles) |
1525 | 1525 |
1526 # Create a changenode group generator that will call our functions | 1526 # Create a changenode group generator that will call our functions |
1527 # back to lookup the owning changenode and collect information. | 1527 # back to lookup the owning changenode and collect information. |
1528 group = cl.group(csets, lambda x: x, collect) | 1528 group = cl.group(csets, lambda x: x, collect) |
1529 for cnt, chnk in enumerate(group): | 1529 for count, chunk in enumerate(group): |
1530 yield chnk | 1530 yield chunk |
1531 # revlog.group yields three entries per node, so | 1531 # revlog.group yields three entries per node, so |
1532 # dividing by 3 gives an approximation of how many | 1532 # dividing by 3 gives an approximation of how many |
1533 # nodes have been processed. | 1533 # nodes have been processed. |
1534 self.ui.progress(_('bundling'), cnt / 3, | 1534 self.ui.progress(_('bundling'), count / 3, |
1535 unit=_('changesets')) | 1535 unit=_('changesets')) |
1536 changecount = cnt / 3 | 1536 changecount = count / 3 |
1537 self.ui.progress(_('bundling'), None) | 1537 self.ui.progress(_('bundling'), None) |
1538 | 1538 |
1539 prune(mf, mfs) | 1539 prune(mf, mfs) |
1540 # Create a generator for the manifestnodes that calls our lookup | 1540 # Create a generator for the manifestnodes that calls our lookup |
1541 # and data collection functions back. | 1541 # and data collection functions back. |
1542 group = mf.group(sorted(mfs, key=mf.rev), | 1542 group = mf.group(sorted(mfs, key=mf.rev), |
1543 lambda mnode: mfs[mnode], | 1543 lambda mnode: mfs[mnode], |
1544 filenode_collector(changedfiles)) | 1544 filenode_collector(changedfiles)) |
1545 efiles = {} | 1545 efiles = {} |
1546 for cnt, chnk in enumerate(group): | 1546 for count, chunk in enumerate(group): |
1547 if cnt % 3 == 1: | 1547 if count % 3 == 1: |
1548 mnode = chnk[:20] | 1548 mnode = chunk[:20] |
1549 efiles.update(mf.readdelta(mnode)) | 1549 efiles.update(mf.readdelta(mnode)) |
1550 yield chnk | 1550 yield chunk |
1551 # see above comment for why we divide by 3 | 1551 # see above comment for why we divide by 3 |
1552 self.ui.progress(_('bundling'), cnt / 3, | 1552 self.ui.progress(_('bundling'), count / 3, |
1553 unit=_('manifests'), total=changecount) | 1553 unit=_('manifests'), total=changecount) |
1554 self.ui.progress(_('bundling'), None) | 1554 self.ui.progress(_('bundling'), None) |
1555 efiles = len(efiles) | 1555 efiles = len(efiles) |
1556 | 1556 |
1557 mfs.clear() | 1557 mfs.clear() |
1574 # lookup function as we need to collect no information | 1574 # lookup function as we need to collect no information |
1575 # from filenodes. | 1575 # from filenodes. |
1576 group = filerevlog.group( | 1576 group = filerevlog.group( |
1577 sorted(missingfnodes, key=filerevlog.rev), | 1577 sorted(missingfnodes, key=filerevlog.rev), |
1578 lambda fnode: missingfnodes[fnode]) | 1578 lambda fnode: missingfnodes[fnode]) |
1579 for chnk in group: | 1579 for chunk in group: |
1580 # even though we print the same progress on | 1580 # even though we print the same progress on |
1581 # most loop iterations, put the progress call | 1581 # most loop iterations, put the progress call |
1582 # here so that time estimates (if any) can be updated | 1582 # here so that time estimates (if any) can be updated |
1583 self.ui.progress( | 1583 self.ui.progress( |
1584 _('bundling'), idx, item=fname, | 1584 _('bundling'), idx, item=fname, |
1585 unit=_('files'), total=efiles) | 1585 unit=_('files'), total=efiles) |
1586 yield chnk | 1586 yield chunk |
1587 # Signal that no more groups are left. | 1587 # Signal that no more groups are left. |
1588 yield changegroup.closechunk() | 1588 yield changegroup.closechunk() |
1589 self.ui.progress(_('bundling'), None) | 1589 self.ui.progress(_('bundling'), None) |
1590 | 1590 |
1591 if csets: | 1591 if csets: |