Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 345247 - Replace With Latest from HEAD does not restore file modification date.
Summary: Replace With Latest from HEAD does not restore file modification date.
Status: RESOLVED INVALID
Alias: None
Product: Platform
Classification: Eclipse Project
Component: CVS (show other bugs)
Version: 3.6.1   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: platform-cvs-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-10 07:15 EDT by Jan Skarvall CLA
Modified: 2011-05-12 04:52 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Skarvall CLA 2011-05-10 07:15:35 EDT
Having committed a project, then changed a source file, followed by restoring the source file using Replace With > Latest from HEAD, I found that the modification time of the source file is not restored. The modification time becomes the time when the replacement occurred.

Same thing happens if an older, tagged, version of a project is imported. After import, the modification time looks good, but after a source file change followed by Replace With > Version <tag>, the modification time the time is when the replacement occurred.

I discovered this using a script that checked that an Android .apk file built by Export ... > Export Android Application is newer than the source files.
Comment 1 Jan Skarvall CLA 2011-05-11 12:42:58 EDT
I also just now noticed that the entry for the file in CVS/Entries is updated at the time of replacement, changing the time for the file to be the UTC time of the replacement, e.g.:

/.project/1.3/Thu Mar 31 14:55:04 2011//
                    ----------------------------------     changed time

This seems strange, as the UTC time for the file in CVS/Entries now differs from the UTC time for the same file in the CVS repository.

I can imagine that the observed behavior was meant to cheat CVS to think that the replaced file is up to date with CVS, but I would have preferred that CVS/Entries had not been tampered with, and that the modification time of the replaced file was simply set back to the time in CVS/Entries e.g. by using the touch command or something with similar effect, noting that touch uses local time rather than UTC time. Doing it like this would result in the file having the same modification time as it would have after an import of the project from CVS.

B.t.w. the script uses find ... -newer ... for the check I mention above.
Comment 2 Jan Skarvall CLA 2011-05-12 04:43:09 EDT
Problem solved!

I found out that Team>Revert to Base works exactly as what I was looking for.

I did not understand the difference in semantics between Replace With>Latest from HEAD and Team>Revert to Base.
Comment 3 Tomasz Zarna CLA 2011-05-12 04:52:45 EDT
(In reply to comment #2)
> I did not understand the difference in semantics between Replace With>Latest
> from HEAD and Team>Revert to Base.

This article should help in case you still have some doubts: http://eclipser-blog.blogspot.com/2007/05/revert-to-base-few-things-about.html