commands: check for modheads being None
authorGregory Szorc <gregory.szorc@gmail.com>
Fri, 25 Jan 2019 15:31:07 -0800
changeset 41382 2f2a7ea62e9a
parent 41381 423a6b2ddafa
child 41383 0cfbe78fc13e
commands: check for modheads being None Python 2 allows the > operator to be used with a None and an int. Python 3 does not. So we need to ensure the value isn't None before comparing with >. Differential Revision: https://phab.mercurial-scm.org/D5702
mercurial/commands.py
--- a/mercurial/commands.py	Fri Jan 25 15:21:56 2019 -0800
+++ b/mercurial/commands.py	Fri Jan 25 15:31:07 2019 -0800
@@ -4362,7 +4362,7 @@
             msg = _("not updating: %s") % stringutil.forcebytestr(inst)
             hint = inst.hint
             raise error.UpdateAbort(msg, hint=hint)
-    if modheads > 1:
+    if modheads is not None and modheads > 1:
         currentbranchheads = len(repo.branchheads())
         if currentbranchheads == modheads:
             ui.status(_("(run 'hg heads' to see heads, 'hg merge' to merge)\n"))