# HG changeset patch # User Pulkit Goyal <7895pulkit@gmail.com> # Date 1506729142 -19800 # Node ID 05167447f90d0f1c8b0df9d4676fc498eab63e5b # Parent ac0cd81e2f83cd6a2910c61afbb98a415832f8e7 py3: return False early while checking whether None is a key in lazymanifest In this patch we returns False early if we are trying to check whether None is a key in lazymanifest. The reason I added a diff is that on Python 3, it goes into the lazy manifest code an returns a TypeError. I checked with Durham that whether None can be a possible key in lazymanifest and he said "no". So it's safe to have this if statement. This fixes `hg merge` on Python 3. Differential Revision: https://phab.mercurial-scm.org/D852 diff -r ac0cd81e2f83 -r 05167447f90d mercurial/manifest.py --- a/mercurial/manifest.py Fri Sep 29 14:49:05 2017 -0700 +++ b/mercurial/manifest.py Sat Sep 30 05:22:22 2017 +0530 @@ -442,6 +442,8 @@ self._lm[key] = node, self.flags(key, '') def __contains__(self, key): + if key is None: + return False return key in self._lm def __delitem__(self, key):