"Bert Huijben" <b...@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

Reply via email to