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

Re: svn does not detect file recodings as changes

From: Ryan Schmidt <subversion-2007a_at_ryandesign.com>
Date: 2007-02-22 22:02:23 CET

On Feb 21, 2007, at 10:52, Jan Hendrik wrote:

> Duncan Murdoch wrote on 20 Feb 2007, 10:05, at least in part:
>
>> On 2/20/2007 9:13 AM, Jan Hendrik wrote:
>
> [...]
>
>>> Anyway, the current SVN behaviour is in so far even worse as in a
>>> svn update any modification in such files is not merged, but
>>> overwritten - read: lost - as I just confirmed in a test, even if
>>> the filesize has changed by this "non-mtimed" modification. So IMHO
>>> SVN makes quite a dangerous guess by exclusively relying on mtime
>>> even in cases where modifications are not only just not committed,
>>> but could be written over.
>>
>> I'd call this a bug. You should put together a demo script and
>> submit
>> a bug report.
>>
>> It's arguable whether to use mtime or ctime or a full binary compare,
>> but to ignore changes in file size before a destructive update is
>> clearly a bug.
>
> Not being used to software development and bug reporting I'm not
> sure if this is the right way as suggested by you, but this is what
> I did:

Jan: Duncan meant you should provide a set of commands that anyone
could execute on their own machines to observe the problem. That
means you should start with the creation of an empty repository, and
go from there until you get the error. Like this script, which
demonstrates the problem:

# Create a new repo and check out a working copy
$ svnadmin create repo
$ svn co file://`pwd`/repo wc
Checked out revision 0.
$ cd wc

# Create a file that's modified at noon today
$ echo hello > foo.txt
$ touch -m -t 200702221200 foo.txt
$ ls -l
total 8
-rw-r--r-- 1 rschmidt wheel 6 Feb 22 12:00 foo.txt
# Note: file is 6 bytes

# Add and commit it
$ svn add foo.txt
A foo.txt
$ svn ci -m ""
Adding foo.txt
Transmitting file data .
Committed revision 1.

# Now change the file contents but keep mod time the same
$ echo goodbye > foo.txt
$ touch -m -t 200702221200 foo.txt
$ ls -l
total 8
-rw-r--r-- 1 rschmidt wheel 8 Feb 22 12:00 foo.txt
# Note: file is clearly different because it's now 8 bytes

$ svn st
# Note: svn st doesn't show that anything has changed
# Note: wc now contains changes, though svn doesn't think it does

# Now check out a new working copy and commit changes
$ cd ..
$ svn co file://`pwd`/repo wc2
A wc2/foo.txt
Checked out revision 1.
$ cd wc2
$ echo hi > foo.txt
$ svn ci -m ""
Sending foo.txt
Transmitting file data .
Committed revision 2.

# Go back into the first working copy with its stealth changes
$ cd ../wc

# See that our changed text is still there
$ cat foo.txt
goodbye

# Update
$ svn up
U foo.txt
Updated to revision 2.

# And now our changes are lost, with no notice from svn
# that this has happened -- no conflict, no merge, nothing
$ cat foo.txt
hi
$

Now all you have to do is file a bug report [1] and link to this
email [2].

[1] http://subversion.tigris.org/project_issues.html

[2] find it on http://svn.haxx.se/users/

-- 
To reply to the mailing list, please use your mailer's Reply To All  
function
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Thu Feb 22 22:02:51 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.