[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: Philip Martin <philip.martin_at_wandisco.com>
Date: Tue, 19 Oct 2010 12:43:22 +0100

"Bert Huijben" <bert_at_qqmail.nl> writes:

>> - 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.

Ah, yes.

>
>> {
>> - /* 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.

That's not my code, but yes. A quick grep suggests there are several
places this could be done.

-- 
Philip
Received on 2010-10-19 13:44:06 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.