Patchwork D2307: tags: don't feed both int and None to min()

login
register
mail settings
Submitter phabricator
Date Feb. 18, 2018, 12:46 p.m.
Message ID <9441708eea03efaeeed8e399a6b1137d@localhost.localdomain>
Download mbox | patch
Permalink /patch/28069/
State Not Applicable
Headers show

Comments

phabricator - Feb. 18, 2018, 12:46 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG18106c3bc94a: tags: don&#039;t feed both int and None to min() (authored by durin42, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2307?vs=5825&id=5845

REVISION DETAIL
  https://phab.mercurial-scm.org/D2307

AFFECTED FILES
  mercurial/tags.py

CHANGE DETAILS




To: durin42, #hg-reviewers, pulkit
Cc: mercurial-devel

Patch

diff --git a/mercurial/tags.py b/mercurial/tags.py
--- a/mercurial/tags.py
+++ b/mercurial/tags.py
@@ -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.