dirstate hooks

Steve Borho steve at borho.org
Sun May 17 10:31:17 CDT 2009


TortoiseHG has introduced C++ explorer extensions on it's development
branch.  We've found that directly reading the dirstate cache is an
order of magnitude faster than running repo.status(), and more
importantly removing the Python shell extensions fixes a large number
of interoperability problems that have plagued the project from the
beginning.

Reading the dirstate file directly has some drawbacks that we would
like to try to at least partially work around.  In particular, the 'n'
or 'not-set' state which occurs when a file was last modified within a
second of it's being scanned.  It happens very consistently after
clone and update operations.  I would like to be able to introduce a
hook or other UI configuration so that TortoiseHg can opt in for a
delay here to wait for the second hand of the system clock to roll
over before continuing.

I believe many of our users would be willing to take the potential 1
second delay here in order to always have consistent file overlays
(and the ones that aren't should be able to disable the feature).

And lastly, I would like to be able to set a hook for whenever the
dirstate changes, so that we can notify explorer to refresh it's open
windows in that repository.  Unfortunately, hook seems to be a repo
functionality and dirstate is nicely layered away from the repo.
(we've been doing this manually after calling mercurial commands, but
it is error prone and doesn't work at all with command line hg).

I'm mostly looking for feedback on the best way to approach both issues.

--
Steve Borho


More information about the Mercurial-devel mailing list