# HG changeset patch # User Pierre-Yves David # Date 2016-05-05 17:32:51 # Node ID 0e9ed09f5fe9c390e60a98426f64bc3a231f7aa0 # Parent 2e40fada340ba1507e736842dd972f1b5c586bbe cleanup: replace False identity testing with an explicit token object The recommended way to check default value (when None is not as option) is a token object. Identity testing to integer is less explicit and not guaranteed to work in all implementations. diff --git a/mercurial/dirstate.py b/mercurial/dirstate.py --- a/mercurial/dirstate.py +++ b/mercurial/dirstate.py @@ -74,6 +74,8 @@ def _trypending(root, vfs, filename): raise return (vfs(filename), False) +_token = object() + class dirstate(object): def __init__(self, opener, ui, root, validate): @@ -688,12 +690,12 @@ class dirstate(object): self._pl = (parent, nullid) self._dirty = True - def write(self, tr=False): + def write(self, tr=_token): if not self._dirty: return filename = self._filename - if tr is False: # not explicitly specified + if tr is _token: # not explicitly specified self._ui.deprecwarn('use dirstate.write with ' 'repo.currenttransaction()', '3.9')