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

Re: svndumpfilter matches by node path string containment rather than by node path directory containment

From: Daniel Shahaf <d.s_at_daniel.shahaf.co.il>
Date: Sat, 21 Jun 2008 12:02:03 +0300 (Jerusalem Daylight Time)

Daniel Shahaf wrote on Fri, 20 Jun 2008 at 20:49 +0300:
> Matthew Carter wrote on Fri, 20 Jun 2008 at 00:19 -0400:
> > When I ask svndumpfilter to remove just the "Foo" node, both the "Foo" and the
> > "FooBar.txt" nodes are removed.
> >
>
> That's bad.
>
> > Do you agree that this is a problem? Shall I file an issue for this in the
> > subversion issue tracker?
> >
>
> Does this (completely untested) patch fix the problem?
>

It does for me, and passes svnadmin_tests and svndumpfilter_tests. (I
didn't see svndumpfilter used anywhere else in the tests.)

Committed revision r31831.

Thanks!

Daniel

> Index: subversion/svndumpfilter/main.c
> ===================================================================
> --- subversion/svndumpfilter/main.c (revision 31823)
> +++ subversion/svndumpfilter/main.c (working copy)
> @@ -115,7 +115,8 @@ ary_prefix_match(apr_array_header_t *pfxlist, cons
> pfx_len = strlen(pfx);
> if (path_len < pfx_len)
> continue;
> - if (strncmp(path, pfx, pfx_len) == 0)
> + if (strncmp(path, pfx, pfx_len) == 0
> + && (path[pfx_len] == '\0' || path[pfx_len] == '/'))
> return TRUE;
> }
>
> > Thank you.
> >
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: dev-help_at_subversion.tigris.org
Received on 2008-06-21 11:02:21 CEST

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