##// END OF EJS Templates
changegroup: minor cleanups
Matt Mackall -
r13716:6d7338f5 default
parent child Browse files
Show More
@@ -1586,9 +1586,6 b' class localrepository(repo.repository):'
1586 revset = set([cl.rev(n) for n in nodes])
1586 revset = set([cl.rev(n) for n in nodes])
1587 self.changegroupinfo(nodes, source)
1587 self.changegroupinfo(nodes, source)
1588
1588
1589 def identity(x):
1590 return x
1591
1592 def gennodelst(log):
1589 def gennodelst(log):
1593 for r in log:
1590 for r in log:
1594 if log.linkrev(r) in revset:
1591 if log.linkrev(r) in revset:
@@ -1606,24 +1603,24 b' class localrepository(repo.repository):'
1606 mmfs = {}
1603 mmfs = {}
1607 collect = changegroup.collector(cl, mmfs, changedfiles)
1604 collect = changegroup.collector(cl, mmfs, changedfiles)
1608
1605
1609 for cnt, chnk in enumerate(cl.group(nodes, identity, collect)):
1606 for count, chunk in enumerate(cl.group(nodes, lambda x: x, collect)):
1610 # revlog.group yields three entries per node, so
1607 # revlog.group yields three entries per node, so
1611 # dividing by 3 gives an approximation of how many
1608 # dividing by 3 gives an approximation of how many
1612 # nodes have been processed.
1609 # nodes have been processed.
1613 self.ui.progress(_('bundling'), cnt / 3, unit=_('changesets'))
1610 self.ui.progress(_('bundling'), count / 3, unit=_('changesets'))
1614 yield chnk
1611 yield chunk
1615 efiles = len(changedfiles)
1612 efiles = len(changedfiles)
1616 changecount = cnt / 3
1613 changecount = count / 3
1617 self.ui.progress(_('bundling'), None)
1614 self.ui.progress(_('bundling'), None)
1618
1615
1619 mnfst = self.manifest
1616 mnfst = self.manifest
1620 nodeiter = gennodelst(mnfst)
1617 nodeiter = gennodelst(mnfst)
1621 for cnt, chnk in enumerate(mnfst.group(nodeiter,
1618 for count, chunk in enumerate(mnfst.group(nodeiter,
1622 lookuplinkrev_func(mnfst))):
1619 lookuplinkrev_func(mnfst))):
1623 # see above comment for why we divide by 3
1620 # see above comment for why we divide by 3
1624 self.ui.progress(_('bundling'), cnt / 3,
1621 self.ui.progress(_('bundling'), count / 3,
1625 unit=_('manifests'), total=changecount)
1622 unit=_('manifests'), total=changecount)
1626 yield chnk
1623 yield chunk
1627 self.ui.progress(_('bundling'), None)
1624 self.ui.progress(_('bundling'), None)
1628
1625
1629 for idx, fname in enumerate(sorted(changedfiles)):
1626 for idx, fname in enumerate(sorted(changedfiles)):
@@ -1636,11 +1633,11 b' class localrepository(repo.repository):'
1636 yield changegroup.chunkheader(len(fname))
1633 yield changegroup.chunkheader(len(fname))
1637 yield fname
1634 yield fname
1638 lookup = lookuplinkrev_func(filerevlog)
1635 lookup = lookuplinkrev_func(filerevlog)
1639 for chnk in filerevlog.group(nodeiter, lookup):
1636 for chunk in filerevlog.group(nodeiter, lookup):
1640 self.ui.progress(
1637 self.ui.progress(
1641 _('bundling'), idx, item=fname,
1638 _('bundling'), idx, item=fname,
1642 total=efiles, unit=_('files'))
1639 total=efiles, unit=_('files'))
1643 yield chnk
1640 yield chunk
1644 self.ui.progress(_('bundling'), None)
1641 self.ui.progress(_('bundling'), None)
1645
1642
1646 yield changegroup.closechunk()
1643 yield changegroup.closechunk()
General Comments 0
You need to be logged in to leave comments. Login now