# HG changeset patch # User Durham Goode # Date 1431386182 25200 # Node ID 4e857213d2d1a6e2548bccd1193fdf70a21da0fd # Parent 42e89b87ca794b6ea10fe1410396844ee9ab79db 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. diff -r 42e89b87ca79 -r 4e857213d2d1 mercurial/localrepo.py --- 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():