You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Matthew Sanderson <ma...@formtrap.com> on 2006/03/08 05:05:28 UTC

Preserve commit times (issue #1256)

Hi,

I would like to be able to commit/import a file F1 to the repository, then
check that file out or update it, yielding a file F2 in another working
copy, and have F2's time of last modification be the same as F1. Ie, the
checkin+checkout procedure should preserve the file's mtime. The
'use-commit-times' config option doesn't do what I want.

This is issue #1256, which has been around since SVN 1.0 or earlier.
There's a stale, incomplete patch that attempts to add this functionality:
http://subversion.tigris.org/servlets/ReadMsg?list=dev&msgId=257080

At the moment, the only way I can see to accomplish this is to:
1. stat the file to be checked in;
2. set the value of a property on that file equal to the file's mtime;
3. checkin/import the file into the repo;
4. check out/update/export the file into another WC;
5. read the value of the file's custom property;
6. call utime[s] on the just-checked-out file.

Is this the only way to do this? It's a little ugly.
Are there any future plans to support this in Subversion itself?

The reason I want this is because I have source and generated files in a
repo, and a bogus Make rule which claims to be able to generate the
generated files from the source files, but which actually exits with an
error instead of doing the generation, because the generation can only be
done manually by a human on a different operating system. So this is a
check for a human omission. I imagine there exist less corner-ish cases in
which this functionality would be useful, too.

Cheers,

--matt

Matthew Sanderson
Senior Programmer (UNIX)
TCG Information Systems Pty Ltd
Sydney, Australia
matthew@formtrap.com
http://www.formtrap.com/
+61 (02) 8303 2407

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Preserve commit times (issue #1256)

Posted by Matthew Sanderson <ma...@formtrap.com>.
On Wed, 8 Mar 2006, Ryan Schmidt wrote:

> On Mar 8, 2006, at 06:05, Matthew Sanderson wrote:
>
> > I would like to be able to commit/import a file F1 to the
> > repository, then
> > check that file out or update it, yielding a file F2 in another
> > working
> > copy, and have F2's time of last modification be the same as F1.
> > Ie, the
> > checkin+checkout procedure should preserve the file's mtime. The
> > 'use-commit-times' config option doesn't do what I want.
>
> The use-commit-times option sets the modification time of files, on
> checkout or update, to the time they were committed. If that's not
> enough for you—if you need to store the actual modification time of
> the file, separately for each file within a single commit, then the
> meta-data-versioning branch may be for you:
>
> http://svn.collab.net/viewvc/svn/branches/meta-data-versioning/
> README.TXT?view=markup&rev=14236
>
>

Ryan,

Thanks! That branch looks to be exactly what I want.

It seems that in svn trunk, use-commit-times doesn't do what I want; but
on this branch and with the svn:text-time property set to enable this new
mtime save/restore functionality, use-commit-times does do what I want
(and doesn't do what it does in svn trunk).

I don't like this overloading of that config option. If the overloading is
to stay, then IMO the option should be renamed to 'use-repo-mtimes' or
maybe even 'use-repo-metadata' to reflect its new meaning. But I would
prefer two seperate config options. Still, regardless of its UI, this is
the functionality I was after.

Thanks again,

--matt

Matthew Sanderson
Senior Programmer (UNIX)
TCG Information Systems Pty Ltd
Sydney, Australia
matthew@formtrap.com
http://www.formtrap.com/
+61 (02) 8303 2407

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org


Re: Preserve commit times (issue #1256)

Posted by Ryan Schmidt <su...@ryandesign.com>.
On Mar 8, 2006, at 06:05, Matthew Sanderson wrote:

> I would like to be able to commit/import a file F1 to the  
> repository, then
> check that file out or update it, yielding a file F2 in another  
> working
> copy, and have F2's time of last modification be the same as F1.  
> Ie, the
> checkin+checkout procedure should preserve the file's mtime. The
> 'use-commit-times' config option doesn't do what I want.

The use-commit-times option sets the modification time of files, on  
checkout or update, to the time they were committed. If that's not  
enough for you—if you need to store the actual modification time of  
the file, separately for each file within a single commit, then the  
meta-data-versioning branch may be for you:

http://svn.collab.net/viewvc/svn/branches/meta-data-versioning/ 
README.TXT?view=markup&rev=14236


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org