revset: changed mfunc and getset to work with old style revset methods
Now extensions shouldn't break when adding new revsets.
--- a/mercurial/revset.py Mon Feb 03 10:15:15 2014 -0800
+++ b/mercurial/revset.py Tue Feb 18 15:54:46 2014 -0800
@@ -195,7 +195,10 @@
def getset(repo, subset, x):
if not x:
raise error.ParseError(_("missing argument"))
- return methods[x[0]](repo, subset, *x[1:])
+ s = methods[x[0]](repo, subset, *x[1:])
+ if util.safehasattr(s, 'set'):
+ return s
+ return baseset(s)
def _getrevsource(repo, r):
extra = repo[r].extra()
@@ -1949,7 +1952,9 @@
tree = findaliases(ui, tree)
weight, tree = optimize(tree, True)
def mfunc(repo, subset):
- return getset(repo, subset, tree)
+ if util.safehasattr(subset, 'set'):
+ return getset(repo, subset, tree)
+ return getset(repo, baseset(subset), tree)
return mfunc
def formatspec(expr, *args):