Mercurial hg identifies unchanged files as modified

I switched to a branch and

hg revert --all

then I wanted to import a diff file with

hg import [filename]

However, I got "abort: uncommitted changes". So I typed

hg st

It turned out that I had several modified files. But I tried with

hg diff -g

Only a blank line showed on the command prompt. And both

hg revert --all --no-backup

and

hg up -C -r [revision]

are not working. I also tried to delete those files and then revert them, switch to another branch then switch back, but those files are still identified as modified.


I ended up in this situation today, too.

I worked around the issue by running hg update -C null to empty the working folder, then hg update [revision] for the revision I wanted.