# HG changeset patch # User Martin von Zweigbergk # Date 1618939443 25200 # Node ID 124fe94016c01d63209bea10086582b379b7eeab # Parent 8fcc0a829f3df9fe4f794c510395aeff7407e72f narrow: add progress-reporting when looking for local changes in `hg tracked` Looking for local changes (changes not on the given remote) can take a long time, so we should have progress-reporting for it. Differential Revision: https://phab.mercurial-scm.org/D10501 diff -r 8fcc0a829f3d -r 124fe94016c0 hgext/narrow/narrowcommands.py --- a/hgext/narrow/narrowcommands.py Fri Apr 16 16:21:26 2021 -0700 +++ b/hgext/narrow/narrowcommands.py Tue Apr 20 10:24:03 2021 -0700 @@ -227,10 +227,17 @@ unfi = repo.unfiltered() outgoing = discovery.findcommonoutgoing(unfi, remote, commoninc=commoninc) ui.status(_(b'looking for local changes to affected paths\n')) + progress = ui.makeprogress( + topic=_(b'changesets'), + unit=_(b'changesets'), + total=len(outgoing.missing) + len(outgoing.excluded), + ) localnodes = [] - for n in itertools.chain(outgoing.missing, outgoing.excluded): - if any(oldmatch(f) and not newmatch(f) for f in unfi[n].files()): - localnodes.append(n) + with progress: + for n in itertools.chain(outgoing.missing, outgoing.excluded): + progress.increment() + if any(oldmatch(f) and not newmatch(f) for f in unfi[n].files()): + localnodes.append(n) revstostrip = unfi.revs(b'descendants(%ln)', localnodes) hiddenrevs = repoview.filterrevs(repo, b'visible') visibletostrip = list(