Question

My boss asked me to setup a Subversion server for him to use so that he can share all his documents across different machines in sync and still be able to access them when there is no Internet connection.

I have this up for him, but now he's requesting that the 'create date' file attribute be preserved. I explained that since he downloaded all the files that is their create date, but he insists I find a manner to preserve this as it is affecting the desktop search agent he uses. Is there any way to set this attribute to be preserved via Subversion, or do I have to write a script to get the date of each file and have him run 'touch' after each intial check out?

Note that the set of documents that were added to the SVN repository span back several years, and he wants these dates preserved across all checkouts. So the date of the last change that Subversion has could potentially be off by years from what he wants.

Was it helpful?

Solution

Sorry - misunderstood the question first time.

One option might be to use the svnadmin dump and load commands.

  • Dump the repository using svnadmin dump.
  • Write a script to trawl through the output, updating the SVN create date to the file create date on your source folder.
  • Load the updated dump file back in using svnadmin load.
  • Use the Set file dates to the "last commit time" setting I suggested earlier.

I'm not certain this is possible, but off the top of my head I think it would be. I seem to remember a script which did something like this when I transferred from SourceSafe to Subversion - I'll see if I can find it.

EDIT : Yeah, you might be able to crib some code from here (http://www.pumacode.org/projects/vss2svn)

OTHER TIPS

Using TortoiseSVN

  • Right-click and select TortoiseSVN -> Settings
  • Select Set file dates to the "last commit time"

I think that will work for you.

Check out the property "svn:date":

svn propset svn:date --revprop -r HEAD "2007-04-22"

Which requires a hook pre-revprop-change to be set up in advance.

You could use a Subversion file property to store the modification date, but you'd have to write your own script to update the property when checking in and to set the modification date when checking out.

The last time I checked there was no way in Subversion to preserve the original file's timestamp.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top