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

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

From: Erik Huelsmann <ehuels_at_gmail.com>
Date: 2007-09-19 11:08:59 CEST

On 9/18/07, Erik Huelsmann <ehuels@gmail.com> wrote:
> If you nominate for backport, please add my +1 to it.
>
> On 9/18/07, vgeorgescu@tigris.org <vgeorgescu@tigris.org> wrote:
> > Author: vgeorgescu
> > Date: Tue Sep 18 04:00:46 2007
> > New Revision: 26659
> >
> > Log:
> > Fix issue #2928: reverting a scheduled-replace-with-history file doesn't
> > restore the original checksum.
> >
> > * subversion/libsvn_wc/adm_ops.c
> > (revert_admin_things): Restore the original checksum when reverting a
> > replaced with history file.
> >
> > * subversion/tests/cmdline/revert_tests.py
> > (revert_replaced_with_history_file_1): Rename from
> > revert_replaced_with_history_file, and adjust docstring.
> > (revert_replaced_with_history_file_2): New test.
> > (test_list): Add revert_replaced_with_history_file_2, and rename
> > revert_replaced_with_history_file to revert_replaced_with_history_file_1.
> >
> >
> > Modified:
> > trunk/subversion/libsvn_wc/adm_ops.c
> > trunk/subversion/tests/cmdline/revert_tests.py
> >
> > Modified: trunk/subversion/libsvn_wc/adm_ops.c
> > URL: http://svn.collab.net/viewvc/svn/trunk/subversion/libsvn_wc/adm_ops.c?pathrev=26659&r1=26658&r2=26659
> > ==============================================================================
> > --- trunk/subversion/libsvn_wc/adm_ops.c (original)
> > +++ trunk/subversion/libsvn_wc/adm_ops.c Tue Sep 18 04:00:46 2007
> > @@ -1911,6 +1911,19 @@
> > SVN_WC__ENTRY_MODIFY_COPYFROM_URL |
> > SVN_WC__ENTRY_MODIFY_COPYFROM_REV;
> > tmp_entry.copied = FALSE;
> > +
> > + /* Reset the checksum if this is a replace-with-history. */
> > + if (tmp_entry.copyfrom_url)
> > + {
> > + const char *revert_base;
> > + unsigned char digest[APR_MD5_DIGESTSIZE];
> > +
> > + revert_base = svn_wc__text_revert_path(fullpath, FALSE, pool);
> > + SVN_ERR(svn_io_file_checksum(digest, revert_base, pool));
> > + tmp_entry.checksum = svn_md5_digest_to_cstring(digest, pool);
> > + flags |= SVN_WC__ENTRY_MODIFY_CHECKSUM;
> > + }
> > +
> > /* Set this to the empty string, because NULL values will disappear
> > in the XML log file. */
> > tmp_entry.copyfrom_url = "";
> >

I've slept on the change and I think there's a better one (though that
one can't be backported): I think we should save the digest in the
entries file (and thus in a svn_wc_entry_t), extending the entry
structure with a 'const char *revert_digest'.

That way, we'll actually know if the file got damaged somehow, instead
of faking that it's not...

Would you have time to implement it this way?

bye,

Erik.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Sep 19 11:09:10 2007

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.