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

Re: svn diff doesn't verify MD5 sums (Related to issues #1774 and #1177)

From: <kfogel_at_collab.net>
Date: 2004-03-06 01:26:31 CET

Jani Averbach <jaa@jaa.iki.fi> writes:
> SVN doesn't verify md5sums when it is doing diff against text
> base. Here is the recipe:

Hmmm.

Okay, we have a general question here: when and/or how often do we
want to verify the text base? The cost, of course, is that we have to
scan every byte.

This and the related issues #1774 and #1177 all share a common theme:
Subversion may take the "early out" and decide that the working file
is not modified, based on the timestamp. And if it gets past that, it
may still take another early out and decide that the file *is*
modified because the two file sizes differ. In both outs, it avoids
scanning the entire text base.

Once past these two outs, the three commands (diff, revert, status)
diverge a bit. While 'revert' and 'status' do need to scan the bytes,
they currently only need to go as far as discovering the first
difference, then they stop, whereas 'diff' has to scan all the bytes
anyway.

As I understood it, our goal in havin checksums has been primarily to
prevent corrupt data from getting into the repository. That's why
commits have verified checksums since the beginning. I just now
committed r8897 (fixing #1774) because 'revert' somehow intuitively
seemed like a good chance to verify the text base, much like
'checkout' and 'update'.

I'm not so sure that 'status' and 'diff' are equally persuasive cases,
though. And in the case of 'status', we'd pay a speed penalty to do
verification, since it almost never has to scan the entire text base
for modified files right now.

In short: I'm comfortable with the status quo, but wonder what others
think. (If we agree the status quo is okay, we should probably close
those two issues as WONTFIX.)

Thoughts?

-Karl

> svn --version
> svn, version 1.1.0 (dev build)
> compiled Mar 4 2004, 09:51:36
>
> # --8<--
> svnadmin create repo
> svn co file://`pwd`/repo wc
> cd wc
> touch file
> svn add file
> svn ci -m '' file
> echo '#1 line' >> file
> echo '#2 line' >> file
> chmod u+w .svn/text-base/file.svn-base
> echo '#2 line' >> .svn/text-base/file.svn-base
> svn diff
> # --8<--
>
> Index: file
> ===================================================================
> --- file (revision 1)
> +++ file (working copy)
> @@ -1 +1,2 @@
> +#1 line
> #2 line
>
> However, svn ci works correctly:
> svn ci -m ''
> Sending file
> Transmitting file data .svn: Commit failed (details follow):
> svn: Checksum mismatch for '/raid/3/jaa/tmp/svntest/wc/.svn/text-base/file.svn-base':
> expected 'd41d8cd98f00b204e9800998ecf8427e', actual: 'ca9da9a536181a005144afc186ada942'
>
> This is related (similar) to issues:
>
> svn status should MD5 the text-base
> http://subversion.tigris.org/issues/show_bug.cgi?id=1177
>
> 'svn revert' does not verify checksums
> http://subversion.tigris.org/issues/show_bug.cgi?id=1774

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Mar 6 01:24:48 2004

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

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