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

Re: svn commit: r8897 - in trunk/subversion: libsvn_wc tests/clients/cmdline

From: Greg Stein <gstein_at_lyra.org>
Date: 2004-03-05 22:43:40 CET

On Fri, Mar 05, 2004 at 01:41:27PM -0600, kfogel@tigris.org wrote:
>...
> +++ trunk/subversion/libsvn_wc/adm_ops.c Fri Mar 5 13:41:27 2004
> @@ -1243,6 +1243,63 @@
> if (entry->kind == svn_node_file)
> {
> SVN_ERR (svn_io_check_path (fullpath, &kind, pool));
> + base_thing = svn_wc__text_base_path (fullpath, 0, pool);
> +
> + if (entry->checksum)
> + {
> + /* The Two Temptations:
> + *

That's an awfully long comment. I think you can describe the problem with
much shorter text. There are two situations here:

  * svn_wc_text_modified_p() says the wc is unmodified

    - it could be that the WC is a copy of a corrupted text base. thus, we
      still need to compute a checksum of the text base.

  * svn_wc_text_modified_p() says the wc is modified

    - the text base might still be corrupted, so we have to check, to
      ensure we don't copy corrupted stuff out to the WC.

Thus, we always need to compute the checksum.

The second issue is whether it is possible to collapse the checksum into
text_modified's byte-by-byte comparison. That *should* be doable.

IOW, the net result could be:

  * the files appear the same at the surface, so a byte-by-byte comparison
    is made. at the same time, a checksum can be computed on the source.
    
    note that early exit during the byte-by-byte is no longer allowed.

  * the files differ at the surface, so text_modified exits early. a
    normal checksum is run on the text base.

So... I think you *can* optimize the behavior here. Rather than two passes
over the files (quite possible now), you can drop it to a single pass in
all cases.

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Mar 5 22:40:47 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.