# HG changeset patch # User FUJIWARA Katsunori <fo...@lares.dti.ne.jp> # Date 1476456913 -32400 # Fri Oct 14 23:55:13 2016 +0900 # Node ID 681b0442741642fb0a8300b2be72150422c0ea83 # Parent 72486917916f6d47525f721cd5b27012091122ed # Available At https://fo...@bitbucket.org/foozy/hg-experimental # hg pull https://fo...@bitbucket.org/foozy/hg-experimental -r 681b04427416 sqldirstate: write fake dirstate always to detect changes correctly
Before this patch, if sqldirstate.fakedirstate configuration is false value, (fake) dirstate isn't written out (or explicitly unlinked), In such case, @filecache never detects change of dirstate by another process/thread, because not-existing file never change its file stat. To achieve checking cache validity without existence of .hg/dirstate file, we should use another cache annotation instead of @filecache. This patch removes code paths to avoid writing (or unlinking) fake dirstate, and writes fake dirstate always to detect changes correctly. Just removing these code paths seems reasonable enough, because it was already confirmed at Mercurial 4.0 sprint that there is no concrete usecase for sqldirstate.fakedirstate configuration. diff --git a/sqldirstate/__init__.py b/sqldirstate/__init__.py --- a/sqldirstate/__init__.py +++ b/sqldirstate/__init__.py @@ -67,10 +67,7 @@ def upgrade(ui, repo): tosql(repo.dirstate) repo.requirements.add('sqldirstate') repo._writerequirements() - if ui.configbool('sqldirstate', 'fakedirstate', True): - writefakedirstate(repo.dirstate) - else: - repo.dirstate._opener.unlink('dirstate') + writefakedirstate(repo.dirstate) del repo.dirstate finally: diff --git a/sqldirstate/sqldirstate.py b/sqldirstate/sqldirstate.py --- a/sqldirstate/sqldirstate.py +++ b/sqldirstate/sqldirstate.py @@ -485,8 +485,7 @@ def makedirstate(cls): if '_nonnormalset' in self.__dict__: delattr(self, '_nonnormalset') - if self._ui.configbool('sqldirstate', 'fakedirstate', True): - writefakedirstate(self) + writefakedirstate(self) def _backupandwrite(self, tr): if not self.skipbackups: _______________________________________________ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel