How does Mercurial tell a file was modified?
The reason I am asking is because when I run hg status its telling me several files are modified.
However, when I run hg diff there are no changes to report.
I have a theory as why this is happening: (but I am not positive)
I am using NetBeans which has Mercurial support built in. When I edit a file, it shows it as modified, although if I undo (rather than revert) those changes and save it, NetBeans tells me there are no local changes. So I am guessing NetBeans uses diffs to check for modifications while Mercurial is using something else like modification-date.
Is this correct or is something else the cause?
Mercurial does not use modification date to determine the status. This can be verified with a simple experiment:
The code which performs the status check is in
dirstate.py. If thedirstateis unsure about a file’s status (e.g. because only the modification time differs, then it passes it up tolocalrepo.statusfor further analysis as seen here.The
hg help statustext has some clues that may help:When you run
hg diff, are you specifying any command-line options?