When to use invalidate()

Greg Ward greg at gerg.ca
Tue Feb 2 07:11:18 CST 2010

On Tue, Feb 2, 2010 at 12:01 AM, Steve Borho <steve at borho.org> wrote:
> FWIW: THG calls repo.invalidate() at every refresh event.  Perhaps
> overkill, but we get bitten a lot by state mismatches from people
> using the CLI while keeping our tools open for a long time.  See
> invalidaterepo() in tortoisehg/util/hglib.py

Thought #1: what if THG did like hgweb and checked the mtime of
selected files in .hg to auto-refresh?  E.g. every time the window
gets focus you could stat() a couple of files.  Might be too
expensive/intrusive to actually do the refresh at that point, but you
could at least tell the user there is something to refresh.

Thought #2: aiee! don't do that! it might make life harder for
extensions like my bugmap, just like hgweb does.  (I'll explain more
in my next post, following up to Dirkjan.)

Just thinking out loud...


More information about the Mercurial-devel mailing list