revset: use a single return statement in matcher function
authorPierre-Yves David <pierre-yves.david@fb.com>
Tue, 30 Sep 2014 12:39:21 -0500
changeset 22686 2717dcff7be1
parent 22685 753515d9e274
child 22687 d9cc1be5acec
revset: use a single return statement in matcher function This makes it easy to insert post processing and debug code on the returned value.
mercurial/revset.py
--- a/mercurial/revset.py	Thu Oct 02 16:57:51 2014 -0500
+++ b/mercurial/revset.py	Tue Sep 30 12:39:21 2014 -0500
@@ -2063,8 +2063,10 @@
     weight, tree = optimize(tree, True)
     def mfunc(repo, subset):
         if util.safehasattr(subset, 'set'):
-            return getset(repo, subset, tree)
-        return getset(repo, baseset(subset), tree)
+            result = getset(repo, subset, tree)
+        else:
+            result = getset(repo, baseset(subset), tree)
+        return result
     return mfunc
 
 def formatspec(expr, *args):