[PATCH 2 of 2] ancestor: filter out initial revisions lower than stoprev

Martin von Zweigbergk martinvonz at google.com
Fri Sep 7 23:49:32 EDT 2018


Good catch. However, I think the docstring needs updating. I think it
explicitly said that inclusive mode emits the initial revs ignoring
stoprev. Will that still be the case after this patch? I'm on mobile right
now and too lazy to confirm, but hopefully I'm remembering it right.

On Fri, Sep 7, 2018, 19:54 Yuya Nishihara <yuya at tcha.org> wrote:

> # HG changeset patch
> # User Yuya Nishihara <yuya at tcha.org>
> # Date 1536371964 -32400
> #      Sat Sep 08 10:59:24 2018 +0900
> # Node ID 4894b3cdd4c03bb5579bb47f4f51a9410716df84
> # Parent  ebcd7abf0d144fb657b90126a1e30d13eefeb364
> ancestor: filter out initial revisions lower than stoprev
>
> diff --git a/mercurial/ancestor.py b/mercurial/ancestor.py
> --- a/mercurial/ancestor.py
> +++ b/mercurial/ancestor.py
> @@ -273,7 +273,7 @@ class lazyancestors(object):
>
>          Result does not include the null revision."""
>          self._parentrevs = pfunc
> -        self._initrevs = revs
> +        self._initrevs = revs = [r for r in revs if r >= stoprev]
>          self._stoprev = stoprev
>          self._inclusive = inclusive
>
> diff --git a/tests/test-ancestor.py.out b/tests/test-ancestor.py.out
> --- a/tests/test-ancestor.py.out
> +++ b/tests/test-ancestor.py.out
> @@ -20,5 +20,5 @@ iteration:  [13, 11, 8, 7]
>  membership: [11, 13]
>  iteration:  [13, 11]
>  % lazy ancestor set for [11, 13], stoprev = 12, inclusive = True
> -membership: [11, 13]
> +membership: [13]
>  iteration:  [13]
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.mercurial-scm.org/pipermail/mercurial-devel/attachments/20180907/2dad60c7/attachment.html>


More information about the Mercurial-devel mailing list