# HG changeset patch # User Gregory Szorc # Date 1548459067 28800 # Node ID 2f2a7ea62e9a0782ee49faf49eb8b61025c96901 # Parent 423a6b2ddafac0dc4bf1837fb11b496588968bbf 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 diff -r 423a6b2ddafa -r 2f2a7ea62e9a 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"))