I have a repository where:
> hg st
shows that my working directory has some uncommitted changes, while
> hg diff
> h
In these situations (it happens a lot to my team), I find that this command will fix about anything:
hg debugrebuilddirstate
or
hg debugrebuilddirstate -r tip
It's lightly documented in the help documentation, but basically I believe it clears out the "dirstate" file which caches information about working-directory files. The next time you hg stat
it will refresh it from scratch.
One caveat: if you've added or removed files, that information will be lost when the dirstate
is rebuilt.