changeset 32885:8e02829bec61

revset: fix negative ancestor spec to not return changectx objects The order was unstable because of this.
author Yuya Nishihara <yuya@tcha.org>
date Sun, 18 Jun 2017 12:25:23 +0900
parents 9d472b219fb0
children 19b0fd4b5570
files mercurial/revset.py tests/test-revset.t
diffstat 2 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/revset.py	Mon May 01 05:57:36 2017 +0200
+++ b/mercurial/revset.py	Sun Jun 18 12:25:23 2017 +0900
@@ -392,7 +392,7 @@
             if len(c) > 1:
                 raise error.RepoLookupError(
                     _("revision in set has more than one child"))
-            r = c[0]
+            r = c[0].rev()
         else:
             cs.add(r)
     return subset & cs
--- a/tests/test-revset.t	Mon May 01 05:57:36 2017 +0200
+++ b/tests/test-revset.t	Sun Jun 18 12:25:23 2017 +0900
@@ -3131,9 +3131,11 @@
   $ log 'merge()^^^'
   1
 
-  $ log '(merge() | 0)~-1'
+  $ hg debugrevspec -s '(merge() | 0)~-1'
+  * set:
+  <baseset+ [1, 7]>
+  1
   7
-  1
   $ log 'merge()~-1'
   7
   $ log 'tip~-1'