# HG changeset patch # User FUJIWARA Katsunori # Date 2016-06-02 15:44:20 # Node ID 3a2357c31d2a1bc4346d639b642548bb263c3bc6 # Parent 083e107adaac8903b130ebaeb4d0361eaded0530 phases: make writing phaseroots file out avoid ambiguity of file stat Cached attribute repo._phasecache uses stat of '.hg/phaseroots' file to examine validity of cached contents. If writing '.hg/phaseroots' file out keeps ctime, mtime and size of it, change is overlooked, and old contents cached before change isn't invalidated as expected. To avoid ambiguity of file stat, this patch writes '.hg/phaseroots' file out with checkambig=True. This patch is a part of "Exact Cache Validation Plan": https://www.mercurial-scm.org/wiki/ExactCacheValidationPlan diff --git a/mercurial/phases.py b/mercurial/phases.py --- a/mercurial/phases.py +++ b/mercurial/phases.py @@ -251,7 +251,7 @@ class phasecache(object): def write(self): if not self.dirty: return - f = self.opener('phaseroots', 'w', atomictemp=True) + f = self.opener('phaseroots', 'w', atomictemp=True, checkambig=True) try: self._write(f) finally: