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

RE: svn commit: r920424 - in /subversion/trunk/subversion: include/private/svn_wc_private.h libsvn_wc/lock.c libsvn_wc/util.c libsvn_wc/wc.h

From: Bert Huijben <bert_at_vmoo.com>
Date: Wed, 2 Jun 2010 23:38:41 +0200

> -----Original Message-----
> From: Paul Burba [mailto:ptburba_at_gmail.com]
> Sent: woensdag 2 juni 2010 20:47
> To: dev_at_subversion.apache.org; commits_at_subversion.apache.org
> Subject: Re: svn commit: r920424 - in /subversion/trunk/subversion:
> include/private/svn_wc_private.h libsvn_wc/lock.c libsvn_wc/util.c
> libsvn_wc/wc.h
>
> On Mon, Mar 8, 2010 at 2:05 PM, <philip_at_apache.org> wrote:
> > Author: philip
> > Date: Mon Mar 8 18:05:19 2010
> > New Revision: 920424
> >
> > URL: http://svn.apache.org/viewvc?rev=920424&view=rev
> > Log:
> > Remove some svn_wc_entry_t using code.
> >
> > * subversion/include/private/svn_wc_private.h
> > (svn_wc__path_switched): Remove SVN_ERR_ENTRY_MISSING_URL from
> doc
> > string, the caller wasn't taking advantage of it.
> > (svn_wc__adm_open_anchor_in_context): Delete.
> >
> > * subversion/libsvn_wc/wc.h
> > (svn_wc__internal_path_switched): Delete.
> >
> > * subversion/libsvn_wc/util.c
> > (svn_wc__internal_path_switched): Delete.
> > (svn_wc__path_switched): Move to lock.c.
> >
> > * subversion/libsvn_wc/lock.c
> > (child_is_disjoint): Check for SVN_ERR_WC_NOT_DIRECTORY.
> > (svn_wc__adm_open_anchor_in_context): Delete.
> > (svn_wc__path_switched): Copied from util.c, just call child_is_disjoint.
>
> Hi Philip,
>
> This implies that a disjoint child is equivalent to a switched child, but despite
> child_is_disjoint's lack of documentation, it seems clear that a child can be
> disjoint but not switched. Am I missing something here?

