comparison mercurial/localrepo.py @ 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 7df090c9c9fe
children 93e015a3d1ea
comparison
equal deleted inserted replaced
25016:42e89b87ca79 25017:4e857213d2d1
1460 fail(f, _("file not tracked!")) 1460 fail(f, _("file not tracked!"))
1461 1461
1462 cctx = context.workingcommitctx(self, status, 1462 cctx = context.workingcommitctx(self, status,
1463 text, user, date, extra) 1463 text, user, date, extra)
1464 1464
1465 if (not force and not extra.get("close") and not merge 1465 allowemptycommit = (wctx.branch() != wctx.p1().branch() or force
1466 and not cctx.files() 1466 or extra.get('close') or merge or cctx.files())
1467 and wctx.branch() == wctx.p1().branch()): 1467 if not allowemptycommit:
1468 return None 1468 return None
1469 1469
1470 if merge and cctx.deleted(): 1470 if merge and cctx.deleted():
1471 raise util.Abort(_("cannot commit merge with missing files")) 1471 raise util.Abort(_("cannot commit merge with missing files"))
1472 1472