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 2016/03/23 12:38:03 UTC
svn commit: r1736308 - /subversion/trunk/subversion/libsvn_client/conflicts.c
Author: stsp
Date: Wed Mar 23 11:38:03 2016
New Revision: 1736308
URL: http://svn.apache.org/viewvc?rev=1736308&view=rev
Log:
Display locals path in conflict descriptions relative to the working copy's
root directory, rather than as absolute paths.
* subversion/svn/conflict-callbacks.c
(describe_local_change): Get the working copy root path and show paths
contained within the working copy as relative to the root, where applicable.
Modified:
subversion/trunk/subversion/libsvn_client/conflicts.c
Modified: subversion/trunk/subversion/libsvn_client/conflicts.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/conflicts.c?rev=1736308&r1=1736307&r2=1736308&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/conflicts.c (original)
+++ subversion/trunk/subversion/libsvn_client/conflicts.c Wed Mar 23 11:38:03 2016
@@ -317,12 +317,24 @@ describe_local_change(const char **descr
"conflict was recorded.");
}
else
- *description = apr_psprintf(
- result_pool,
- _("The file in the working copy was "
- "moved away to\n'%s'."),
- svn_dirent_local_style(moved_to_abspath,
- scratch_pool));
+ {
+ const char *wcroot_abspath;
+
+ SVN_ERR(svn_wc__get_wcroot(&wcroot_abspath,
+ conflict->ctx->wc_ctx,
+ conflict->local_abspath,
+ scratch_pool,
+ scratch_pool));
+ *description = apr_psprintf(
+ result_pool,
+ _("The file in the working copy was "
+ "moved away to\n'%s'."),
+ svn_dirent_local_style(
+ svn_dirent_skip_ancestor(
+ wcroot_abspath,
+ moved_to_abspath),
+ scratch_pool));
+ }
}
else if (operation == svn_wc_operation_merge)
{
@@ -339,12 +351,22 @@ describe_local_change(const char **descr
else
{
/* This is a local move in the working copy. */
+ const char *wcroot_abspath;
+
+ SVN_ERR(svn_wc__get_wcroot(&wcroot_abspath,
+ conflict->ctx->wc_ctx,
+ conflict->local_abspath,
+ scratch_pool,
+ scratch_pool));
*description = apr_psprintf(
result_pool,
_("The file in the working copy was "
"moved away to\n'%s'."),
svn_dirent_local_style(
- moved_to_abspath, scratch_pool));
+ svn_dirent_skip_ancestor(
+ wcroot_abspath,
+ moved_to_abspath),
+ scratch_pool));
}
}
break;
@@ -369,12 +391,24 @@ describe_local_change(const char **descr
"conflict was recorded.");
}
else
- *description = apr_psprintf(
- result_pool,
- _("A file was moved here in the working "
- "copy from\n'%s'."),
- svn_dirent_local_style(
- moved_from_abspath, scratch_pool));
+ {
+ const char *wcroot_abspath;
+
+ SVN_ERR(svn_wc__get_wcroot(&wcroot_abspath,
+ conflict->ctx->wc_ctx,
+ conflict->local_abspath,
+ scratch_pool,
+ scratch_pool));
+ *description = apr_psprintf(
+ result_pool,
+ _("A file was moved here in the "
+ "working copy from\n'%s'."),
+ svn_dirent_local_style(
+ svn_dirent_skip_ancestor(
+ wcroot_abspath,
+ moved_from_abspath),
+ scratch_pool));
+ }
}
else if (operation == svn_wc_operation_merge)
{
@@ -390,13 +424,23 @@ describe_local_change(const char **descr
}
else
{
+ const char *wcroot_abspath;
+
+ SVN_ERR(svn_wc__get_wcroot(&wcroot_abspath,
+ conflict->ctx->wc_ctx,
+ conflict->local_abspath,
+ scratch_pool,
+ scratch_pool));
/* This is a local move in the working copy. */
*description = apr_psprintf(
result_pool,
_("A file was moved here in the "
"working copy from\n'%s'."),
svn_dirent_local_style(
- moved_from_abspath, scratch_pool));
+ svn_dirent_skip_ancestor(
+ wcroot_abspath,
+ moved_from_abspath),
+ scratch_pool));
}
}
break;
@@ -472,12 +516,24 @@ describe_local_change(const char **descr
"this conflict was recorded.");
}
else
- *description = apr_psprintf(
- result_pool,
- _("The directory in the working copy "
- "was moved away to\n'%s'."),
- svn_dirent_local_style(moved_to_abspath,
- scratch_pool));
+ {
+ const char *wcroot_abspath;
+
+ SVN_ERR(svn_wc__get_wcroot(&wcroot_abspath,
+ conflict->ctx->wc_ctx,
+ conflict->local_abspath,
+ scratch_pool,
+ scratch_pool));
+ *description = apr_psprintf(
+ result_pool,
+ _("The directory in the working copy "
+ "was moved away to\n'%s'."),
+ svn_dirent_local_style(
+ svn_dirent_skip_ancestor(
+ wcroot_abspath,
+ moved_to_abspath),
+ scratch_pool));
+ }
}
else if (operation == svn_wc_operation_merge)
{
@@ -494,12 +550,22 @@ describe_local_change(const char **descr
else
{
/* This is a local move in the working copy. */
+ const char *wcroot_abspath;
+
+ SVN_ERR(svn_wc__get_wcroot(&wcroot_abspath,
+ conflict->ctx->wc_ctx,
+ conflict->local_abspath,
+ scratch_pool,
+ scratch_pool));
*description = apr_psprintf(
result_pool,
_("The directory was moved away to\n"
"'%s'."),
svn_dirent_local_style(
- moved_to_abspath, scratch_pool));
+ svn_dirent_skip_ancestor(
+ wcroot_abspath,
+ moved_to_abspath),
+ scratch_pool));
}
}
}
@@ -524,12 +590,24 @@ describe_local_change(const char **descr
"recorded.");
}
else
- *description = apr_psprintf(
- result_pool,
- _("A directory was moved here from\n"
- "'%s'."),
- svn_dirent_local_style(
- moved_from_abspath, scratch_pool));
+ {
+ const char *wcroot_abspath;
+
+ SVN_ERR(svn_wc__get_wcroot(&wcroot_abspath,
+ conflict->ctx->wc_ctx,
+ conflict->local_abspath,
+ scratch_pool,
+ scratch_pool));
+ *description = apr_psprintf(
+ result_pool,
+ _("A directory was moved here from\n"
+ "'%s'."),
+ svn_dirent_local_style(
+ svn_dirent_skip_ancestor(
+ wcroot_abspath,
+ moved_from_abspath),
+ scratch_pool));
+ }
}
else if (operation == svn_wc_operation_merge)
{
@@ -546,12 +624,22 @@ describe_local_change(const char **descr
else
{
/* This is a local move in the working copy. */
+ const char *wcroot_abspath;
+
+ SVN_ERR(svn_wc__get_wcroot(&wcroot_abspath,
+ conflict->ctx->wc_ctx,
+ conflict->local_abspath,
+ scratch_pool,
+ scratch_pool));
*description = apr_psprintf(
result_pool,
_("A directory was moved here in "
"the working copy from\n'%s'."),
svn_dirent_local_style(
- moved_from_abspath, scratch_pool));
+ svn_dirent_skip_ancestor(
+ wcroot_abspath,
+ moved_from_abspath),
+ scratch_pool));
}
}
}