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

absolute paths in svn_wc_notify_t

From: Tom Naughton <naughtont_at_gmail.com>
Date: Wed, 15 Oct 2008 14:42:25 -0700

I have an application that uses version 1.5.2 of the client library APIs.
I've set up the notify_func2 in my svn_client_ctx_t to point to a callback.

Before 1.5, I relied on 'path' in svn_wc_notify_t to point to an absolute
path. Now for commit operations (and only commit operations), I'm getting
partial paths that have had some prefix removed. Is there some way to
determine what this prefix will be or even better, opt to receive absolute
paths instead? According to the comments in svn_wc.h this path is "either
absolute or relative to the current working directory". But I haven't found
that to be the case. In some cases the prefix that is removed is just "/".

Stepping through the subversion code I've been able to derive an algorithm
for determining the prefix that will be removed:

    // Determine prefix stripped from the commit notify messages
    const char *display_dir = "";
    const char *base_dir = nil;
    svn_depth_t depth = svn_depth_infinity;
    apr_array_header_t *rel_targets;
    err = svn_path_condense_targets(&base_dir, &rel_targets, commit_targets,
depth == svn_depth_infinity, pool);
    err = svn_path_get_absolute(&display_dir,display_dir, pool);
    display_dir = svn_path_get_longest_ancestor(display_dir, base_dir,

If the current directory is something like "/Objects/Debug" and all of the
paths in commit_targets are outside of /Objects,
svn_path_get_longest_ancestor returns "/", and that's what I'm seeing in my
unit tests.

Is there a better way to figure out this prefix?

Received on 2008-10-16 05:56:13 CEST

This is an archived mail posted to the Subversion Dev mailing list.