[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Is there really no way to keep the file modification time intact?

From: Duncan Murdoch <murdoch_at_stats.uwo.ca>
Date: 2007-03-07 03:49:52 CET

On 3/6/2007 9:07 PM, Ryan Schmidt wrote:
> On Mar 6, 2007, at 12:17, Steve Bakke wrote:
>
>>> Even more so as I just happened to come accross another issue of
>>> user data loss, involving no fiddling with mtime or other stuff
>>> except
>>> Subversion. I have not yet checked if it is documented or by
>>> design:
>>>
>>> # Create a new repo and check out a working copy
>>> $ svnadmin create repo
>>> $ svn co file:///path/to/repo wc
>>> Checked out revision 0.
>>> $ cd wc
>>>
>>> # Create a file
>>> $ echo hello > foo.txt
>>> $ dir
>>> 06.03.07 12:40 7 foo.txt
>>> # Note: file is present and 7 bytes long
>>>
>>> # Add and commit it
>>> $ svn add foo.txt
>>> A foo.txt
>>> $ svn ci -m ""
>>> Adding foo.txt
>>> Transmitting file data .
>>> Committed revision 1.
>>>
>>> # now we delete foo.txt and create another foo.txt
>>> # (move would do the dame)
>>> $ svn rm foo.txt
>>> D foo.txt
>>> $ dir
>>> # Note: there is no foo.txt anymore
>>> $ echo goodbye > foo.txt
>>> $ dir
>>> 06.03.07 12:42 9 foo.txt
>>> # Note: foo.txt is present and 9 bytes long.
>>>
>>> # now we revert our change to foo.txt
>>> $ svn revert foo.txt
>>> Reverted "foo.txt"
>>> $ cat foo.txt
>>> hello
>>>
>>> # The second foo.txt, created after deleting/moving the first one,
>>> # is lost -- without any warning, conflict, whatsoever.
>> You never committed the file deletion in the first place, so this
>> is not
>> data loss. If you wanted the second file to be retained, then you
>> need to
>> commit the deletion first.
>>
>> At that point, if you created a new foo.txt, a revert command would
>> have no
>> effect, since it is not under revision control. This is just a
>> case of
>> mis-using the tool.
>
> Steve, if you follow Jan,s script above, you will see that the file
> foo.txt that the user created with the contents "goodbye" was deleted
> by Subversion without notification. That is, by definition, data
> loss, and Subversion should not do that.

Sure it should. He asked to revert the changes, and that's a request to
lose them.

TortoiseSVN (and presumably other friendly front ends) ask you to
confirm data losing requests like reverts, but real men who use the
command line are supposed to just grunt when it happens.

Duncan Murdoch

(There are many places where
> texts claim that Subversion will not lose your data.) Jan, this
> sounds like a bug, and if it's not already submitted, I would
> recommend submitting it.
>
> Yes, unfortunately, to submit a bug, you must not only register at
> tigris, then also request observe rights for the subversion project.
> I hope you will do this and submit the bug, so that the problem is
> recorded in the database and it has a hope of getting fixed.
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Wed Mar 7 03:50:41 2007

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.