deprecation: enforce thew 'tr' argument of 'dirstate.write' (API)
authorPierre-Yves David <pierre-yves.david@ens-lyon.org>
Tue, 02 Aug 2016 16:51:27 +0200
changeset 29673 52ff07e1de91
parent 29672 622782ea9cf3
child 29674 996cc60da32c
deprecation: enforce thew 'tr' argument of 'dirstate.write' (API) Compatibility was meant to be drop after 3.9 is released.
mercurial/dirstate.py
--- 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".