##// END OF EJS Templates
churn: fix --progress (broken by f3d60543924f)
Alexander Solovyov -
r9672:5bbf4f13 default
parent child Browse files
Show More
@@ -48,7 +48,7 b' def countrate(ui, repo, amap, *pats, **o'
48 tmpl.show(ctx)
48 tmpl.show(ctx)
49 return ui.popbuffer()
49 return ui.popbuffer()
50
50
51 count = pct = 0
51 state = {'count': 0, 'pct': 0}
52 rate = {}
52 rate = {}
53 df = False
53 df = False
54 if opts.get('date'):
54 if opts.get('date'):
@@ -75,11 +75,11 b' def countrate(ui, repo, amap, *pats, **o'
75 rate[key] = [r + l for r, l in zip(rate.get(key, (0, 0)), lines)]
75 rate[key] = [r + l for r, l in zip(rate.get(key, (0, 0)), lines)]
76
76
77 if opts.get('progress'):
77 if opts.get('progress'):
78 count += 1
78 state['count'] += 1
79 newpct = int(100.0 * count / max(len(repo), 1))
79 newpct = int(100.0 * state['count'] / max(len(repo), 1))
80 if pct < newpct:
80 if state['pct'] < newpct:
81 pct = newpct
81 state['pct'] = newpct
82 ui.write("\r" + _("generating stats: %d%%") % pct)
82 ui.write("\r" + _("generating stats: %d%%") % state['pct'])
83 sys.stdout.flush()
83 sys.stdout.flush()
84
84
85 for ctx in cmdutil.walkchangerevs(repo, m, opts, prep):
85 for ctx in cmdutil.walkchangerevs(repo, m, opts, prep):
General Comments 0
You need to be logged in to leave comments. Login now