[PATCH 2 of 3 RFC] obsolete: allow passing a revision to successorssets()

Augie Fackler raf at durin42.com
Fri Aug 9 10:13:09 CDT 2013


On Thu, Aug 08, 2013 at 09:48:45AM +0200, Dan Villiom Podlaski Christiansen wrote:
> # HG changeset patch
> # User Dan Villiom Podlaski Christiansen  <danchr at gmail.com>
> # Date 1375616619 -7200
> #      Sun Aug 04 13:43:39 2013 +0200
> # Node ID b1f7ae28c3e371a70ee363a4fbe5d50063a224fc
> # Parent  02c24ad6f4d2d954da11d128280978e25aaa48fd
> obsolete: allow passing a revision to successorssets()

I like this. I've been surprised more than once this didn't already
work. Any objections to me crewing this?

>
> diff --git a/mercurial/obsolete.py b/mercurial/obsolete.py
> --- a/mercurial/obsolete.py
> +++ b/mercurial/obsolete.py
> @@ -496,6 +496,9 @@ def successorssets(repo, initialnode, ca
>      for its live spawn. Code that makes multiple calls to `successorssets`
>      *must* use this cache mechanism or suffer terrible performances."""
>
> +    if isinstance(initialnode, int):
> +        initialnode = repo.unfiltered().changelog.node(initialnode)
> +
>      succmarkers = repo.obsstore.successors
>
>      # Stack of nodes we search successors sets for
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel


More information about the Mercurial-devel mailing list