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

Re: svn commit: r28740 - in branches/reintegrate/subversion/libsvn_fs_base: . notes util

From: David Glasser <glasser_at_davidglasser.net>
Date: Thu, 3 Jan 2008 17:24:01 -0500

On Jan 3, 2008 4:23 PM, <cmpilato_at_tigris.org> wrote:
> Author: cmpilato
> Date: Thu Jan 3 13:23:31 2008
> New Revision: 28740
>
> Log:
> On the 'reintegrate' branch, add has_mergeinfo and mergeinfo_count
> fields to libsvn_fs_base's node_revision_t structure, and BDB-level
> support for storing those values.

Yay!

> Modified: branches/reintegrate/subversion/libsvn_fs_base/notes/structure
> URL: http://svn.collab.net/viewvc/svn/branches/reintegrate/subversion/libsvn_fs_base/notes/structure?pathrev=28740&r1=28739&r2=28740
> ==============================================================================
> --- branches/reintegrate/subversion/libsvn_fs_base/notes/structure (original)
> +++ branches/reintegrate/subversion/libsvn_fs_base/notes/structure Thu Jan 3 13:23:31 2008
> @@ -926,15 +926,20 @@
>
> NODE-REVISION ::= FILE | DIR ;
> FILE ::= (HEADER PROP-KEY DATA-KEY [EDIT-DATA-KEY]) ;
> - DIR ::= (HEADER PROP-KEY ENTRIES-KEY) ;
> -
> - HEADER ::= (KIND CREATED-PATH [PRED-ID [PRED-COUNT]]) ;
> + DIR ::= (HEADER PROP-KEY ENTRIES-KEY) ;
> + HEADER ::= (KIND CREATED-PATH
> + [PRED-ID [PRED-COUNT
> + [HAS-MERGEINFO MERGEINFO-COUNT]]]) ;
> KIND ::= "file" | "dir" ;
> - PRED-ID ::= NODE-REV-ID ;
> - PRED-COUNT ::= number ;
> + PRED-ID ::= NODE-REV-ID | "";
> + PRED-COUNT ::= number | "" ;
> CREATED-PATH ::= atom ;
> PROP-KEY ::= atom ;
> - REP-KEY ::= atom ;
> + DATA-KEY ::= atom ;
> + EDIT-DATA-KEY ::= atom ;
> + MERGEINFO ::= (HAS-MERGEINFO MERGEINFO-COUNT) ;

Do you ever use this MERGEINFO element?

> + HAS-MERGEINFO ::= "0" | "1" ;
> + MERGEINFO-COUNT ::= number ;
>
>
> Representations:

> @@ -603,7 +605,7 @@
> apr_pool_t *pool)
> {
> node_revision_t *noderev;
> - skel_t *header_skel;
> + skel_t *header_skel, *cur_skel;
>
> /* Validate the skel. */
> if (! is_valid_node_revision_skel(skel))
> @@ -627,17 +629,35 @@
> /* PREDECESSOR-ID */
> if (header_skel->children->next->next)
> {
> - noderev->predecessor_id
> - = svn_fs_base__id_parse(header_skel->children->next->next->data,
> - header_skel->children->next->next->len, pool);
> + cur_skel = header_skel->children->next->next;
> + if (cur_skel->len)
> + noderev->predecessor_id = svn_fs_base__id_parse(cur_skel->data,
> + cur_skel->len, pool);
>
> /* PREDECESSOR-COUNT */
> noderev->predecessor_count = -1;
> - if (header_skel->children->next->next->next)
> - noderev->predecessor_count =
> - atoi(apr_pstrmemdup(pool,
> - header_skel->children->next->next->next->data,
> - header_skel->children->next->next->next->len));
> + if (cur_skel->next)
> + {
> + cur_skel = cur_skel->next;
> + if (cur_skel->len)
> + noderev->predecessor_count = atoi(apr_pstrmemdup(pool,
> + cur_skel->data,
> + cur_skel->len));
> +
> + /* HAS-MERGEINFO and MERGEINFO-COUNT */
> + if (cur_skel->next)
> + {
> + cur_skel = cur_skel->next;
> + noderev->has_mergeinfo = atoi(apr_pstrmemdup(pool,
> + cur_skel->data,
> + cur_skel->len))
> + ? TRUE : FALSE;
> + noderev->mergeinfo_count =
> + apr_atoi64(apr_pstrmemdup(pool,
> + cur_skel->next->data,
> + cur_skel->next->len));

While this is admittedly following the pattern set by the other
elements, I don't see why you'd need to duplicate a string that is
immediately converted to a number.

--dave

-- 
David Glasser | glasser@davidglasser.net | http://www.davidglasser.net/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: dev-help_at_subversion.tigris.org
Received on 2008-01-04 00:42:48 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.