Mercurial > hg
changeset 25017:4e857213d2d1
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.
author | Durham Goode <durham@fb.com> |
---|---|
date | Mon, 11 May 2015 16:16:22 -0700 |
parents | 42e89b87ca79 |
children | 93e015a3d1ea |
files | mercurial/localrepo.py |
diffstat | 1 files changed, 3 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- 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():