Mercurial > hg
diff contrib/shrink-revlog.py @ 13783:c196352d935b
changegroup: fold progress meter into callbacks
progress meters now start at 1 rather than 0
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Mon, 28 Mar 2011 11:18:56 -0500 |
parents | 9131724c3f4b |
children | 7e453770b364 |
line wrap: on
line diff
--- a/contrib/shrink-revlog.py Mon Mar 28 11:18:56 2011 -0500 +++ b/contrib/shrink-revlog.py Mon Mar 28 11:18:56 2011 -0500 @@ -102,16 +102,14 @@ ui.status(_('writing revs\n')) - count = [0] - def progress(*args): - ui.progress(_('writing'), count[0], total=len(order)) - count[0] += 1 order = [r1.node(r) for r in order] # this is a bit ugly, but it works + count = [0] def lookup(x): - progress(x) + count[0] += 1 + ui.progress(_('writing'), count[0], total=len(order)) return "%020d" % r1.linkrev(r1.rev(x)) unlookup = lambda x: int(x, 10)