1

I'm running TortoiseHG 2.1.3 on Windows 7.

Is it possible to "Update" a repository to a particular point in the past and force the local files that are retrieved to have a modified date/time identical to that of when they were committed?

At the moment, if I "update" to a previous point in time, all the file involved are given a modified date/time of "now". I understand why this is happening as to make sure the IDE builds using the correct files (when it checks to see what has changed since the last build).

This isn't a major problem, but causing me a bit of headache when I'm trying to work out the latest files that are required.

freefaller
  • 19,368
  • 7
  • 57
  • 87

2 Answers2

2

I think hg archive (from command line) will do something along the lines of what you want.

EDIT: It seems as of: Mercurial Distributed SCM (version 3.0.1)

That the date/timestamps of all archive files are set to the requested revision date, not to the date/timestamp of most recent commit for a given file. Not the most useful thing. It sure seems like this is a change from how it used to work.

See this extension for one possible solution currently:

https://bitbucket.org/esskov/hg_timestamp_update/wiki/Home

  • Thanks for the response. Not exactly what I was after, but certainly a starting point. From brief experiments, archiving directly to a directory structure gives the current date/time (exactly what I didn't want), but archiving into a ZIP file sets the file at the date/time they were comitted - which is better. – freefaller Oct 07 '11 at 08:29
  • What options did you use to achieve this? When I do an archive everything in the archive has the same date/time on it and I'm not 100% where it is getting that date/time. It's close to the last time of the last checkin but does not seem exact. – dblwizard Jun 24 '14 at 20:46
  • @dblwizard I'm pretty sure that's a discrepancy between UTC and your local time and/or repository time is/isn't set up to match UTC properly. Assuming it's consistent and measured in a few hours at least... –  Jun 25 '14 at 14:01
  • @ebyrob But all the files have the same date/time instead of each files modification date/time. I can't seem to find anyway to get the files out with that date/time on them. – dblwizard Jun 25 '14 at 18:59
  • @dblwizard Updated answer with current behavior description. I'm pretty sure this is a change from how it used to be... –  Jun 25 '14 at 20:34
0

For the record, the answer is simply "no".

Mercurial does not currently save the modified date-time of the file.

And when you update, files are set to current date-time. It's possible with extensions (as mentioned in the other answer) to get them set to different date-times such as that of a revision, but the original modified date-time is gone.

O'Rooney
  • 2,878
  • 2
  • 27
  • 41