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

Yuya Nishihara yuya at tcha.org
Fri Sep 28 07:56:07 EDT 2018


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.

>              if not revs:
> -                # Got only obsoletes.
>                  return
> -            minrev, maxrev = repo[revs.min()], repo[revs.max()]
> +            minrev, maxrev = repo[revs[0]], repo[revs[-1]]


More information about the Mercurial-devel mailing list