changeset 24008:873eb5db89c8 stable

revset: get revision number of each node from target namespaces Before this patch, revset predicate "named()" uses each nodes gotten from target namespaces directly. This causes problems below: - combination of other predicates doesn't work correctly, because they assume that revisions are listed up in number - "hg log" doesn't show any revisions for "named()" result, because: - "changeset_printer" stores formatted output for each revisions into dict with revision number (= ctx.rev()) as a key of them - "changeset_printer.flush(rev)" writes stored output for the specified revision, but - "commands.log" invokes it with the node, gotten from "named()" - "hg debugrevspec" shows nodes (= may be binary) directly Difference between revset predicate "tag()" and "named('tags')" in tests is fixed in subsequent patch.
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
date Tue, 03 Feb 2015 21:56:29 +0900
parents 3667bc21b877
children bc75f8750cde 942a5a34b2d0
files mercurial/revset.py tests/test-revset.t
diffstat 2 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/revset.py	Sun Feb 01 20:21:02 2015 -0600
+++ b/mercurial/revset.py	Tue Feb 03 21:56:29 2015 +0900
@@ -1277,7 +1277,7 @@
     names = set()
     for ns in namespaces:
         for name in ns.listnames(repo):
-            names.update(ns.nodes(repo, name))
+            names.update(repo[n].rev() for n in ns.nodes(repo, name))
 
     names -= set([node.nullrev])
     return subset & names
--- a/tests/test-revset.t	Sun Feb 01 20:21:02 2015 -0600
+++ b/tests/test-revset.t	Tue Feb 03 21:56:29 2015 +0900
@@ -787,6 +787,12 @@
   $ log 'present(named("unknown"))'
   $ log 'present(named("re:unknown"))'
 
+  $ log 'tag()'
+  6
+  $ log 'named("tags")'
+  6
+  9
+
 issue2437
 
   $ log '3 and p1(5)'