commit: move empty commit condition to a new line
The empty commit condition was a messy if condition. Let's move it to a new line
and change it to 'or' statements so it's cleaner and more readable. A future
commit will add additional logic to this line.
--- a/mercurial/localrepo.py Fri May 08 15:04:14 2015 -0700
+++ b/mercurial/localrepo.py Mon May 11 16:16:22 2015 -0700
@@ -1462,9 +1462,9 @@
cctx = context.workingcommitctx(self, status,
text, user, date, extra)
- if (not force and not extra.get("close") and not merge
- and not cctx.files()
- and wctx.branch() == wctx.p1().branch()):
+ allowemptycommit = (wctx.branch() != wctx.p1().branch() or force
+ or extra.get('close') or merge or cctx.files())
+ if not allowemptycommit:
return None
if merge and cctx.deleted():