[PATCH 2 of 5] pullreport: skip filtered revs instead of obsolete ones

Yuya Nishihara yuya at tcha.org
Fri Sep 28 08:48:43 EDT 2018


On Fri, 28 Sep 2018 14:36:50 +0200, Boris FELD wrote:
> On 28/09/2018 13:56, Yuya Nishihara wrote:
> > On Fri, 28 Sep 2018 12:22:19 +0200, Boris Feld wrote:
> >> # HG changeset patch
> >> # User Boris Feld <boris.feld at octobus.net>
> >> # Date 1538058910 -7200
> >> #      Thu Sep 27 16:35:10 2018 +0200
> >> # Node ID 4bd42e72e7ba8c0ee9dc4e153127882e6961602a
> >> # Parent  b36914d9928effac212d851c9617de93d6260746
> >> # EXP-Topic obsolete-duplicates
> >> # Available At https://bitbucket.org/octobus/mercurial-devel/
> >> #              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 4bd42e72e7ba
> >> pullreport: skip filtered revs instead of obsolete ones
> >>
> >> Obsolescence is closely related to visibility but still a distinct concept. We
> >> can receive changesets that are obsolete but visible (eg: when pulling
> >> orphans). Such changeset should be reported too. In addition, the filtering
> >> level can be anything, we should respect it.
> >>
> >> diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py
> >> --- a/mercurial/scmutil.py
> >> +++ b/mercurial/scmutil.py
> >> @@ -1603,13 +1603,11 @@ def registersummarycallback(repo, otr, t
> >>               if origrepolen >= len(repo):
> >>                   return
> >>   
> >> -            # Compute the bounds of new revisions' range, excluding obsoletes.
> >> -            unfi = repo.unfiltered()
> >> -            revs = unfi.revs('%d: and not obsolete()', origrepolen)
> >> +            # Compute the bounds of new visible revisions' range.
> >> +            revs = list(repo.changelog.revs(start=origrepolen))
> > Use revset? It's probably better to not construct a list of tens of thousands
> > of integers.
> 
> The issue here is that we don't have a way to express what we want as a 
> revset (to our knowledge). The revnum `origrepolen` could be filtered so 
> it cannot be used explicitly in "%d"
> 
> We either need:
> 
>    unfi.revs("%d - _filteredrevs(%s)", origrepolen, repo.filtername)
> 
> or
> 
>    repo.revs("firstrevgreaterthan(%s):", origrepolen)
> 
> Should we implement either one of the possibility above or do you have 
> another idea?

Good point. Maybe we can instantiate smartset.spanset() directly then?


More information about the Mercurial-devel mailing list