Mercurial > hg-stable
changeset 13716:6d7338f5320a
changegroup: minor cleanups
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Sun, 20 Mar 2011 20:25:41 -0500 |
parents | 2edf41a90b9d |
children | cc9bf81382f5 |
files | mercurial/localrepo.py |
diffstat | 1 files changed, 9 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/localrepo.py Sun Mar 20 20:21:19 2011 -0500 +++ b/mercurial/localrepo.py Sun Mar 20 20:25:41 2011 -0500 @@ -1586,9 +1586,6 @@ revset = set([cl.rev(n) for n in nodes]) self.changegroupinfo(nodes, source) - def identity(x): - return x - def gennodelst(log): for r in log: if log.linkrev(r) in revset: @@ -1606,24 +1603,24 @@ mmfs = {} collect = changegroup.collector(cl, mmfs, changedfiles) - for cnt, chnk in enumerate(cl.group(nodes, identity, collect)): + for count, chunk in enumerate(cl.group(nodes, lambda x: x, collect)): # revlog.group yields three entries per node, so # dividing by 3 gives an approximation of how many # nodes have been processed. - self.ui.progress(_('bundling'), cnt / 3, unit=_('changesets')) - yield chnk + self.ui.progress(_('bundling'), count / 3, unit=_('changesets')) + yield chunk efiles = len(changedfiles) - changecount = cnt / 3 + changecount = count / 3 self.ui.progress(_('bundling'), None) mnfst = self.manifest nodeiter = gennodelst(mnfst) - for cnt, chnk in enumerate(mnfst.group(nodeiter, + for count, chunk in enumerate(mnfst.group(nodeiter, lookuplinkrev_func(mnfst))): # see above comment for why we divide by 3 - self.ui.progress(_('bundling'), cnt / 3, + self.ui.progress(_('bundling'), count / 3, unit=_('manifests'), total=changecount) - yield chnk + yield chunk self.ui.progress(_('bundling'), None) for idx, fname in enumerate(sorted(changedfiles)): @@ -1636,11 +1633,11 @@ yield changegroup.chunkheader(len(fname)) yield fname lookup = lookuplinkrev_func(filerevlog) - for chnk in filerevlog.group(nodeiter, lookup): + for chunk in filerevlog.group(nodeiter, lookup): self.ui.progress( _('bundling'), idx, item=fname, total=efiles, unit=_('files')) - yield chnk + yield chunk self.ui.progress(_('bundling'), None) yield changegroup.closechunk()