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

RE: svn commit: r1024187 - /subversion/trunk/subversion/libsvn_wc/wc_db.c

From: Bert Huijben <bert_at_qqmail.nl>
Date: Tue, 19 Oct 2010 13:06:17 +0200

> -----Original Message-----
> From: philip_at_apache.org [mailto:philip_at_apache.org]
> Sent: dinsdag 19 oktober 2010 11:33
> To: commits_at_subversion.apache.org
> Subject: svn commit: r1024187 -
> /subversion/trunk/subversion/libsvn_wc/wc_db.c
>
> Author: philip
> Date: Tue Oct 19 09:33:06 2010
> New Revision: 1024187
>
> URL: http://svn.apache.org/viewvc?rev=1024187&view=rev
> Log:
> * subversion/libsvn_wc/wc_db.c
> (svn_wc__db_op_read_tree_conflict): Get a pdh and use it to avoid
> ascending outside the working copy root.
>
> Modified:
> subversion/trunk/subversion/libsvn_wc/wc_db.c
>
> Modified: subversion/trunk/subversion/libsvn_wc/wc_db.c
> URL:
> http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_d
> b.c?rev=1024187&r1=1024186&r2=1024187&view=diff
> =======================================================================
> =======
> --- subversion/trunk/subversion/libsvn_wc/wc_db.c (original)
> +++ subversion/trunk/subversion/libsvn_wc/wc_db.c Tue Oct 19 09:33:06
> 2010
> @@ -3920,31 +3920,34 @@ svn_wc__db_op_read_tree_conflict(
> apr_pool_t *result_pool,
> apr_pool_t *scratch_pool)
> {
> - const char *parent_abspath;
> - apr_hash_t *tree_conflicts;
> - svn_error_t *err;
> + svn_wc__db_pdh_t *pdh;
> + const char *local_relpath, *child_path;
>
> SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
> - parent_abspath = svn_dirent_dirname(local_abspath, scratch_pool);
>
> - err = svn_wc__db_op_read_all_tree_conflicts(&tree_conflicts, db,
> - parent_abspath,
> - result_pool,
> scratch_pool);
> - if (err && SVN_WC__ERR_IS_NOT_CURRENT_WC(err))
> + SVN_ERR(svn_wc__db_pdh_parse_local_abspath(&pdh, &local_relpath, db,
> + local_abspath,
> svn_sqlite__mode_readonly,
> + scratch_pool, scratch_pool));
> +
> + child_path = svn_dirent_skip_ancestor(pdh->wcroot->abspath,
> local_abspath);
> + if (child_path != local_abspath && child_path[0])

if (*local_relpath != '\0') gives you the same result.

> {
> - /* We walked off the top of a working copy. */
> - svn_error_clear(err);
> - *tree_conflict = NULL;
> - return SVN_NO_ERROR;
> - }
> - else if (err)
> - return svn_error_return(err);
> + const char * parent_abspath;
> + apr_hash_t *tree_conflicts;
>
> - if (tree_conflicts)
> - *tree_conflict = apr_hash_get(tree_conflicts,
> - svn_dirent_basename(local_abspath,
> - scratch_pool),
> - APR_HASH_KEY_STRING);
> + parent_abspath = svn_dirent_dirname(local_abspath,
> scratch_pool);
> +
> + SVN_ERR(svn_wc__db_op_read_all_tree_conflicts(&tree_conflicts,
> db,
> + parent_abspath,
> + result_pool,
> scratch_pool));
> + if (tree_conflicts)
> + *tree_conflict = apr_hash_get(tree_conflicts,
> +
> svn_dirent_basename(local_abspath,
> +
> scratch_pool),
> + APR_HASH_KEY_STRING);

You can pass NULL to svn_dirent_basename() here, which will just return a pointer into local_abspath.

        Bert
Received on 2010-10-19 13:07:05 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.