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

Re: [PATCH] Fix issue 3026: .svn and _svn silently ignored

From: C. Michael Pilato <cmpilato_at_collab.net>
Date: 2007-11-24 19:04:45 CET

Augie Fackler wrote:
>
> On Nov 20, 2007, at 1:31 PM, Augie Fackler wrote:
>> On Nov 20, 2007, at 2:17 PM, Karl Fogel wrote:
>>> Augie Fackler <durin42@gmail.com> writes:
>>>> [[[
>>>> Fix issue 3026.
>>>>
>>>> * subversion/libsvn_subr/opt.c:
>>>> (svn_opt_args_to_target_array2): Print a message to the user when
>>>> we ignore a name that's reserved for WC administrative space.
>>>> ]]]
>>>
>>> Whoa -- can't have library functions printing things to stderr or
>>> stdout (unless doing so is part of the function's job and is so
>>> described in its documentation). Functions return 'svn_error_t *' for
>>> a reason :-). So this fix isn't going to be *quite* as simple as
>>> this...
>>
>> I thought it seemed too easy - I'll fix this shortly.
>
> I'm not sure what to do now. In working on this, I just noticed in the
> doxygen for svn_opt_args_to_target_array2 (svn_opt.h):
>
> * On each URL target, do some IRI-to-URI encoding and some
> * auto-escaping. On each local path, canonicalize case and path
> * separators, and silently skip it if it has the same name as a
> * Subversion working copy administrative directory.
>
> Does that mean I should make a new svn_opt_args_to_target_array3
> function that returns an error chain for administrative directories? It
> looks pretty invasive just within Subversion's codebase to change this
> behavior. If I do that, would it be a reasonable implementation of
> svn_opt_args_to_target_array2 that just called s_o_a_t_a3 and dropped
> any admin-directory errors before returning? That's my inclination at
> the moment.

About an svn_opt_args_to_target_array3 that returns two array's, one full of
inputs that matched admin directory names, and one full of inputs that
didn't. That way if the caller wants to warn about admin dirs he's
skipping, he can do:

   for (i = 0; i < admin_targets->nelts; i++)
     {
       target = APR_ARRAY_IDX(admin_targets, i, const char *);
       do_admin_warning(target, ...);
     }
   for (i = 0; i < real_targets->nelts; i++)
     {
       target = APR_ARRAY_IDX(real_targets, i, const char *);
       do_something(target, ...);
     }

If the caller *doesn't* want to warn, he doesn't have to.

In fact, maybe the API could be such that if you passed NULL for the
admin_targets parameter, the o-a-t-t-a3 wouldn't do the splitting/filtering,
for callers that don't want to treat admin directories specially.

I dunno ... just some ideas.

-- 
C. Michael Pilato <cmpilato@collab.net>
CollabNet   <>   www.collab.net   <>   Distributed Development On Demand

Received on Sat Nov 24 19:05:13 2007

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.