Skip to main content

svn_path_condense_targets

Function svn_path_condense_targets 

Source
pub unsafe extern "C" fn svn_path_condense_targets(
    pcommon: *mut *const c_char,
    pcondensed_targets: *mut *mut apr_array_header_t,
    targets: *const apr_array_header_t,
    remove_redundancies: svn_boolean_t,
    pool: *mut apr_pool_t,
) -> *mut svn_error_t
Expand description

Find the common prefix of the canonicalized paths in @a targets (an array of const char *’s), and remove redundant paths if @a remove_redundancies is TRUE.

  • Set @a *pcommon to the absolute path of the path or URL common to all of the targets. If the targets have no common prefix, or are a mix of URLs and local paths, set @a *pcommon to the empty string.

  • If @a pcondensed_targets is non-NULL, set @a *pcondensed_targets to an array of targets relative to @a *pcommon, and if @a remove_redundancies is TRUE, omit any paths/URLs that are descendants of another path/URL in @a targets. If *pcommon is empty, @a *pcondensed_targets will contain full URLs and/or absolute paths; redundancies can still be removed (from both URLs and paths). If @a pcondensed_targets is NULL, leave it alone.

Else if there is exactly one target, then

  • Set @a *pcommon to that target, and

  • If @a pcondensed_targets is non-NULL, set @a *pcondensed_targets to an array containing zero elements. Else if @a pcondensed_targets is NULL, leave it alone.

If there are no items in @a targets, set @a *pcommon and (if applicable) @a *pcondensed_targets to @c NULL.

@note There is no guarantee that @a *pcommon is within a working copy.

@deprecated Provided for backward compatibility with the 1.6 API. New code should use svn_dirent_condense_targets() or svn_uri_condense_targets().