[PATCH 1 of 2] graphlog: preserve topo sort even if additional filter options specified
Yuya Nishihara
yuya at tcha.org
Thu Sep 22 14:24:47 UTC 2016
# HG changeset patch
# User Yuya Nishihara <yuya at tcha.org>
# Date 1474545233 -32400
# Thu Sep 22 20:53:53 2016 +0900
# Node ID 63cfb37603c39abe9e7ef58462c39dd1bb83c2df
# Parent 5271ae66615207f39cc41d78f4541bc6f8ca6ff6
graphlog: preserve topo sort even if additional filter options specified
Use ordered=revset.followorder instead. This change is logically the same
as fa5e4f58dfbc.
diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -2155,12 +2155,9 @@ def getgraphlogrevs(repo, pats, opts):
# Revset matchers often operate faster on revisions in changelog
# order, because most filters deal with the changelog.
revs.reverse()
- matcher = revset.match(repo.ui, expr)
- # Revset matches can reorder revisions. "A or B" typically returns
- # returns the revision matching A then the revision matching B. Sort
- # again to fix that.
+ matcher = revset.match(repo.ui, expr, order=revset.followorder)
revs = matcher(repo, revs)
- revs.sort(reverse=True)
+ revs.reverse()
if limit is not None:
limitedrevs = []
for idx, rev in enumerate(revs):
diff --git a/tests/test-glog-topological.t b/tests/test-glog-topological.t
--- a/tests/test-glog-topological.t
+++ b/tests/test-glog-topological.t
@@ -60,6 +60,20 @@ later.
o 0
+(display nodes filtered by log options)
+
+ $ hg log -G -r 'sort(all(), topo)' -k '.3'
+ o 8
+ |
+ o 3
+ |
+ ~
+ o 7
+ |
+ o 6
+ |
+ ~
+
(revset skipping nodes)
$ hg log -G --rev 'sort(not (2+6), topo)'
More information about the Mercurial-devel
mailing list