File updated not detected

Simon King simon at simonking.org.uk
Mon Nov 4 09:48:05 CST 2013


On Mon, Nov 4, 2013 at 9:23 AM, Marc Ottevaere <marc.ottevaere at nsi-sa.be>wrote:

>  Hi,
>
> We have a problem with Mercurial (2.6.2, older too) if you do the
> following actions:
>
> - we are the 2013-11-04.
> - the text file test.txt with size of 20 bytes exists and is tracked with
> clean status actually
> - set the file date/time to  2013-11-04 00:00:00
> - edit the file and change only one character
> - hg sta -> M test.txt
> - now, reset the date/time to 2013-11-04 00:00:00
> - hg stat -> nothing !!!
>
> The file has the same size and the same date/time with only content
> updated -> NOT DETECTED !
>
> Is there a solution because we use the date/time for setting the version.
>
>
>
I think this is by design - checking the contents of every file in your
repository would be very expensive, and it needs to be done by many
mercurial commands (status, commit, diff etc.). Mercurial therefore caches
the size and last-modified timestamp of each file in a structure called the
"dirstate", and won't bother examining the contents of a file unless one of
those attributes as changed.

If you *really* *really* must use this mechanism for setting the version,
you can cause Mercurial to rebuild its dirstate using the command "hg
debugrebuilddirstate" (http://selenic.com/hg/help/debugrebuilddirstate),
but I would encourage you to look for alternatives first.

Simon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://selenic.com/pipermail/mercurial/attachments/20131104/2db30197/attachment.html>


More information about the Mercurial mailing list