# HG changeset patch
# User Martin von Zweigbergk <martinvonz@google.com>
# Date 2015-05-31 20:17:41
# Node ID 4b1ec70b9713a51af8b336af863fa54daacb623c
# Parent  a410479c7ee7a1aac85e5d5dfa9eda6532ab1254

match: join two nested if-blocks

Instead of

  if a:
      if b:
          return False

let's write it

  if a and b:
      return False

diff --git a/mercurial/match.py b/mercurial/match.py
--- a/mercurial/match.py
+++ b/mercurial/match.py
@@ -226,10 +226,10 @@ class match(object):
             return False
         if (self._includeroots and
             dir not in self._includeroots and
-            dir not in self._includedirs):
-            if not any(parent in self._includeroots
-                       for parent in util.finddirs(dir)):
-                return False
+            dir not in self._includedirs and
+            not any(parent in self._includeroots
+                    for parent in util.finddirs(dir))):
+            return False
         return (not self._fileroots or
                 '.' in self._fileroots or
                 dir in self._fileroots or