[PATCH] revset: fixed bug where revset returning order was being changed

Durham Goode durham at fb.com
Fri Feb 7 17:20:10 CST 2014


On 2/7/14 3:04 PM, "Lucas Moscovicz" <lmoscovicz at fb.com> wrote:

># HG changeset patch
># User Lucas Moscovicz <lmoscovicz at fb.com>
># Date 1391814093 28800
>#      Fri Feb 07 15:01:33 2014 -0800
># Node ID da662ebd26c58711b943d1ffaaed39a592bc6958
># Parent  19b9ecbf916636b9bbb74cb9e14b5f20aad39eb0
>revset: fixed bug where revset returning order was being changed
>
>Some revsets were innecesarily turning the subset into a set before
>iterating
>over it. This led to returning order changing in some cases.
>
>diff --git a/mercurial/revset.py b/mercurial/revset.py
>--- a/mercurial/revset.py
>+++ b/mercurial/revset.py
>@@ -305,8 +305,7 @@
>     if not args:
>         return baseset([])
>     s = set(_revancestors(repo, args, followfirst)) | set(args)
>-    ss = subset.set()
>-    return baseset([r for r in ss if r in s])
>+    return baseset([r for r in subset if r in s])

My only concern here would be the lack of 'set' could mean duplicate
revisions get added to the returned baseset.  But it seems like this was
the case even before you added the .set() function, so I guess there are
smarts somewhere else that make sure duplicates aren't returned in subsets.



More information about the Mercurial-devel mailing list