patch: simplify Boolean expression slightly
The context variable is either True, False or None. Abbreviate it as C
and we get the following truth table where the second column is the
original expression and the third column is the new expression:
C | C or C == None | C is not False
True | True | True
False | False | False
None | True | True
--- a/mercurial/patch.py Tue May 05 10:29:34 2009 +0200
+++ b/mercurial/patch.py Wed May 20 00:43:23 2009 +0200
@@ -870,7 +870,7 @@
current_hunk = None
gitworkdone = False
if ((sourcefile or state == BFILE) and ((not context and x[0] == '@') or
- ((context or context == None) and x.startswith('***************')))):
+ ((context is not False) and x.startswith('***************')))):
try:
if context == None and x.startswith('***************'):
context = True