Skip to content
Snippets Groups Projects
Commit 6390dd22 authored by Bryan O'Sullivan's avatar Bryan O'Sullivan
Browse files

merge: report non-interactive progress in chunks

Instead of a monotonic count, getupdates yields the number of files it
has updated since it last reported, and its caller sums the numbers when
updating progress.

Once we run these updates in parallel, this will allow worker processes
to report progress less often, reducing overhead.
parent 3e200791
No related branches found
No related tags found
No related merge requests found
......@@ -350,7 +350,8 @@
yields tuples for progress updates
"""
audit = repo.wopener.audit
for i, arg in enumerate(args):
i = 0
for arg in args:
f = arg[0]
if arg[1] == 'r':
repo.ui.note(_("removing %s\n") % f)
......@@ -363,6 +364,11 @@
else:
repo.ui.note(_("getting %s\n") % f)
repo.wwrite(f, mctx.filectx(f).data(), arg[2][0])
if i == 100:
yield i, f
i = 0
i += 1
if i > 0:
yield i, f
def applyupdates(repo, actions, wctx, mctx, actx, overwrite):
......@@ -425,4 +431,5 @@
if hgsub and hgsub[0] == 'r':
subrepo.submerge(repo, wctx, mctx, wctx, overwrite)
z = 0
for i, item in getremove(repo, mctx, overwrite, workeractions):
......@@ -428,7 +435,8 @@
for i, item in getremove(repo, mctx, overwrite, workeractions):
repo.ui.progress(_('updating'), i + 1, item=item, total=numupdates,
z += i
repo.ui.progress(_('updating'), z, item=item, total=numupdates,
unit=_('files'))
if hgsub and hgsub[0] == 'g':
subrepo.submerge(repo, wctx, mctx, wctx, overwrite)
......@@ -430,10 +438,8 @@
unit=_('files'))
if hgsub and hgsub[0] == 'g':
subrepo.submerge(repo, wctx, mctx, wctx, overwrite)
z = len(workeractions)
for i, a in enumerate(actions):
f, m, args, msg = a
repo.ui.progress(_('updating'), z + i + 1, item=f, total=numupdates,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment