changeset 41382:2f2a7ea62e9a

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
author Gregory Szorc <gregory.szorc@gmail.com>
date Fri, 25 Jan 2019 15:31:07 -0800
parents 423a6b2ddafa
children 0cfbe78fc13e
files mercurial/commands.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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"))