diff mercurial/revset.py @ 29937:91a95ad985d8

revset: add 'takeorder' attribute to mark functions that need ordering flag Since most functions shouldn't need 'order' flag, it is passed only when explicitly required. This avoids large API breakage.
author Yuya Nishihara <yuya@tcha.org>
date Sun, 07 Aug 2016 17:58:50 +0900
parents 09a84e747c88
children 2c6a05b938d8
line wrap: on
line diff
--- a/mercurial/revset.py	Sun Aug 07 17:46:12 2016 +0900
+++ b/mercurial/revset.py	Sun Aug 07 17:58:50 2016 +0900
@@ -422,7 +422,10 @@
 def func(repo, subset, a, b, order):
     f = getsymbol(a)
     if f in symbols:
-        return symbols[f](repo, subset, b)
+        fn = symbols[f]
+        if getattr(fn, '_takeorder', False):
+            return fn(repo, subset, b, order)
+        return fn(repo, subset, b)
 
     keep = lambda fn: getattr(fn, '__doc__', None) is not None