# HG changeset patch # User Lucas Moscovicz # Date 2014-02-18 23:54:46 # Node ID bde426f18e0a05057fb64a8aa0d29fffc9841f95 # Parent 9ad6dae67845b3d106f233b16bdc207389ee9d19 revset: changed mfunc and getset to work with old style revset methods Now extensions shouldn't break when adding new revsets. diff --git a/mercurial/revset.py b/mercurial/revset.py --- a/mercurial/revset.py +++ b/mercurial/revset.py @@ -195,7 +195,10 @@ def getargs(x, min, max, err): 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 @@ def match(ui, spec): 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):