[PATCH 2 of 5] dirstate: split write to write changes into files other than .hg/dirstate

FUJIWARA Katsunori foozy at lares.dti.ne.jp
Wed Oct 7 11:50:25 CDT 2015


# HG changeset patch
# User FUJIWARA Katsunori <foozy at lares.dti.ne.jp>
# Date 1444236090 -32400
#      Thu Oct 08 01:41:30 2015 +0900
# Node ID 9df9c4a63e9e3c79d7ec40eb73436b10af9ab066
# Parent  b5e10e189571ac459439d06cc7302a0b8b7a866d
dirstate: split write to write changes into files other than .hg/dirstate

'_writedirstate()' is used mainly for "transactional dirstate". See
the wiki page below for detail about it.

    https://mercurial.selenic.com/wiki/DirstateTransactionPlan

diff --git a/mercurial/dirstate.py b/mercurial/dirstate.py
--- a/mercurial/dirstate.py
+++ b/mercurial/dirstate.py
@@ -622,6 +622,9 @@
             time.sleep(delaywrite)
 
         st = self._opener(self._filename, "w", atomictemp=True)
+        self._writedirstate(st)
+
+    def _writedirstate(self, st):
         # use the modification time of the newly created temporary file as the
         # filesystem's notion of 'now'
         now = util.fstat(st).st_mtime


More information about the Mercurial-devel mailing list