"Rui, Guo" <timmyguo_at_mail.ustc.edu.cn> writes:
>> When I first read the comment at the top...
>>
>> "/* This simulates the logic of svn_wc_is_wc_root(). */"
>>
>> ...I thought that you must be about to test whether the path is a wc
>> root because a wc root cannot be excluded (right?). But it turns out
>> you're simulating the logic of svn_wc_is_wc_root() just to find out
>> whether the path is switched (because if it is switched, then we cannot
>> exclude it -- a switched directory behaves "like" a wc root in this
>> way).
>>
>> So would it be simpler to just use svn_wc__path_switched()? This is its
>> doc string, from include/private/svn_wc_private.h:
>>
>> /** Given a @a wcpath with its accompanying @a entry, set @a
>> * switched to true if @a wcpath is switched, otherwise set @a
>> * switched to false. If @a entry is an incomplete entry obtained
>> * from @a wcpath's parent return @c SVN_ERR_ENTRY_MISSING_URL.
>> * All allocations are done in @a pool.
>> *
>> * @since New in 1.5.
>> */
>> svn_error_t *
>> svn_wc__path_switched(const char *wcpath,
>> svn_boolean_t *switched,
>> const svn_wc_entry_t *entry,
>> apr_pool_t *pool);
>
> Thanks for pointing this out for me. I just did not aware of this function.
> But even if I call svn_wc__path_switched() instead, I have to prepare
> parent_entry for later use. So it does not save many code, right?
Sure. I just wanted to point it out; use your judgement on what will
produce the best code.
>> > + /* Mark the target as excluded, if the parent requires it by
>> > + default. */
>> > + if (parent_entry && entry_in_repos
>> > + && (parent_entry->depth > svn_depth_files))
>> > {
>>
>> Should it be
>>
>> (parent_entry->depth >= svn_depth_files)
>>
>> ? (Or do we already know for sure that target is a directory?)
>
> We just do not setup an exclude flag if the parent only requires files, since
> directories is excluded by default.
Might be good to add that to the comment, then.
Best,
-Karl
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: dev-help_at_subversion.tigris.org
Received on 2008-08-28 18:04:44 CEST