revset: fix negative ancestor spec to not return changectx objects
authorYuya Nishihara <yuya@tcha.org>
Sun, 18 Jun 2017 12:25:23 +0900
changeset 32903 8e02829bec61
parent 32902 9d472b219fb0
child 32904 19b0fd4b5570
revset: fix negative ancestor spec to not return changectx objects The order was unstable because of this.
mercurial/revset.py
tests/test-revset.t
--- 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'