[hg update] Wrong file date after an update. Is it a bug ?
Stuart W. Marks
smarks at smarks.org
Fri Oct 2 12:21:09 CDT 2009
William Ledoux wrote:
> I have my repository, with different dates for each file. And then I
> commit (Revision 12), and then some new modifications, and I commit
> again (rev 13). If I immediatly update to revision 12, I expect my
> folder to be exactly as it was 10 seconds before, and instead of that I
> losed all the modification dates.
Most software build systems use file modification times to determine when to
recompile files. Suppose revisions 12 and 13 have changes to a file, say foo.c.
If you're at rev 13 this file gets compiled into foo.o. When you update back to
rev 12, if foo.c's modification time were changed to sometime earlier in the
past, foo.o would be newer and thus foo.c wouldn't get recompiled. For this
case you really want foo.c's mod time to be "now" even if it's updated to an
earlier revision, so that it gets recompiled.
This is why most people consider Mercurial's current behavior to be correct. If
you really want modification times to be considered as part of the history, and
restored when you update to some revision, then yes, the Timestamp extension
should do what you want.
s'marks
More information about the Mercurial
mailing list