Disjoint is also true for subdirectories that are a working copy of their own. The requirement is that the directory is recorded as subdirectory in the parent directory. (The url can be switched, from a completely different repository.. or just like that of a normal child, but unconnected).
(With access batons you also have the case that the access baton for a directory is just not open, so you can't step inside)

I don't think the current wc_db public api allows to differentiate between connected children and children obstructed by a different working copy. The entry based api can, via the stubs handling. (Just walking the children will just show the node from the child working copy; obstructing access to the information in the parent).

I think we need a new wc_db api to help detecting this case. (It should check the current_relpath from the pdh search operation. If it is "" then it should check if the node is connected to the parent directory or not. This way, once we move to a single db per working copy, we only perform this check for roots)

        Bert
>
> Paul
>
> > Modified:
> > subversion/trunk/subversion/include/private/svn_wc_private.h
> > subversion/trunk/subversion/libsvn_wc/lock.c
> > subversion/trunk/subversion/libsvn_wc/util.c
> > subversion/trunk/subversion/libsvn_wc/wc.h
> >
> > Modified: subversion/trunk/subversion/include/private/svn_wc_private.h
> > URL:
> > http://svn.apache.org/viewvc/subversion/trunk/subversion/include/priva
> > te/svn_wc_private.h?rev=920424&r1=920423&r2=920424&view=diff
> >
> ==========================================================
> ============
> > ========
> > --- subversion/trunk/subversion/include/private/svn_wc_private.h
> > (original)
> > +++ subversion/trunk/subversion/include/private/svn_wc_private.h Mon
> > +++ Mar 8 18:05:19 2010
> > @@ -77,9 +77,7 @@
> >
> > /** Given a @a local_abspath with a @a wc_ctx, set @a *switched to
> > * TRUE if @a local_abspath is switched, otherwise set @a *switched to
> FALSE.
> > - * If neither @a local_abspath or its parent have valid URLs, return
> > - * @c SVN_ERR_ENTRY_MISSING_URL. All temporaryallocations are done
> > in
> > - * @a scratch_pool.
> > + * All temporary allocations are done in * @a scratch_pool.
> > */
> > svn_error_t *
> > svn_wc__path_switched(svn_boolean_t *switched, @@ -250,22 +248,6
> @@
> > void *cancel_baton,
> > apr_pool_t *pool);
> >
> > -/** Like svn_wc_adm_open_anchor(), but with a svn_wc_context_t * to
> > use
> > - * when opening the access batons.
> > - *
> > - * NOT FOR NEW DEVELOPMENT! (See note to
> > svn_wc__adm_open_in_context().)
> > - */
> > -svn_error_t *
> > -svn_wc__adm_open_anchor_in_context(svn_wc_adm_access_t
> > **anchor_access,
> > - svn_wc_adm_access_t
> > **target_access,
> > - const char **target,
> > - svn_wc_context_t *wc_ctx,
> > - const char *path,
> > - svn_boolean_t write_lock,
> > - int levels_to_lock,
> > - svn_cancel_func_t cancel_func,
> > - void *cancel_baton,
> > - apr_pool_t *pool);
> >
> >
> > /**
> >
> > Modified: subversion/trunk/subversion/libsvn_wc/lock.c
> > URL:
> > http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/loc
> > k.c?rev=920424&r1=920423&r2=920424&view=diff
> >
> ==========================================================
> ============
> > ========
> > --- subversion/trunk/subversion/libsvn_wc/lock.c (original)
> > +++ subversion/trunk/subversion/libsvn_wc/lock.c Mon Mar 8 18:05:19
> > +++ 2010
> > @@ -1045,7 +1045,7 @@
> > err = svn_wc__db_read_children(&children, db, parent_abspath,
> > scratch_pool,
> > scratch_pool);
> >
> > - if (err && err->apr_err == SVN_ERR_WC_PATH_NOT_FOUND)
> > + if (err && err->apr_err == SVN_ERR_WC_NOT_DIRECTORY)
> > {
> > svn_error_clear(err);
> > *disjoint = TRUE;
> > @@ -1329,23 +1329,6 @@
> > cancel_baton, pool));
> > }
> >
> > -svn_error_t *
> > -svn_wc__adm_open_anchor_in_context(svn_wc_adm_access_t
> > **anchor_access,
> > - svn_wc_adm_access_t
> > **target_access,
> > - const char **target,
> > - svn_wc_context_t *wc_ctx,
> > - const char *path,
> > - svn_boolean_t write_lock,
> > - int levels_to_lock,
> > - svn_cancel_func_t cancel_func,
> > - void *cancel_baton,
> > - apr_pool_t *pool) -{
> > - return svn_error_return(open_anchor(anchor_access, target_access,
> > target,
> > - wc_ctx->db, TRUE, path,
> > write_lock,
> > - levels_to_lock, cancel_func,
> > - cancel_baton, pool)); -}
> >
> > svn_error_t *
> > svn_wc__adm_retrieve_from_context(svn_wc_adm_access_t
> **adm_access,
> > @@ -1881,3 +1864,15 @@
> > err2 = svn_wc__release_write_lock(wc_ctx, local_abspath,
> > scratch_pool);
> > return svn_error_compose_create(err1, err2);
> > }
> > +
> > +svn_error_t *
> > +svn_wc__path_switched(svn_boolean_t *switched,
> > + svn_wc_context_t *wc_ctx,
> > + const char *local_abspath,
> > + apr_pool_t *scratch_pool) {
> > + return svn_error_return(child_is_disjoint(switched, wc_ctx->db,
> > + local_abspath,
> > +scratch_pool)); }
> > +
> > +
> >
> > Modified: subversion/trunk/subversion/libsvn_wc/util.c
> > URL:
> > http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/uti
> > l.c?rev=920424&r1=920423&r2=920424&view=diff
> >
> ==========================================================
> ============
> > ========
> > --- subversion/trunk/subversion/libsvn_wc/util.c (original)
> > +++ subversion/trunk/subversion/libsvn_wc/util.c Mon Mar 8 18:05:19
> > +++ 2010
> > @@ -247,78 +247,6 @@
> > return svn_cstring_match_glob_list(str, list);
> > }
> >
> > -svn_error_t *
> > -svn_wc__internal_path_switched(svn_boolean_t *switched,
> > - svn_wc__db_t *db,
> > - const char *local_abspath,
> > - apr_pool_t *scratch_pool) -{
> > - const char *parent_abspath;
> > - const char *parent_child_url;
> > - const svn_wc_entry_t *parent_entry;
> > - const svn_wc_entry_t *entry;
> > - svn_error_t *err;
> > -
> > - SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
> > -
> > - if (svn_dirent_is_root(local_abspath, strlen(local_abspath)))
> > - {
> > - *switched = FALSE;
> > - return SVN_NO_ERROR;
> > - }
> > -
> > - SVN_ERR(svn_wc__get_entry(&entry, db, local_abspath, FALSE,
> > svn_node_unknown,
> > - FALSE, scratch_pool, scratch_pool));
> > -
> > - parent_abspath = svn_dirent_dirname(local_abspath, scratch_pool);
> > - err = svn_wc__get_entry(&parent_entry, db, parent_abspath, FALSE,
> > - svn_node_dir, FALSE, scratch_pool,
> > scratch_pool);
> > -
> > - if (err && (err->apr_err == SVN_ERR_WC_NOT_WORKING_COPY
> > - || err->apr_err == SVN_ERR_WC_MISSING))
> > - {
> > - svn_error_clear(err);
> > - *switched = FALSE;
> > - return SVN_NO_ERROR;
> > - }
> > - else if (err)
> > - return err;
> > -
> > - /* Without complete entries (and URLs) for WC_PATH and it's parent
> > - we return SVN_ERR_ENTRY_MISSING_URL. */
> > - if (!parent_entry->url || !entry->url)
> > - {
> > - const char *no_url_path = parent_entry->url ?
> > - local_abspath : parent_abspath;
> > - return svn_error_createf(SVN_ERR_ENTRY_MISSING_URL, NULL,
> > - _("Cannot find a URL for '%s'"),
> > - svn_dirent_local_style(no_url_path,
> > - scratch_pool));
> > - }
> > -
> > - parent_child_url
> > - = svn_path_url_add_component2(parent_entry->url,
> > - svn_dirent_basename(local_abspath,
> > - scratch_pool),
> > - scratch_pool);
> > - *switched = strcmp(parent_child_url, entry->url) != 0;
> > -
> > - return SVN_NO_ERROR;
> > -}
> > -
> > -
> > -svn_error_t *
> > -svn_wc__path_switched(svn_boolean_t *switched,
> > - svn_wc_context_t *wc_ctx,
> > - const char *local_abspath,
> > - apr_pool_t *scratch_pool) -{
> > - return svn_error_return(svn_wc__internal_path_switched(switched,
> > wc_ctx->db,
> > -
> > local_abspath,
> > -
> > scratch_pool)); -}
> > -
> > -
> > svn_wc_conflict_description2_t *
> > svn_wc_conflict_description_create_text2(const char *local_abspath,
> > apr_pool_t *result_pool)
> >
> > Modified: subversion/trunk/subversion/libsvn_wc/wc.h
> > URL:
> >
> http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc.
> > h?rev=920424&r1=920423&r2=920424&view=diff
> >
> ==========================================================
> ============
> > ========
> > --- subversion/trunk/subversion/libsvn_wc/wc.h (original)
> > +++ subversion/trunk/subversion/libsvn_wc/wc.h Mon Mar 8 18:05:19
> > +++ 2010
> > @@ -400,14 +400,6 @@
> > svn_wc__db_t *db,
> > apr_pool_t *pool);
> >
> > -/* Similar to svn_wc__path_switched(), but with a wc_db parameter
> > instead of
> > - * a wc_context. */
> > -svn_error_t *
> > -svn_wc__internal_path_switched(svn_boolean_t *switched,
> > - svn_wc__db_t *wc_db,
> > - const char *local_abspath,
> > - apr_pool_t *scratch_pool);
> > -
> >
> > /* Similar to svn_wc_conflicted_p3(), but with a wc_db parameter in
> > place of
> > * a wc_context. */
> >
> >
> >
Received on 2010-06-02 23:40:13 CEST

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