[PATCH 5 of 7] fsmonitor: avoid instantiation of dirstate in reposetup

Jun Wu quark at fb.com
Tue Jul 4 20:49:20 EDT 2017


Excerpts from FUJIWARA Katsunori's message of 2017-07-05 00:21:25 +0900:
> > Perhaps this disagree with bf3af0eced44. CC-ed Jun.
> 
> Oh, I overlooked that, sorry.
> 
> If chg prefills repo's dirstate filecache before reposetup(), it
> causes issue with an extension, of which wrapper for repo.dirstate
> works as expected only after own reposetup() (e.g. journal).
> 
> Should I fix journal extension as similarly as bf3af0eced44 ?
 
I think journal should be fixed. My previous attempt was [1]. There is a
conclusion at that time, which is we have 2 choices:

  a) Refactor journal so it's transaction (or command, even better?) aware,
     i.e. it checks changes before and after dispatch.runcommand, instead of
     wrapping everything.
  b) Use "wrapfilecache" like fsmonitor to replace the function inside
     filecache entry.

"b)" is easier but "a)" will make "b)" unnecessary. If we want to fix it now
it could be applying [1] plus a "wrapfilecache" call. At that time
"wrapfilecache" is still in "fsmonitor/", not in extensions.py so I didn't
go ahead.

Since journal is experimental, and eventually "a)" looks nicer. I think it's
fine to leave journal broken for now (until I have more time to do "a)"
refactoring).

[1]: https://www.mercurial-scm.org/pipermail/mercurial-devel/2017-May/098595.html


More information about the Mercurial-devel mailing list