Index: subversion/include/svn_wc.h =================================================================== --- subversion/include/svn_wc.h (revision 31025) +++ subversion/include/svn_wc.h (working copy) @@ -903,12 +903,16 @@ * In all other cases, it is @c SVN_INVALID_REVNUM. */ svn_revnum_t revision; /** When @c action is @c svn_wc_notify_changelist_add or name. In all other - * cases, it is @c NULL. */ + * cases, it is @c NULL. @since New in 1.5 */ const char *changelist_name; /** When @c action is @c svn_wc_notify_merge_begin, and both the - left and right sides of the merge are from the same URL. In all - other cases, it is @c NULL. */ + * 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 to print paths without a + * common prefix. @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 31025) +++ 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 31025) +++ subversion/libsvn_client/client.h (working copy) @@ -915,9 +915,9 @@ 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 the notification handler to + print shorter paths (it's a prefix that will be subtracted from the + front of absolute paths.) 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 31025) +++ subversion/libsvn_client/commit_util.c (working copy) @@ -1080,7 +1080,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 +1120,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 +1171,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 +1423,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/libsvn_client/commit.c =================================================================== --- subversion/libsvn_client/commit.c (revision 31025) +++ subversion/libsvn_client/commit.c (working copy) @@ -1368,7 +1368,8 @@ svn_error_t *cmt_err = SVN_NO_ERROR, *unlock_err = SVN_NO_ERROR; svn_error_t *bump_err = SVN_NO_ERROR, *cleanup_err = SVN_NO_ERROR; svn_boolean_t commit_in_progress = FALSE; - const char *display_dir = ""; + const char *current_dir = ""; + const char *notify_prefix; int i; /* Committing URLs doesn't make sense, so error if it's tried. */ @@ -1694,16 +1695,17 @@ /* Make a note that we have a commit-in-progress. */ commit_in_progress = TRUE; - /* Determine prefix to strip from the commit notify messages */ - if ((cmt_err = svn_path_get_absolute(&display_dir, - display_dir, pool))) + if ((cmt_err = svn_path_get_absolute(¤t_dir, + current_dir, pool))) goto cleanup; - display_dir = svn_path_get_longest_ancestor(display_dir, base_dir, pool); + /* Determine prefix to strip from the commit notify messages */ + notify_prefix = svn_path_get_longest_ancestor(current_dir, base_dir, pool); + /* Perform the commit. */ cmt_err = svn_client__do_commit(base_url, commit_items, base_dir_access, editor, edit_baton, - display_dir, + notify_prefix, &tempfiles, &digests, ctx, pool); /* Handle a successful commit. */ Index: subversion/svn/notify.c =================================================================== --- subversion/svn/notify.c (revision 31025) +++ subversion/svn/notify.c (working copy) @@ -55,13 +55,21 @@ { 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) + { + if (strcmp(n->path->prefix, path_local)) + path_local = svn_path_is_child(n->path_prefix, path_local, pool); + else + path_local = "."; + + if (!path_local) + path_local = n->path; /* if path is not below path_prefix */ + } - 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) {