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

Re: svn commit: r27832 - trunk/subversion/svndumpfilter

From: David Glasser <glasser_at_davidglasser.net>
Date: 2007-11-15 21:20:40 CET

On Nov 15, 2007 12:17 PM, <dlr@tigris.org> wrote:
> Author: dlr
> Date: Thu Nov 15 12:17:16 2007
> New Revision: 27832
>
> Log:
> Encapsulate path-skipping logic.
>
> * subversion/svndumpfilter/main.c
> (skip_path): Add new routine which encapsulates boolean
> path-skipping test.
> (new_node_record, renumber_merge_source_rev_range): Leverage skip_path().
>
> Patch by: Senthil Kumaran S <senthil@collab.net>
> me
>
>
> Modified:
> trunk/subversion/svndumpfilter/main.c
>
> Modified: trunk/subversion/svndumpfilter/main.c
> URL: http://svn.collab.net/viewvc/svn/trunk/subversion/svndumpfilter/main.c?pathrev=27832&r1=27831&r2=27832
> ==============================================================================
> --- trunk/subversion/svndumpfilter/main.c (original)
> +++ trunk/subversion/svndumpfilter/main.c Thu Nov 15 12:17:16 2007
> @@ -120,6 +120,16 @@
> }
>
>
> +/* Check whether we need to skip this PATH based on its presence in
> + the PREFIXES list, and the DO_EXCLUDE option. */
> +static APR_INLINE svn_boolean_t
> +skip_path(const char *path, apr_array_header_t *prefixes,
> + svn_boolean_t do_exclude)
> +{
> + return (ary_prefix_match(prefixes, path) ? do_exclude : !do_exclude);
> +}
> +
> +
>
> /* Note: the input stream parser calls us with events.
> Output of the filtered dump occurs for the most part streamily with the
> @@ -456,8 +466,7 @@
> copyfrom_path = svn_path_join("/", copyfrom_path, pool);
>
> /* Shame, shame, shame ... this is NXOR. */

Move this comment to the new function or delete it, I think.

> - nb->do_skip = (ary_prefix_match(pb->prefixes, node_path)
> - ? pb->do_exclude : (! pb->do_exclude));
> + nb->do_skip = skip_path(node_path, pb->prefixes, pb->do_exclude);
>
> /* If we're skipping the node, take note of path, discarding the
> rest. */
> @@ -476,8 +485,7 @@
>
> /* Test if this node was copied from dropped source. */
> if (copyfrom_path &&
> - (ary_prefix_match(pb->prefixes, copyfrom_path)
> - ? pb->do_exclude : (! pb->do_exclude)))
> + skip_path(copyfrom_path, pb->prefixes, pb->do_exclude))
> {
> /* This node was copied from dropped source.
> We have a problem, since we did not want to drop this node too.
> @@ -650,7 +658,7 @@
> apr_hash_this(hi, &merge_source, NULL, &rangelist);
>
> /* Look whether the merge_source is a part of the included prefix. */
> - if (!ary_prefix_match(rb->pb->prefixes, merge_source))
> + if (skip_path(merge_source, rb->pb->prefixes, rb->pb->do_exclude))
> {
> if (rb->pb->skip_missing_merge_sources)
> continue;
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: svn-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: svn-help@subversion.tigris.org
>
>

--dave

-- 
David Glasser | glasser_at_davidglasser.net | http://www.davidglasser.net/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu Nov 15 21:20:55 2007

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