You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2012/05/10 19:23:35 UTC
svn commit: r1336801 - in /subversion/trunk/subversion/svn: cl.h
conflict-callbacks.c main.c
Author: stsp
Date: Thu May 10 17:23:35 2012
New Revision: 1336801
URL: http://svn.apache.org/viewvc?rev=1336801&view=rev
Log:
Allow the conflict resolution callback to show paths relative to the current
working directory by storing a path prefix in svn_cl__conflict_baton_t.
Based on r1205931 which made a similar change on the moves-scan-log branch.
But not a merge of that revision as it contains other unrelated changes.
* subversion/svn/cl.h
(svn_cl__conflict_baton_t): Add path_prefix, to allow showing relative
paths in the conflict callback.
(svn_cl__conflict_baton_make): Tweak declaration (see below).
* subversion/svn/main.c
(main): Follow signature change of svn_cl__conflict_baton_make().
* subversion/svn/conflict-callbacks.c
(svn_cl__conflict_baton_make): Return svn_error_t *, add output argument
for the created baton.
Modified:
subversion/trunk/subversion/svn/cl.h
subversion/trunk/subversion/svn/conflict-callbacks.c
subversion/trunk/subversion/svn/main.c
Modified: subversion/trunk/subversion/svn/cl.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svn/cl.h?rev=1336801&r1=1336800&r2=1336801&view=diff
==============================================================================
--- subversion/trunk/subversion/svn/cl.h (original)
+++ subversion/trunk/subversion/svn/cl.h Thu May 10 17:23:35 2012
@@ -333,13 +333,15 @@ typedef struct svn_cl__conflict_baton_t
const char *editor_cmd;
svn_boolean_t external_failed;
svn_cmdline_prompt_baton_t *pb;
+ const char *path_prefix;
} svn_cl__conflict_baton_t;
-/* Create and return a conflict baton, allocated from POOL, with the values
- ACCEPT_WHICH, CONFIG, EDITOR_CMD and PB placed in the same-named fields
- of the baton, and its 'external_failed' field initialised to FALSE. */
-svn_cl__conflict_baton_t *
-svn_cl__conflict_baton_make(svn_cl__accept_t accept_which,
+/* Create and return a conflict baton in *B, allocated from POOL, with the
+ * values ACCEPT_WHICH, CONFIG, EDITOR_CMD and PB placed in the same-named
+ * fields of the baton, and its 'external_failed' field initialised to FALSE. */
+svn_error_t *
+svn_cl__conflict_baton_make(svn_cl__conflict_baton_t **b,
+ svn_cl__accept_t accept_which,
apr_hash_t *config,
const char *editor_cmd,
svn_cmdline_prompt_baton_t *pb,
Modified: subversion/trunk/subversion/svn/conflict-callbacks.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svn/conflict-callbacks.c?rev=1336801&r1=1336800&r2=1336801&view=diff
==============================================================================
--- subversion/trunk/subversion/svn/conflict-callbacks.c (original)
+++ subversion/trunk/subversion/svn/conflict-callbacks.c Thu May 10 17:23:35 2012
@@ -41,20 +41,22 @@
-svn_cl__conflict_baton_t *
-svn_cl__conflict_baton_make(svn_cl__accept_t accept_which,
+svn_error_t *
+svn_cl__conflict_baton_make(svn_cl__conflict_baton_t **b,
+ svn_cl__accept_t accept_which,
apr_hash_t *config,
const char *editor_cmd,
svn_cmdline_prompt_baton_t *pb,
apr_pool_t *pool)
{
- svn_cl__conflict_baton_t *b = apr_palloc(pool, sizeof(*b));
- b->accept_which = accept_which;
- b->config = config;
- b->editor_cmd = editor_cmd;
- b->external_failed = FALSE;
- b->pb = pb;
- return b;
+ *b = apr_palloc(pool, sizeof(**b));
+ (*b)->accept_which = accept_which;
+ (*b)->config = config;
+ (*b)->editor_cmd = editor_cmd;
+ (*b)->external_failed = FALSE;
+ (*b)->pb = pb;
+ SVN_ERR(svn_dirent_get_absolute(&(*b)->path_prefix, "", pool));
+ return SVN_NO_ERROR;
}
svn_cl__accept_t
Modified: subversion/trunk/subversion/svn/main.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svn/main.c?rev=1336801&r1=1336800&r2=1336801&view=diff
==============================================================================
--- subversion/trunk/subversion/svn/main.c (original)
+++ subversion/trunk/subversion/svn/main.c Thu May 10 17:23:35 2012
@@ -2704,12 +2704,12 @@ main(int argc, const char *argv[])
ctx->conflict_func = NULL;
ctx->conflict_baton = NULL;
ctx->conflict_func2 = svn_cl__conflict_handler;
- ctx->conflict_baton2 = svn_cl__conflict_baton_make(
- opt_state.accept_which,
- ctx->config,
- opt_state.editor_cmd,
- pb,
- pool);
+ SVN_ERR(svn_cl__conflict_baton_make(&ctx->conflict_baton2,
+ opt_state.accept_which,
+ ctx->config,
+ opt_state.editor_cmd,
+ pb,
+ pool));
}
/* And now we finally run the subcommand. */