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

Re: svn commit: r1649797 - /subversion/trunk/subversion/libsvn_fs_x/fs_x.c

From: Stefan Sperling <stsp_at_elego.de>
Date: Tue, 6 Jan 2015 15:25:47 +0100

On Tue, Jan 06, 2015 at 01:12:24PM -0000, stefan2_at_apache.org wrote:
> Author: stefan2
> Date: Tue Jan 6 13:12:23 2015
> New Revision: 1649797
>
> URL: http://svn.apache.org/r1649797
> Log:
> Simplify the r0 template in FSX. Because we treat directories with NULL
> text reps as empty (and do so efficiently), we can simply ommit the text
> rep for the root directory in r0. The remainder are simple strings that
> we can take length info from and that can be composed into r0.
>
> * subversion/libsvn_fs_x/fs_x.c
> (write_revision_zero): Omit /@0 text rep and compose r0 from strings.
> Derive offset info from string lengths.
>
> Modified:
> subversion/trunk/subversion/libsvn_fs_x/fs_x.c
>

THANK YOU! This is so much more readable :)

Is there a regression test which compares the result of this function
with a known template or copy of r0?

> Modified: subversion/trunk/subversion/libsvn_fs_x/fs_x.c
> URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_x/fs_x.c?rev=1649797&r1=1649796&r2=1649797&view=diff
> ==============================================================================
> --- subversion/trunk/subversion/libsvn_fs_x/fs_x.c (original)
> +++ subversion/trunk/subversion/libsvn_fs_x/fs_x.c Tue Jan 6 13:12:23 2015
> @@ -845,43 +845,31 @@ write_revision_zero(svn_fs_t *fs,
> svn_fs_x__revision_file_t *rev_file;
> const char *l2p_proto_index, *p2l_proto_index;
>
> - /* Write a skeleton r0 with no indexes. */
> - SVN_ERR(svn_io_file_create_binary
> - (path_revision_zero,
> - "DELTA\nSVN\1" /* txdelta v1 */
> - "\0\0\4\2\5" /* sview offset, sview len,
> - tview len, instr len, newlen */
> - "\1\x84" /* 1 instr byte, new 4 bytes */
> - "\4END\n" /* 4 new bytes, E, N, D, \n */
> - "ENDREP\n"
> - "id: 2+0\n"
> - "node: 0+0\n"
> - "copy: 0+0\n"
o> - "type: dir\n"
> - "count: 0\n"
> - "text: 0 3 16 4 "
> - "2d2977d1c96f487abe4a1e202dd03b4e\n"
> - "cpath: /\n"
> - "\n\n",
> - 0x87, subpool));
> + /* Construct a skeleton r0 with no indexes. */
> + svn_string_t *noderev_str = svn_string_create("id: 2+0\n"
> + "node: 0+0\n"
> + "copy: 0+0\n"
> + "type: dir\n"
> + "count: 0\n"
> + "cpath: /\n"
> + "\n",
> + subpool);
> + svn_string_t *changes_str = svn_string_create("\n",
> + subpool);
> + svn_string_t *r0 = svn_string_createf(subpool, "%s%s",
> + noderev_str->data,
> + changes_str->data);
> +
> + /* Write skeleton r0 to disk. */
> + SVN_ERR(svn_io_file_create(path_revision_zero, r0->data, subpool));
Received on 2015-01-06 15:27:22 CET

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