Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5838921
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T11:31:11+00:00 2026-05-22T11:31:11+00:00

How does Mercurial tell a file was modified? The reason I am asking is

  • 0

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T11:31:11+00:00Added an answer on May 22, 2026 at 11:31 am

    Mercurial does not use modification date to determine the status. This can be verified with a simple experiment:

    hg init
    echo "This is a test" > test.txt
    hg commit -Am "commit"
    touch test.txt
    hg status
    

    The code which performs the status check is in dirstate.py. If the dirstate is unsure about a file’s status (e.g. because only the modification time differs, then it passes it up to localrepo.status for further analysis as seen here.

    The hg help status text has some clues that may help:

    status may appear to disagree with
    diff if permissions have changed or a
    merge has occurred. The standard diff
    format does not report permission
    changes and diff only reports changes
    relative to one merge parent.

    When you run hg diff, are you specifying any command-line options?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

hg log works. hg log --style does not work. C:\temp\myhg> c:\program files\mercurial\hg log changeset:
Can anyone tell me what this Mercurial error means? untracked file in working directory
does Mercurial have an HTTP protocol we could browse files/folders/branches instead of clone/pull changesets?
How does Mercurial handle Alternate Data Streams (in the NTFS file system)? If it
I'm seeing that mercurial efficiently compresses the files in repository (repo/.hg/store/data) Does anybody know
Possible Duplicate: Why does Mercurial think my SQL files are binary? I generated a
Does Mercurial offer any type of extensions that offer functionality similar to TFS's work
What does it mean when you try to push to a Mercurial repository on
How do I do what svn switch does, in Mercurial? That is change my
Does anyone know of a tutorial or guide for HgScc (Mercurial)? I've installed and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.