[PATCH] journal: use a more compatible way to wrap dirstate

Jun Wu quark at fb.com
Sat May 27 13:27:36 EDT 2017

Excerpts from Yuya Nishihara's message of 2017-05-27 22:55:57 +0900:
> On Fri, 26 May 2017 19:51:09 -0700, Jun Wu wrote:
> > This fixes the test with fsmonitor but is not 100% correct. The dirstate
> > state will be lost when dirstate object is reconstructed.
> Yes, and that would be more likely to be happen on Windows where filecache
> isn't cacheable.

Ah, good to know that. That explains the manifestctx caching issue I have

> [...] 
> I suppose marmoute's tr.changes will solve the issue.

Maybe I should just refactor journal to be transition aware then.

> [...]
> I don't think journal extension is guilty. Both fsmonitor and journal do
> weird thing. Can't it be addressed if localrepository had a plain
> _dirstate() factory?

It's more complex when chg starts to populate filecache state. If journal
only wraps "_dirstate", then filecache could still have the outdated object.

"wrapfilecache" in fsmonitor/__init__.py seems important to make it correct.

>   @filecache
>   def dirstate(self):
>       return self._dirstate()  # override this by journalrepo and fsmonitorrepo

Anyway, I'll drop that patch and explore the transaction approach, or port
wrapfilecache to extensions.py

More information about the Mercurial-devel mailing list