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

Re: svn commit: r32298 - branches/issue-2843-dev/subversion/libsvn_wc

From: Karl Fogel <kfogel_at_red-bean.com>
Date: Thu, 28 Aug 2008 12:04:31 -0400

"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

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.