tags: don't feed both int and None to min()
authorAugie Fackler <augie@google.com>
Sat, 17 Feb 2018 22:39:38 -0500
changeset 36277 18106c3bc94a
parent 36276 c95c8ab2e7ec
child 36278 a87093e2805d
tags: don't feed both int and None to min() They're not comparable on Python 3, and we can just map None to 0. Differential Revision: https://phab.mercurial-scm.org/D2307
mercurial/tags.py
--- a/mercurial/tags.py	Sat Feb 17 22:39:12 2018 -0500
+++ b/mercurial/tags.py	Sat Feb 17 22:39:38 2018 -0500
@@ -739,7 +739,7 @@
         entry = bytearray(prefix + fnode)
         self._raw[offset:offset + _fnodesrecsize] = entry
         # self._dirtyoffset could be None.
-        self._dirtyoffset = min(self._dirtyoffset, offset) or 0
+        self._dirtyoffset = min(self._dirtyoffset or 0, offset or 0)
 
     def write(self):
         """Perform all necessary writes to cache file.