The .hg directory timestamps

Norman Gray gray at nxg.name
Thu Jul 13 15:25:15 UTC 2023


Greetings.

The timestamp of the .hg directory is updated whenever one does 'hg 
status'.  Did it always do that?

I don't _think_ that was always the case,  since I've long been in the 
habit of having a makefile rule which has .hg as a dependency of (say) 
version.h, so that I can regenerate that file when appropriate with, for 
example, revision numbers and dates for the current state of the 
checkout.  That seemed to work as expected until recently, when I've 
noticed the .hg timestamp changing much more frequently.  Just 'hg 
status' -- something I'd expect to be a read-only operation -- seems to 
do it.

Presuming that's deliberate, or at least not regarded as a defect, is 
there something else it would be reasonable to use as a dependency of my 
version.h?  I suppose using the 'update' hook could have a similar 
effect, but that seems a relatively heavyweight solution.

I can see that .hg/last-message.txt or .hg/undo.branch, for example, 
have a time matching the last checkout change, but it feels fragile to 
depend on such implementation-like details, even for such a non-crucial 
goal such as this.

Best wishes,

Norman


-- 
Norman Gray  :  https://nxg.me.uk


More information about the Mercurial mailing list