changeset 29673:52ff07e1de91

deprecation: enforce thew 'tr' argument of 'dirstate.write' (API) Compatibility was meant to be drop after 3.9 is released.
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
date Tue, 02 Aug 2016 16:51:27 +0200
parents 622782ea9cf3
children 996cc60da32c
files mercurial/dirstate.py
diffstat 1 files changed, 2 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/dirstate.py	Tue Aug 02 14:54:06 2016 +0200
+++ b/mercurial/dirstate.py	Tue Aug 02 16:51:27 2016 +0200
@@ -74,8 +74,6 @@
                 raise
     return (vfs(filename), False)
 
-_token = object()
-
 class dirstate(object):
 
     def __init__(self, opener, ui, root, validate):
@@ -692,22 +690,12 @@
         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".