Patchwork revset: fix negative ancestor spec to not return changectx objects

login
register
mail settings
Submitter Yuya Nishihara
Date June 18, 2017, 4:49 a.m.
Message ID <d9738785ee5f66c8ed52.1497761342@mimosa>
Download mbox | patch
Permalink /patch/21471/
State Accepted
Headers show

Comments

Yuya Nishihara - June 18, 2017, 4:49 a.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1497756323 -32400
#      Sun Jun 18 12:25:23 2017 +0900
# Node ID d9738785ee5f66c8ed5255d37dbbe76776e15427
# Parent  4b258e839f739c8c5c422b34891598aeb05858aa
revset: fix negative ancestor spec to not return changectx objects

The order was unstable because of this.
via Mercurial-devel - June 18, 2017, 5:56 a.m.
On Sat, Jun 17, 2017 at 9:49 PM, Yuya Nishihara <yuya@tcha.org> wrote:
> # HG changeset patch
> # User Yuya Nishihara <yuya@tcha.org>
> # Date 1497756323 -32400
> #      Sun Jun 18 12:25:23 2017 +0900
> # Node ID d9738785ee5f66c8ed5255d37dbbe76776e15427
> # Parent  4b258e839f739c8c5c422b34891598aeb05858aa
> revset: fix negative ancestor spec to not return changectx objects

Queued, thanks.

Patch

diff --git a/mercurial/revset.py b/mercurial/revset.py
--- a/mercurial/revset.py
+++ b/mercurial/revset.py
@@ -270,7 +270,7 @@  def _childrenspec(repo, subset, x, n, or
             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
diff --git a/tests/test-revset.t b/tests/test-revset.t
--- a/tests/test-revset.t
+++ b/tests/test-revset.t
@@ -3131,9 +3131,11 @@  parentrevspec
   $ 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'