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

Re: [PATCH] v3 Fix #3390 Relative externals not updated during switch

From: Philip Martin <philip.martin_at_wandisco.com>
Date: Mon, 21 Dec 2009 14:40:46 +0000

Daniel Näslund <daniel_at_longitudo.com> writes:

> + /* First try to get the associated url and if there is none as is the case
> + * for exports then do use the user supplied values. */
> + err = svn_wc__node_get_url(&url, cb->ctx->wc_ctx,
> + abs_parent_dir, cb->pool, cb->pool);
> +
> + /* We want to check for just SVN_ERR_WC_PATH_NOT_FOUND here but since not
> + * all callers use absolute paths at the moment we get assertions about
> + * that, which we must catch. */
> + if (err)

It would be better to check explicitly for PATH_NOT_FOUND and whatever
the error the assertion gives. Even better would be to fix the
callers so that the assertions don't happen. The problem with your
current code is that it's hiding problems, it means that we have to
remember this code and come back and fix it.

> + {
> + /* Get the URL of the parent directory by appending a portion of
> + parent_dir to from_url. from_url is the URL for to_path and
> + to_path is a substring of parent_dir, so append any characters in
> + parent_dir past strlen(to_path) to from_url (making sure to move
> + past a '/' in parent_dir, otherwise svn_path_url_add_component()
> + will error. */
> + len = strlen(cb->to_path);
> + if (ib.parent_dir[len] == '/')
> + ++len;
> + ib.parent_dir_url = svn_path_url_add_component2(cb->from_url,
> + ib.parent_dir + len,
> + cb->pool);
> + svn_error_clear(err);
> + }
> + else
> + {
> + ib.parent_dir_url = url;
> + }
> +
> /* We must use a custom version of svn_hash_diff so that the diff
> entries are processed in the order they were originally specified
> in the svn:externals properties. */

-- 
Philip
Received on 2009-12-21 15:41:26 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.