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

Re: [PATCH] WCNG: Enforce that a pristine checksum always references an entry in the pristine store.

From: Philip Martin <philip.martin_at_wandisco.com>
Date: Tue, 21 Dec 2010 09:56:51 +0000

Julian Foad <julian.foad_at_wandisco.com> writes:

> @@ -1009,23 +1034,25 @@ migrate_text_bases(const char *dir_abspa
> complexity. :) */
>
> /* Gather the two checksums. */
> - SVN_ERR(svn_io_file_checksum2(&md5_checksum, text_base_path,
> - svn_checksum_md5, iterpool));
> - SVN_ERR(svn_io_file_checksum2(&sha1_checksum, text_base_path,
> - svn_checksum_sha1, iterpool));
> + SVN_ERR(svn_io_file_checksum2(&file_info->md5_checksum, text_base_path,
> + svn_checksum_md5, result_pool));
> + SVN_ERR(svn_io_file_checksum2(&file_info->sha1_checksum, text_base_path,
> + svn_checksum_sha1, result_pool));

How much memory is allocated when checksumming a file? That's all going
into the long-lived result pool. Perhaps we need a svn_stream_checksummed3
that takes two pools?

>
> + * 1) Read the old 'entries' using the old-format reader.
> + *
> + * 2) Create the new DB if it hasn't already been created.
> *
> - * 2) Convert wcprop to the wc-ng format
> + * 3) Use our compatibility code for writing entries to fill out the (new)
> + * DB state. Use the remembered checksums, since an entry has only the
> + * MD5 not the SHA1 checksum, and in the case of a revert-base doesn't
> + * even have that.
> *
> - * 3) Trash old, unused files and subdirs
> + * 4) Convert wcprop to the wc-ng format
> *
> - * ### (fill in other bits as they are implemented)
> + * 5) Migrate regular properties to the WC-NG DB.
> + *
> + * 6) Trash old, unused files and subdirs.

That's out-of-date, we don't remove the old files for this directory
until the whole working copy is upgraded.

> --- subversion/libsvn_wc/wc-metadata.sql (revision 1051073)
> +++ subversion/libsvn_wc/wc-metadata.sql (working copy)
> @@ -167,9 +167,9 @@ CREATE TABLE ACTUAL_NODE (
> conflicts? Why do we need these in a column to refer to the
> pristine store? Can't we just parse the checksums from
> conflict_data as well? */
> - older_checksum TEXT,
> - left_checksum TEXT,
> - right_checksum TEXT,
> + older_checksum TEXT REFERENCES PRISTINE (checksum),
> + left_checksum TEXT REFERENCES PRISTINE (checksum),
> + right_checksum TEXT REFERENCES PRISTINE (checksum),
>
> PRIMARY KEY (wc_id, local_relpath)
> );
> @@ -415,7 +415,7 @@ CREATE TABLE NODES (
>
> /* The SHA-1 checksum of the pristine text, if this node is a file and was
> moved here or copied here, else NULL. */
> - checksum TEXT,
> + checksum TEXT REFERENCES PRISTINE (checksum),
>
> /* for kind==symlink, this specifies the target. */
> symlink_target TEXT,

Add a note about REFERENCES PRISTINE to the differences comment in the
format 99 section.

-- 
Philip
Received on 2010-12-21 10:57:31 CET

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.