hgext/narrow/narrowcommands.py
changeset 47025 124fe94016c0
parent 47012 d55b71393907
child 47026 20eba5cef2e0
equal deleted inserted replaced
47024:8fcc0a829f3d 47025:124fe94016c0
   225     # commits. We will then check that the local-only commits don't
   225     # commits. We will then check that the local-only commits don't
   226     # have any changes to files that will be untracked.
   226     # have any changes to files that will be untracked.
   227     unfi = repo.unfiltered()
   227     unfi = repo.unfiltered()
   228     outgoing = discovery.findcommonoutgoing(unfi, remote, commoninc=commoninc)
   228     outgoing = discovery.findcommonoutgoing(unfi, remote, commoninc=commoninc)
   229     ui.status(_(b'looking for local changes to affected paths\n'))
   229     ui.status(_(b'looking for local changes to affected paths\n'))
       
   230     progress = ui.makeprogress(
       
   231         topic=_(b'changesets'),
       
   232         unit=_(b'changesets'),
       
   233         total=len(outgoing.missing) + len(outgoing.excluded),
       
   234     )
   230     localnodes = []
   235     localnodes = []
   231     for n in itertools.chain(outgoing.missing, outgoing.excluded):
   236     with progress:
   232         if any(oldmatch(f) and not newmatch(f) for f in unfi[n].files()):
   237         for n in itertools.chain(outgoing.missing, outgoing.excluded):
   233             localnodes.append(n)
   238             progress.increment()
       
   239             if any(oldmatch(f) and not newmatch(f) for f in unfi[n].files()):
       
   240                 localnodes.append(n)
   234     revstostrip = unfi.revs(b'descendants(%ln)', localnodes)
   241     revstostrip = unfi.revs(b'descendants(%ln)', localnodes)
   235     hiddenrevs = repoview.filterrevs(repo, b'visible')
   242     hiddenrevs = repoview.filterrevs(repo, b'visible')
   236     visibletostrip = list(
   243     visibletostrip = list(
   237         repo.changelog.node(r) for r in (revstostrip - hiddenrevs)
   244         repo.changelog.node(r) for r in (revstostrip - hiddenrevs)
   238     )
   245     )