reset file modification time when go back in time?

Giorgos Keramidas keramida at ceid.upatras.gr
Tue Nov 6 03:43:25 CST 2007


On 2007-11-06 14:33, dhruva <dhruvakm at gmail.com> wrote:
>On 11/6/07, Giorgos Keramidas <keramida at ceid.upatras.gr> wrote:
>> It is all based on the false assumption that "timestamps only
>> make sense locally".  They don't.  Timestamps are useful for
>> tracking when something was committed too :/
> 
> Well, then that extra information (file with time stamp data) can be
> made available across repositories. We will then have to use a time
> zone neutral format to store times.

I don't see how "time zone neutral times" would help.  Consider this
case (the left column is timestamps in a formar similat to 'UNIX seconds
since the Epoch', which is timezone neutral):

10.000		A repository includes files 'a' and 'b'
10.100		Developer 1 clones the repository
10.120		Developer 2 clones the repository
10.205		Developer 1 commits fix affecting file 'a'
		in her local tree
10.206		Developer 2 commits fix affecting file 'a'
		in her local tree
10.207		Developer 2 commits fix affecting file 'b'
		in her local tree
10.300		Developer 1 pushes
10.305		Developer 2 tries to push, but fails (multiple heads)
10.306		Developer 2 pulls, and merges keeping the fix of
		developer 1 for the 'a' file
10.307		Developer 2 commits the merge locally, and pushes

Now, what would you have the timestamp of 'a' be?  The final contents of
the file are essentially the same as those committed by developer 1 at
time 10.205, but they are also affected by the merge done by developer 2
at time 10.306.

File 'b' was modified both:

    * 'before' file 'a', if you consider 10.306 as the
      'authoritative timestamp' for file 'a', and

    * 'after' file 'a', if you consider 10.206 as the
      last time 'a' was really 'modified'

Importing changesets created at a past date, with their full changelog
header can also mess things up.  There is at least one patch I have
submitted to Mercurial itself which was imported weeks after the date I
made it, so the changeset says the timestamp was 3 weeks ago from its
parent changeset!

I'm sur merging from offline work, and importing patches at a later date
can create even more "interesting" effects :)



More information about the Mercurial mailing list