Index: subversion/include/svn_wc.h =================================================================== --- subversion/include/svn_wc.h (revision 31177) +++ subversion/include/svn_wc.h (working copy) @@ -909,6 +909,11 @@ * left and right sides of the merge are from the same URL. In all * other cases, it is @c NULL. @since New in 1.5 */ svn_merge_range_t *merge_range; + /** If non-NULL, specifies an absolute path prefix that can be subtracted + * from the start of the absolute path in @c path. Its purpose is to + * allow notification to remove a common prefix from all the paths + * displayed for an operation. @since New in 1.6 */ + const char *path_prefix; /* NOTE: Add new fields at the end to preserve binary compatibility. Also, if you add fields here, you have to update svn_wc_create_notify and svn_wc_dup_notify. */ Index: subversion/libsvn_wc/util.c =================================================================== --- subversion/libsvn_wc/util.c (revision 31177) +++ subversion/libsvn_wc/util.c (working copy) @@ -128,6 +128,7 @@ ret->revision = SVN_INVALID_REVNUM; ret->changelist_name = NULL; ret->merge_range = NULL; + ret->path_prefix = NULL; return ret; } @@ -164,6 +165,8 @@ ret->changelist_name = apr_pstrdup(pool, ret->changelist_name); if (ret->merge_range) ret->merge_range = svn_merge_range_dup(ret->merge_range, pool); + if (ret->path_prefix) + ret->path_prefix = apr_pstrdup(pool, ret->path_prefix); return ret; } Index: subversion/libsvn_client/client.h =================================================================== --- subversion/libsvn_client/client.h (revision 31177) +++ subversion/libsvn_client/client.h (working copy) @@ -915,9 +915,8 @@ CTX->NOTIFY_FUNC/CTX->BATON will be called as the commit progresses, as a way of describing actions to the application layer (if non NULL). - NOTIFY_PATH_PREFIX is used to send shorter, relative paths to the - notify_func (it's a prefix that will be subtracted from the front - of the paths.) + NOTIFY_PATH_PREFIX will be passed to CTX->notify_func2() as the + common absolute path prefix of the committed paths. It can be NULL. If the caller wants to keep track of any outstanding temporary files left after the transmission of text and property mods, Index: subversion/libsvn_client/commit_util.c =================================================================== --- subversion/libsvn_client/commit_util.c (revision 31177) +++ subversion/libsvn_client/commit_util.c (working copy) @@ -1056,7 +1056,8 @@ void *edit_baton; /* commit editor's baton */ apr_hash_t *file_mods; /* hash: path->file_mod_t */ apr_hash_t *tempfiles; /* hash of tempfiles created */ - const char *notify_path_prefix; /* notification path prefix */ + const char *notify_path_prefix; /* notification path prefix + (NULL is okay, else abs path) */ svn_client_ctx_t *ctx; /* client context baton */ apr_hash_t *commit_items; /* the committables */ }; @@ -1080,7 +1081,6 @@ svn_wc_adm_access_t *adm_access = cb_baton->adm_access; const svn_delta_editor_t *editor = cb_baton->editor; apr_hash_t *file_mods = cb_baton->file_mods; - const char *notify_path_prefix = cb_baton->notify_path_prefix; svn_client_ctx_t *ctx = cb_baton->ctx; /* Do some initializations. */ @@ -1121,20 +1121,9 @@ describe what we're about to do to this item. */ if (ctx->notify_func2) { - /* Convert an absolute path into a relative one (if possible.) */ - const char *npath = NULL; + const char *npath = item->path; svn_wc_notify_t *notify; - if (notify_path_prefix) - { - if (strcmp(notify_path_prefix, item->path)) - npath = svn_path_is_child(notify_path_prefix, item->path, pool); - else - npath = "."; - } - if (! npath) - npath = item->path; /* Otherwise just use full path */ - if ((item->state_flags & SVN_CLIENT_COMMIT_ITEM_DELETE) && (item->state_flags & SVN_CLIENT_COMMIT_ITEM_ADD)) { @@ -1183,6 +1172,7 @@ if (notify) { notify->kind = item->kind; + notify->path_prefix = cb_baton->notify_path_prefix; (*ctx->notify_func2)(ctx->notify_baton2, notify, pool); } } @@ -1434,22 +1424,11 @@ if (ctx->notify_func2) { svn_wc_notify_t *notify; - const char *npath = NULL; - - if (notify_path_prefix) - { - if (strcmp(notify_path_prefix, item->path) != 0) - npath = svn_path_is_child(notify_path_prefix, item->path, - subpool); - else - npath = "."; - } - if (! npath) - npath = item->path; - notify = svn_wc_create_notify(npath, + notify = svn_wc_create_notify(item->path, svn_wc_notify_commit_postfix_txdelta, subpool); notify->kind = svn_node_file; + notify->path_prefix = notify_path_prefix; (*ctx->notify_func2)(ctx->notify_baton2, notify, subpool); } Index: subversion/svn/notify.c =================================================================== --- subversion/svn/notify.c (revision 31177) +++ subversion/svn/notify.c (working copy) @@ -55,13 +55,23 @@ { struct notify_baton *nb = baton; char statchar_buf[5] = " "; - const char *path_local; + const char *path_local = n->path; svn_error_t *err; + + if (n->path_prefix) + { + path_local = svn_path_is_child(n->path_prefix, path_local, pool); + + if (!path_local) + { + if (!strcmp(n->path, n->path_prefix)) + path_local = "."; + else + path_local = n->path; + } + } - if (svn_path_is_url(n->path)) - path_local = n->path; - else - path_local = svn_path_local_style(n->path, pool); + path_local = svn_path_local_style(path_local, pool); switch (n->action) {