# HG changeset patch # User Pierre-Yves David # Date 2016-08-02 14:51:27 # Node ID 52ff07e1de9150a8cec8e6cbe02125fb67978b8d # Parent 622782ea9cf3c8acced2c113469ae9dd5bc50d1f deprecation: enforce thew 'tr' argument of 'dirstate.write' (API) Compatibility was meant to be drop after 3.9 is released. diff --git a/mercurial/dirstate.py b/mercurial/dirstate.py --- a/mercurial/dirstate.py +++ b/mercurial/dirstate.py @@ -74,8 +74,6 @@ def _trypending(root, vfs, filename): raise return (vfs(filename), False) -_token = object() - class dirstate(object): def __init__(self, opener, ui, root, validate): @@ -692,22 +690,12 @@ class dirstate(object): self._pl = (parent, nullid) self._dirty = True - def write(self, tr=_token): + def write(self, tr): if not self._dirty: return filename = self._filename - if tr is _token: # not explicitly specified - self._ui.deprecwarn('use dirstate.write with ' - 'repo.currenttransaction()', - '3.9') - - if self._opener.lexists(self._pendingfilename): - # if pending file already exists, in-memory changes - # should be written into it, because it has priority - # to '.hg/dirstate' at reading under HG_PENDING mode - filename = self._pendingfilename - elif tr: + if tr: # 'dirstate.write()' is not only for writing in-memory # changes out, but also for dropping ambiguous timestamp. # delayed writing re-raise "ambiguous timestamp issue".