views:

2140

answers:

4

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 effecting 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 last change that subversion has could potentially be off by years from what he wants.

A: 

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

Vilmantas Baranauskas
A: 

Using TortoiseSVN

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

I think that will work for you.

RB
The date he wants isn't the subversion date, but the dates on the files before they were imported to the subversion repository. I updated the question to reflect this.
Mark Roddy
A: 

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.

cjm
A: 

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)

RB
That's really creative thanks for the answer. I'll try this tonight after my boss leaves for the evening. Its gonna take a while to run though cause he's got 11 gigs of documents
Mark Roddy
Out of curiosity: did it work? And how long did the 11 Gig take?
jan
funny i have a boss with an almost exact requirement. Mark any luck with it ?
Kaushik Gopal