[PATCH 3 of 3] obsolete: avoid using revset to compute the obsolete set

Martin von Zweigbergk martinvonz at google.com
Tue Feb 14 20:38:56 EST 2017


On Fri, Feb 10, 2017 at 6:34 AM, Jun Wu <quark at fb.com> wrote:
> # HG changeset patch
> # User Jun Wu <quark at fb.com>
> # Date 1486737071 28800
> #      Fri Feb 10 06:31:11 2017 -0800
> # Node ID a4a844d706453079ea69de94f5e1c6fec64710e9
> # Parent  44f2c707475a79758ecbc4b4117b9cda9d7a4380
> # Available At https://bitbucket.org/quark-zju/hg-draft
> #              hg pull https://bitbucket.org/quark-zju/hg-draft -r a4a844d70645
> obsolete: avoid using revset to compute the obsolete set
>
> This is part of a refactoring that moves some phase query optimization from
> revset.py to phases.py. See previous patches for motivation.
>
> Now we have APIs to get the non-public set efficiently, replace revset with
> it.
>
> diff --git a/mercurial/obsolete.py b/mercurial/obsolete.py
> --- a/mercurial/obsolete.py
> +++ b/mercurial/obsolete.py
> @@ -1121,5 +1121,5 @@ def _computeobsoleteset(repo):
>      obs = set()
>      getnode = repo.changelog.node
> -    notpublic = repo.revs("not public()")
> +    notpublic = repo._phasecache.getrevs(repo, phases.allphases[1:])

nit: phases.allphases[1:] is also called phases.trackedphases, if you like

>      for r in notpublic:
>          if getnode(r) in repo.obsstore.successors:
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


More information about the Mercurial-devel mailing list