changeset 22686:2717dcff7be1

revset: use a single return statement in matcher function This makes it easy to insert post processing and debug code on the returned value.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Tue, 30 Sep 2014 12:39:21 -0500
parents 753515d9e274
children d9cc1be5acec
files mercurial/revset.py
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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):