You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by rh...@apache.org on 2012/07/26 16:40:50 UTC
svn commit: r1366021 - in /subversion/trunk/subversion:
bindings/javahl/src/org/apache/subversion/javahl/ClientNotifyInformation.java
include/svn_wc.h libsvn_client/externals.c svn/notify.c
Author: rhuijben
Date: Thu Jul 26 14:40:50 2012
New Revision: 1366021
URL: http://svn.apache.org/viewvc?rev=1366021&view=rev
Log:
Make it more explicit when removing externals leaves files because they were
locally modified by adding a notification.
* subversion/bindings/javahl/src/org/apache/subversion/javahl/ClientNotifyInformation.java
(Action): Add notification. Split comment to help
tooltips in IDEs.
* subversion/include/svn_wc.h
(svn_wc_notify_action_t): Add notification. Split comment on to help
tooltips in IDEs.
* subversion/libsvn_client/externals.c
(relegate_dir_external): Notify when leaving local changes.
(switch_dir_external): Update caller.
(handle_external_item_removal): Notify when leaving local changes.
* subversion/svn/notify.c
(notify): Provide notification.
Modified:
subversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/ClientNotifyInformation.java
subversion/trunk/subversion/include/svn_wc.h
subversion/trunk/subversion/libsvn_client/externals.c
subversion/trunk/subversion/svn/notify.c
Modified: subversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/ClientNotifyInformation.java
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/ClientNotifyInformation.java?rev=1366021&r1=1366020&r2=1366021&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/ClientNotifyInformation.java (original)
+++ subversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/ClientNotifyInformation.java Thu Jul 26 14:40:50 2012
@@ -552,9 +552,14 @@ public class ClientNotifyInformation ext
/** Operation failed because a node is obstructed */
failed_obstructed ("failed by obstruction"),
- /** Conflict resolver is starting/ending. */
+ /** Conflict resolver is starting. */
conflict_resolver_starting ("conflict resolver starting"),
- conflict_resolver_done ("conflict resolver done");
+
+ /** Conflict resolver is done. */
+ conflict_resolver_done ("conflict resolver done"),
+
+ /** Operation left local modifications. */
+ left_local_modifications ("left local modifications);
/**
* The description of the action.
Modified: subversion/trunk/subversion/include/svn_wc.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_wc.h?rev=1366021&r1=1366020&r2=1366021&view=diff
==============================================================================
--- subversion/trunk/subversion/include/svn_wc.h (original)
+++ subversion/trunk/subversion/include/svn_wc.h Thu Jul 26 14:40:50 2012
@@ -1229,12 +1229,22 @@ typedef enum svn_wc_notify_action_t
* @since New in 1.8. */
svn_wc_notify_failed_obstruction,
- /** Conflict resolver is starting or done.
+ /** Conflict resolver is starting.
* This can be used by clients to detect when to display conflict summary
* information, for example.
* @since New in 1.8. */
svn_wc_notify_conflict_resolver_starting,
- svn_wc_notify_conflict_resolver_done
+
+ /** Conflict resolver is done.
+ * This can be used by clients to detect when to display conflict summary
+ * information, for example.
+ * @since New in 1.8. */
+ svn_wc_notify_conflict_resolver_done,
+
+ /** The current operation left local changes of something that was deleted
+ * The changes are available on (and below) the notified path
+ * @since New in 1.8. */
+ svn_wc_notify_left_local_modifications
} svn_wc_notify_action_t;
Modified: subversion/trunk/subversion/libsvn_client/externals.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/externals.c?rev=1366021&r1=1366020&r2=1366021&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/externals.c (original)
+++ subversion/trunk/subversion/libsvn_client/externals.c Thu Jul 26 14:40:50 2012
@@ -59,6 +59,8 @@ relegate_dir_external(svn_wc_context_t *
const char *local_abspath,
svn_cancel_func_t cancel_func,
void *cancel_baton,
+ svn_wc_notify_func2_t notify_func,
+ void *notify_baton,
apr_pool_t *scratch_pool)
{
svn_error_t *err = SVN_NO_ERROR;
@@ -121,6 +123,18 @@ relegate_dir_external(svn_wc_context_t *
}
/* ### TODO: We should notify the user about the rename */
+ if (notify_func)
+ {
+ svn_wc_notify_t *notify;
+
+ notify = svn_wc_create_notify(err ? local_abspath : new_path,
+ svn_wc_notify_left_local_modifications,
+ scratch_pool);
+ notify->kind = svn_node_dir;
+ notify->err = err;
+
+ notify_func(notify_baton, notify, scratch_pool);
+ }
}
return svn_error_trace(err);
@@ -266,6 +280,7 @@ switch_dir_external(const char *local_ab
SVN_ERR(relegate_dir_external(ctx->wc_ctx, defining_abspath,
local_abspath,
ctx->cancel_func, ctx->cancel_baton,
+ ctx->notify_func2, ctx->notify_baton2,
pool));
}
else
@@ -560,6 +575,17 @@ handle_external_item_removal(const svn_c
notify->err = err;
(ctx->notify_func2)(ctx->notify_baton2, notify, scratch_pool);
+
+ if (err && err->apr_err == SVN_ERR_WC_LEFT_LOCAL_MOD)
+ {
+ notify = svn_wc_create_notify(local_abspath,
+ svn_wc_notify_left_local_modifications,
+ scratch_pool);
+ notify->kind = svn_node_dir;
+ notify->err = err;
+
+ (ctx->notify_func2)(ctx->notify_baton2, notify, scratch_pool);
+ }
}
if (err && err->apr_err == SVN_ERR_WC_LEFT_LOCAL_MOD)
Modified: subversion/trunk/subversion/svn/notify.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svn/notify.c?rev=1366021&r1=1366020&r2=1366021&view=diff
==============================================================================
--- subversion/trunk/subversion/svn/notify.c (original)
+++ subversion/trunk/subversion/svn/notify.c Thu Jul 26 14:40:50 2012
@@ -214,6 +214,12 @@ notify(void *baton, const svn_wc_notify_
}
break;
+ case svn_wc_notify_left_local_modifications:
+ if ((err = svn_cmdline_printf(pool, "Left local modifications as '%s'\n",
+ path_local)))
+ goto print_error;
+ break;
+
case svn_wc_notify_update_replace:
nb->received_some_change = TRUE;
if ((err = svn_cmdline_printf(pool, "R %s\n", path_local)))