# HG changeset patch # User FUJIWARA Katsunori # Date 1464882260 -32400 # Node ID 76b07a5c064b60950dc4d3d39d92c09ed5c9acfd # Parent 82f6193ff2bc26dc1824cbcea40895350edee69d 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 diff -r 82f6193ff2bc -r 76b07a5c064b 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: