Author: rhuijben
Date: Tue Feb 24 13:19:40 2015
New Revision: 1661934
URL: http://svn.apache.org/r1661934
Log:
Make 'svn copy WC URL' provide some sane paths in the generated commit
message. Without this patch you would just see '.' copied a few times.
* subversion/svn/util.c
(svn_cl__make_log_msg_baton): Keep base dir NULL if not provided.
(svn_cl__get_log_message): Simplify path calculations.
Ensure valid path on call to svn_cmdline__edit_string_externally.
Modified:
subversion/trunk/subversion/svn/util.c
Modified: subversion/trunk/subversion/svn/util.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/svn/util.c?rev=1661934&r1=1661933&r2=1661934&view=diff
==============================================================================
--- subversion/trunk/subversion/svn/util.c (original)
+++ subversion/trunk/subversion/svn/util.c Tue Feb 24 13:19:40 2015
@@ -240,7 +240,7 @@ svn_cl__make_log_msg_baton(void **baton,
else
lmb->message_encoding = NULL;
- lmb->base_dir = base_dir ? base_dir : "";
+ lmb->base_dir = base_dir;
lmb->tmpfile_left = NULL;
lmb->config = config;
lmb->keep_locks = opt_state->no_unlock;
@@ -392,14 +392,11 @@ svn_cl__get_log_message(const char **log
if (! path)
path = item->url;
- else if (! *path)
- path = ".";
-
- if (! svn_path_is_url(path) && lmb->base_dir)
+ else if (lmb->base_dir)
path = svn_dirent_is_child(lmb->base_dir, path, pool);
/* If still no path, then just use current directory. */
- if (! path)
+ if (! path || !*path)
path = ".";
if ((item->state_flags & SVN_CLIENT_COMMIT_ITEM_DELETE)
@@ -438,7 +435,8 @@ svn_cl__get_log_message(const char **log
if (! lmb->non_interactive)
{
err = svn_cmdline__edit_string_externally(&msg_string,
&lmb->tmpfile_left,
- lmb->editor_cmd,
lmb->base_dir,
+ lmb->editor_cmd,
+ lmb->base_dir ?
lmb->base_dir : "",
msg_string, "svn-commit",
lmb->config, TRUE,
lmb->message_encoding,