transaction: avoid ambiguity of file stat at closing transaction
authorFUJIWARA Katsunori <foozy@lares.dti.ne.jp>
Fri, 03 Jun 2016 00:44:20 +0900
changeset 29299 76b07a5c064b
parent 29298 82f6193ff2bc
child 29300 f92afd23a099
transaction: avoid ambiguity of file stat at closing transaction Files below, which might be changed at closing transaction, are used to examine validity of cached properties. If changing keeps ctime, mtime and size of a file, change is overlooked, and old contents cached before change isn't invalidated as expected. - .hg/bookmarks - .hg/dirstate - .hg/phaseroots To avoid ambiguity of file stat, this patch writes files out with checkambig=True at closing transaction. checkambig becomes True only at closing (= 'not suffix'), because stat information of '.pending' file isn't used to examine validity of cached properties. This patch is a part of "Exact Cache Validation Plan": https://www.mercurial-scm.org/wiki/ExactCacheValidationPlan
mercurial/transaction.py
--- a/mercurial/transaction.py	Fri Jun 03 00:44:20 2016 +0900
+++ b/mercurial/transaction.py	Fri Jun 03 00:44:20 2016 +0900
@@ -310,7 +310,8 @@
                         self.registertmp(name, location=location)
                     else:
                         self.addbackup(name, location=location)
-                    files.append(vfs(name, 'w', atomictemp=True))
+                    files.append(vfs(name, 'w', atomictemp=True,
+                                     checkambig=not suffix))
                 genfunc(*files)
             finally:
                 for f in files: