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

RE: Combine and rename WC APIs that check WC root and switched

From: Bert Huijben <bert_at_qqmail.nl>
Date: Tue, 4 Dec 2012 22:36:30 +0000

Note that we also have _get_wcroot functions since 1.7, which also have
the formerly known as ‘_strictly_’ behavior

. I think we should lose the strictly part of the name and make it easy to
detect switched paths (e.g. via the check api). Many callers accidentally
chose the wrong behavior in the past and this new api makes them choose
their behavior.

(The inherited property branch even broke the documented behavior ‘as

I think the svn_wc__db_is_wcroot function should stay, as it is the only
variant that guarantees no db transaction is used to obtain the result.
(Its result is usually a hashtable lookup)

Sent from Windows Mail

 *From:* Bert Huijben <bert_at_qqmail.nl>
*Sent:* December 4, 2012 11:28 PM
*To:* Subversion Development <dev_at_subversion.apache.org>,Julian Foad <
*Subject:* RE: Combine and rename WC APIs that check WC root and switched

1 is new and should be the new public api (feel free to change it to a
better name and make 3 match it). 2 is the internal api from before the
introduction of 1 and 3.

4 is the old ill-defined public api and 5 the better defined variant. I
would make these new functions just check for ‘wcroot’, not’strictly’ as
that is just a pointer to the ill-definedness which should be gone now.

The wcroot is now just the root of the working copy, and not also every
switched subdir too as it used to be with the old apis.


Sent from Windows Mail

 *From:* Julian Foad <julianfoad_at_btopenworld.com>
*Sent:* December 4, 2012 11:11 PM
*To:* Subversion Development <dev_at_subversion.apache.org>
*Subject:* Re: Combine and rename WC APIs that check WC root and switched

I (Julian Foad) wrote:

> These six APIs all overlap in functionality:
> 1) svn_wc_check_root(*is_wcroot,*is_switched,*kind,...)
> 2 uses in 2 files
> 2) svn_wc__check_wc_root(*wc_root,*kind,*switched,...)
> 5 uses in 4 files
> 3) svn_wc__db_is_switched(*is_wcroot,*is_switched,*kind,...)
> 5 uses in 4 files
> 4) svn_wc_is_wc_root2(*wc_root,...)
> 1 use in 1 file (deprecated.c)
> 5) svn_wc__strictly_is_wc_root(*wc_root,...)
> 5 uses in 5 files
> 6) svn_wc__db_is_wcroot(*is_root,...)
> 15 uses in 6 files
> The first three are functionally identical AFAICT. The duplication adds
> to the WC internal API as a whole. The first to go is
> ... gone, r1417181+r1417184.
> Now, (1) is a simple wrapper around (3) and (5) is a simple wrapper
around (6).
> Such pairs should have matching names. (1) is public so can't change, so
> I'll rename (3) to match it:

Actually (1) is new for v1.8 so we *can* change it if we want.

> (3) -> 'svn_wc__db_check_root'
> and (5) is named 'strictly' to distinguish it from (4), so I'll
> leave it alone and rename (6) to match it:
> (6) -> 'svn_wc__db_strictly_is_wc_root'.
> That should help reduce the obfuscation a tiny bit.

- Julian
Received on 2012-12-04 23:37:03 CET

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.