This is a preview of an upcoming commit.
Background: it turned out that external module checkouts and updates
were incompatible with our "trace editor" notification system.
However, we'd been planning to get rid of that system anyway, and
switch to using notification callbacks (see issue #662), so this just
gave us a motivation to do it early.
The patch to do that changeover is mostly done. I'm posting it here
for review. It's not ready for commit yet -- it compiles, but doesn't
run (segfault, just started debugging). This review request isn't for
help with the segfault, though -- that's just a matter of debugging.
It's more for general design review. The change is getting quite
large, and I'm sure there are things that could be done better.
One of the themes you'll see is that code & logic from
subversion/clients/cmdline/trace-update.c, which is being obsoleted,
gets moved into feedback.c, which contains the new notification
system. Now, there was already a notification system in feedback.c,
but it was only used for a few specific circumstances; now its getting
extended to handle more kinds of notifications. So there are sort of
two code merges going on here: the old notification system is being
extended, and some (but not all) of the extension code is coming from
trace-update.c.
Thanks in advance for eyeballs,
-Karl
--------------------8-<-------cut-here---------8-<-----------------------
Remove before_editor/before_edit_baton, after_editor/after_edit_baton
from most interfaces; use notify_func and notify_baton instead.
This addresses most of issue #662, except that the svn_client_merge
interface hasn't been changed, because that would propagate down into
the diff editors -- which is fine, but it can be done separately, and
we don't need it right now for modules (issue #517).
###############################################
### NOTE ###
### Incomplete change! Don't try to use ###
### this patch, expect lossage if you do. ###
### ###
###############################################
* Throughout the code: rename svn_wc_notify_state `text_state'
variables to `content_state', so they can eventually reflect changes
to directory contents as well as file contents.
* subversion/clients/cmdline/feedback.c
(notify): Replaces update_notify. This will be the One True
notification function.
(struct notify_baton, struct update_notify_baton): Merged into just
`struct notify_baton'.
(svn_cl__notify_func): Removed, code moved to notify.
(svn_cl__get_checkout_notifier): Initialize the sent_first_txdelta
field in the baton.
(svn_cl__make_notify_baton): Removed.
(svn_cl__get_notifier): Replaces svn_cl__get_checkout_notifier.
(notify_commit_postfix_txdelta): Removed...
* subversion/clients/cmdline/cl.h
(SVN_CL_NOTIFY, svn_cl__notify_func, svn_cl__make_notify_baton,
svn_cl__get_trace_commit_editor): Removed.
(svn_cl__get_trace_update_editor): Mark as obsolete
(svn_cl__get_notifier): Replaces svn_cl__get_checkout_notifier.
* subversion/clients/cmdline/trace-update.c: Not removed, because
merge-cmd.c still needs it. When that changes over to the new
notification system, this file can finally go away.
* subversion/clients/cmdline/trace-commit.c: Left for reference, but
commented out to avoid warnings. When the changeover to the new
notification system is complete, this can finally go away.
* subversion/clients/cmdline/revert-cmd.c (svn_cl__revert):
* subversion/clients/cmdline/move-cmd.c (svn_cl__move):
* subversion/clients/cmdline/mkdir-cmd.c (svn_cl__mkdir):
* subversion/clients/cmdline/resolve-cmd.c (svn_cl__resolve):
* subversion/clients/cmdline/delete-cmd.c (svn_cl__delete):
* subversion/clients/cmdline/switch-cmd.c (svn_cl__switch):
* subversion/clients/cmdline/add-cmd.c (svn_cl__add):
* subversion/clients/cmdline/commit-cmd.c (svn_cl__commit):
* subversion/clients/cmdline/update-cmd.c (svn_cl__update):
* subversion/clients/cmdline/copy-cmd.c (svn_cl__copy):
* subversion/clients/cmdline/import-cmd.c (svn_cl__import):
Use the new notification system, remove all trace editors.
* subversion/clients/cmdline/merge-cmd.c
(svn_cl__merge): Don't use the new notification system, but do obey
the opt_state->quiet flag.
* subversion/bindings/ruby/client.c
(cl_commit): Binding not adjusted.
* subversion/include/svn_client.h: Consistify documentation of
notify_func througout this file.
(svn_client_commit, svn_client_switch, svn_client_copy): Don't take
before and after editors anymore.
(svn_client_import, svn_client_update): Same, and take new
parameters notify_func and notify_baton.
(svn_client_merge): Don't take after_editor and after_baton anymore,
take notify_func and notify_baton instead.
* subversion/libsvn_client/commit.c
(svn_client_commit): Same as header change.
(svn_client_import): Same as header change.
(import, import_dir, import_file): Take notify_func, notify_baton,
invoke them and pass them along in recursion. Update comments.
* subversion/libsvn_client/switch.c
(svn_client_switch): Same as header change.
* subversion/libsvn_client/update.c
(svn_client_update): Same as header change.
* subversion/libsvn_client/diff.c
(merge_cmd_baton): New notify_func and notify_baton fields.
(svn_client_merge): Same as header change. Store the new notify_func
and notify_baton in the merge_cmd_baton.
(do_single_file_merge): Take notify_func and notify_baton, instead
of trace_editor and trace_editor_baton.
* subversion/include/svn_wc.h
(svn_wc_get_update_editor, svn_wc_get_switch_editor): Take
notify_func and notify_baton. XXX can merge with .c file change?
(svn_wc_notify_state_t): Add svn_wc_notify_state_inapplicable.
* subversion/libsvn_wc/update_editor.c
(svn_wc_get_update_editor, svn_wc_get_switch_editor): Take
notify_func and notify_baton, pass them along to make_editor.
* subversion/libsvn_client/copy.c
(setup_copy): Don't take before and after editors. Pass notify_func
and notify_baton where formerly passed editors.
(wc_to_repos_copy, repos_to_wc_copy): Don't take before and after
editors, use notify_func and notify_baton instead.
(svn_client_move): Adjust call to setup_copy.
(svn_client_copy): Same as header change.
* subversion/libsvn_client/apply_edits.c: Removed. This file was
entirely unused. Go figure.
Index: ./subversion/include/svn_wc.h
===================================================================
--- ./subversion/include/svn_wc.h
+++ ./subversion/include/svn_wc.h Tue Jun 11 16:33:04 2002
@@ -85,8 +85,9 @@
typedef enum svn_wc_notify_state_t
{
- svn_wc_notify_state_unknown = 0, /* Notifier doesn't know or isn't saying. */
- svn_wc_notify_state_unchanged, /* This state did not change. */
+ svn_wc_notify_state_inapplicable = 0,
+ svn_wc_notify_state_unknown, /* Notifier doesn't know or isn't saying. */
+ svn_wc_notify_state_unchanged, /* The state did not change. */
svn_wc_notify_state_modified, /* Pristine state was modified. */
svn_wc_notify_state_merged, /* Modified state had mods merged in. */
svn_wc_notify_state_conflicted /* Modified state got conflicting mods. */
@@ -96,7 +97,7 @@
/* Notify the world that ACTION has happened to PATH. PATH is either
* absolute or relative to cwd (i.e., not relative to an anchor).
*
- * KIND, TEXT_STATE and PROP_STATE are from after ACTION, not before.
+ * KIND, CONTENT_STATE and PROP_STATE are from after ACTION, not before.
*
* REVISION is SVN_INVALID_REVNUM, except when when ACTION is
* svn_wc_notify_update_completed, in which case REVISION is the
@@ -109,7 +110,7 @@
*
* Design Notes:
*
- * The purpose of the KIND, TEXT_STATE, and PROP_STATE fields is to
+ * The purpose of the KIND, CONTENT_STATE, and PROP_STATE fields is to
* provide "for free" information that this function is likely to
* want, and which it would otherwise be forced to deduce via
* expensive operations such as reading entries and properties.
@@ -127,13 +128,13 @@
* on receiving a text change. Instead, wait until all changes have
* been received, and then invoke the notify func once (from within
* an svn_delta_editor_t's close_file(), for example), passing the
- * appropriate text_state and prop_state flags.
+ * appropriate content_state and prop_state flags.
*/
typedef void (*svn_wc_notify_func_t) (void *baton,
const char *path,
svn_wc_notify_action_t action,
svn_node_kind_t kind,
- svn_wc_notify_state_t text_state,
+ svn_wc_notify_state_t content_state,
svn_wc_notify_state_t prop_state,
svn_revnum_t revision);
@@ -755,6 +756,9 @@
* the root of our editor. TARGET is the entry in ANCHOR that will
* actually be updated, or NULL if all of ANCHOR should be updated.
*
+ * The editor invokes NOTIFY_FUNC with NOTIFY_BATON as the update
+ * progresses, if NOTIFY_FUNC is non-null.
+ *
* TARGET_REVISION is the repository revision that results from this set
* of changes.
*/
@@ -762,6 +766,8 @@
const char *target,
svn_revnum_t target_revision,
svn_boolean_t recurse,
+ svn_wc_notify_func_t notify_func,
+ void *notify_baton,
const svn_delta_editor_t **editor,
void **edit_baton,
svn_wc_traversal_info_t **ti_p,
@@ -780,8 +786,8 @@
* such a case and do as little damage as possible, but makes no
* promises.
*
- * Invoke NOTIFY_FUNC with NOTIFY_BATON as the checkout progresses, if
- * NOTIFY_FUNC is non-null.
+ * The editor invokes NOTIFY_FUNC with NOTIFY_BATON as the checkout
+ * progresses, if NOTIFY_FUNC is non-null.
*
* ANCESTOR_URL is the repository string to be recorded in this
* working copy.
@@ -814,6 +820,9 @@
* the root of our editor. TARGET is the entry in ANCHOR that will
* actually be updated, or NULL if all of ANCHOR should be updated.
*
+ * The editor invokes NOTIFY_FUNC with NOTIFY_BATON as the switch
+ * progresses, if NOTIFY_FUNC is non-null.
+ *
* TARGET_REVISION is the repository revision that results from this set
* of changes.
*/
@@ -822,6 +831,8 @@
svn_revnum_t target_revision,
const char *switch_url,
svn_boolean_t recurse,
+ svn_wc_notify_func_t notify_func,
+ void *notify_baton,
const svn_delta_editor_t **editor,
void **edit_baton,
svn_wc_traversal_info_t **ti_p,
@@ -885,9 +896,9 @@
props, not just 'regular' ones that the user sees. (See 'enum
svn_prop_kind').
- If TEXT_STATE is non-null, set *TEXT_STATE to the state of the
- file contents after the installation; if return error, the value
- of *TEXT_STATE is undefined.
+ If CONTENT_STATE is non-null, set *CONTENT_STATE to the state of
+ the file contents after the installation; if return error, the
+ value of *CONTENT_STATE is undefined.
If PROP_STATE is non-null, set *PROP_STATE to the state of the
properties after the installation; if return error, the value of
@@ -899,7 +910,7 @@
POOL is used for all bookkeeping work during the installation.
*/
-svn_error_t *svn_wc_install_file (svn_wc_notify_state_t *text_state,
+svn_error_t *svn_wc_install_file (svn_wc_notify_state_t *content_state,
svn_wc_notify_state_t *prop_state,
const char *file_path,
svn_revnum_t new_revision,
Index: ./subversion/include/svn_client.h
===================================================================
--- ./subversion/include/svn_client.h
+++ ./subversion/include/svn_client.h Tue Jun 11 18:48:59 2002
@@ -222,8 +222,8 @@
If REVISION does not meet these requirements, return the error
SVN_ERR_CLIENT_BAD_REVISION.
- Invoke NOTIFY_FUNC with NOTIFY_BATON as the checkout progresses, if
- NOTIFY_FUNC is non-null.
+ If NOTIFY_FUNC is non-null, invoke NOTIFY_FUNC with NOTIFY_BATON as
+ the checkout progresses.
If XML_SRC is non-NULL, it is an xml file to check out from; in
this case, the working copy will record the URL as artificial
@@ -254,25 +254,9 @@
If REVISION does not meet these requirements, return the error
SVN_ERR_CLIENT_BAD_REVISION.
- ### Begin temporary notification kluge. ###
-
- TODO: Soon, the before and after editors will go away,
- and the notify system will be used for everything.
- But for the moment, we're keeping the composition
- editors, to avoid dealing with possible output changes,
- and adding the notification callback for external items
- only.
-
If NOTIFY_FUNC is non-null, invoke NOTIFY_FUNC with NOTIFY_BATON
- on files restored from text-base. (Update does not yet handle
- external modules, but when it does, it will call this notifier for
- updates or checkouts of external items too.)
-
- BEFORE_EDITOR, BEFORE_EDIT_BATON and AFTER_EDITOR, AFTER_EDIT_BATON
- are pre- and post-update hook editors. They are optional; pass
- four NULLs if you don't need them.
-
- ### End temporary notification kluge. ###
+ for each item handled by the update, and also for files restored
+ from text-base.
If XML_SRC is non-NULL, it is an xml file to update from. If
REVISION is svn_client_revision_unspecified, then the revision
@@ -281,11 +265,7 @@
Use POOL for any temporary allocation. */
svn_error_t *
-svn_client_update (const svn_delta_editor_t *before_editor,
- void *before_edit_baton,
- const svn_delta_editor_t *after_editor,
- void *after_edit_baton,
- svn_client_auth_baton_t *auth_baton,
+svn_client_update (svn_client_auth_baton_t *auth_baton,
const char *path,
const char *xml_src,
const svn_client_revision_t *revision,
@@ -307,23 +287,14 @@
svn_client_revision_head, or svn_client_revision_date; otherwise,
return SVN_ERR_CLIENT_BAD_REVISION.
- During a switch, files may be restored from the text-base if they
- have been removed from the working copy. When this happens,
- NOTIFY_FUNC will be called with NOTIFY_BATON and the (relative)
- path of the file that has been restored. NOTIFY_FUNC may be NULL
- if this information is not required.
-
- BEFORE_EDITOR, BEFORE_EDIT_BATON and AFTER_EDITOR, AFTER_EDIT_BATON
- are pre- and post-switch hook editors. They are optional; pass
- four NULLs if you don't need them.
+ If NOTIFY_FUNC is non-null, invoke it with NOTIFY_BATON on paths
+ affected by the switch. Also invoke it for files may be restored
+ from the text-base because they were removed from the working
+ copy.
Use POOL for any temporary allocation. */
svn_error_t *
-svn_client_switch (const svn_delta_editor_t *before_editor,
- void *before_edit_baton,
- const svn_delta_editor_t *after_editor,
- void *after_edit_baton,
- svn_client_auth_baton_t *auth_baton,
+svn_client_switch (svn_client_auth_baton_t *auth_baton,
const char *path,
const char *url,
const svn_client_revision_t *revision,
@@ -338,9 +309,9 @@
not. If RECURSIVE is set, then assuming PATH is a directory, all
of its contents will be scheduled for addition as well.
- For each item which is added, NOTIFY_FUNC will be called with
- NOTIFY_BATON and the path of the added item. NOTIFY_FUNC may be
- NULL if this information is not required.
+ If NOTIFY_FUNC is non-null, then for each added item, call
+ NOTIFY_FUNC with NOTIFY_BATON and the path of the added
+ item.
Important: this is a *scheduling* operation. No changes will
happen to the repository until a commit occurs. This scheduling
@@ -365,11 +336,10 @@
function can use to query for a commit log message when one is
needed.
- When the directory has been created (successfully) in the working
- copy, NOTIFY_FUNC will be called with NOTIFY_BATON and the path of
- the new directory. If this information is not required, then
- NOTIFY_FUNC may be NULL. Note that this is only called for items
- added to the working copy.
+ If NOTIFY_FUNC is non-null, when the directory has been created
+ (successfully) in the working copy, call NOTIFY_FUNC with
+ NOTIFY_BATON and the path of the new directory. Note that this is
+ only called for items added to the working copy.
*/
svn_error_t *
svn_client_mkdir (svn_client_commit_info_t **commit_info,
@@ -401,9 +371,9 @@
function can use to query for a commit log message when one is
needed.
- For each item deleted, NOTIFY_FUNC will be called with NOTIFY_BATON
- and the path of the deleted item. NOTIFY_FUNC may be NULL if this
- information is not required. */
+ If NOTIFY_FUNC is non-null, then for each item deleted, call
+ NOTIFY_FUNC with NOTIFY_BATON and the path of the deleted
+ item. */
svn_error_t *
svn_client_delete (svn_client_commit_info_t **commit_info,
const char *path,
@@ -437,10 +407,9 @@
In all cases, if NEW_ENTRY already exists in URL, return error.
- BEFORE_EDITOR, BEFORE_EDIT_BATON, and AFTER_EDITOR,
- AFTER_EDIT_BATON are pre- and post-import (i.e., post-commit) hook
- editors. They are optional; pass four NULLs here if you don't need
- them.
+ If NOTIFY_FUNC is non-null, then call NOTIFY_FUNC with NOTIFY_BATON
+ as the import progresses, with any of the following actions:
+ svn_wc_notify_commit_added, svn_wc_notify_commit_postfix_txdelta.
If XML_DST is non-NULL, it is a file in which to store the xml
result of the commit, and REVISION is used as the revision.
@@ -466,10 +435,8 @@
right now.
*/
svn_error_t *svn_client_import (svn_client_commit_info_t **commit_info,
- const svn_delta_editor_t *before_editor,
- void *before_edit_baton,
- const svn_delta_editor_t *after_editor,
- void *after_edit_baton,
+ svn_wc_notify_func_t notify_func,
+ void *notify_baton,
svn_client_auth_baton_t *auth_baton,
const char *path,
const char *url,
@@ -483,24 +450,19 @@
/* Commit file or directory PATH into repository, authenticating with
- AUTH_BATON, and using LOG_MSG as the log message. Set *COMMIT_INFO
- to the results of the commit, allocated in POOL.
+ AUTH_BATON, using LOG_MSG_FUNC/LOG_MSG_BATON to obtain the log
+ message. Set *COMMIT_INFO to the results of the commit, allocated
+ in POOL.
- TARGETS is an array of svn_stringbuf_t * paths to commit. They need
- not be canonicalized nor condensed; this function will take care of
+ TARGETS is an array of const char * paths to commit. They need not
+ be canonicalized nor condensed; this function will take care of
that.
- BEFORE_EDITOR, BEFORE_EDIT_BATON, and AFTER_EDITOR,
- AFTER_EDIT_BATON are pre- and post-commit hook editors. They are
- optional; pass four NULLs here if you don't need them.
-
- Additionally, NOTIFY_FUNC/BATON will be called as the commit
- progresses, as a way of describing actions to the application
- layer.
-
- LOG_MSG_FUNC/LOG_MSG_BATON are a callback/baton combo that this
- function can use to query for a commit log message when one is
- needed.
+ If NOTIFY_FUNC is non-null, then call NOTIFY_FUNC with NOTIFY_BATON
+ as the commit progresses, with any of the following actions:
+ svn_wc_notify_commit_modified, svn_wc_notify_commit_added,
+ svn_wc_notify_commit_deleted, svn_wc_notify_commit_replaced,
+ svn_wc_notify_commit_postfix_txdelta.
If XML_DST is NULL, then the commit will write to a repository, and
the REVISION argument is ignored.
@@ -525,10 +487,6 @@
*/
svn_error_t *
svn_client_commit (svn_client_commit_info_t **commit_info,
- const svn_delta_editor_t *before_editor,
- void *before_edit_baton,
- const svn_delta_editor_t *after_editor,
- void *after_edit_baton,
svn_wc_notify_func_t notify_func,
void *notify_baton,
svn_client_auth_baton_t *auth_baton,
@@ -706,9 +664,8 @@
undoing any local mods. If PATH is a directory, and RECURSIVE is
TRUE, this will be a recursive operation.
- For each item reverted, NOTIFY_FUNC will be called with NOTIFY_BATON
- and the path of the reverted item. If this information is not required,
- then NOTIFY_FUNC may be NULL. */
+ If NOTIFY_FUNC is non-null, then for each item reverted, call
+ NOTIFY_FUNC with NOTIFY_BATON and the path of the reverted item. */
svn_error_t *
svn_client_revert (const char *path,
svn_boolean_t recursive,
@@ -722,8 +679,8 @@
committed in the future. The implementation details are opaque.
If PATH is not in a state of conflict to begin with, do nothing.
- If PATH's conflict state is removed, call NOTIFY_FUNC (with
- NOTIFY_BATON) if the func is non-NULL. */
+ If PATH's conflict state is removed and NOTIFY_FUNC is non-null,
+ call NOTIFY_FUNC with NOTIFY_BATON and PATH. */
svn_error_t *
svn_client_resolve (const char *path,
svn_wc_notify_func_t notify_func,
@@ -744,12 +701,6 @@
repository. If the commit succeeds, allocate (in POOL) and
populate *COMMIT_INFO.
- If the operation involves interaction between the working copy and
- the repository, there may be an editor drive, in which case the
- BEFORE_EDITOR, BEFORE_EDIT_BATON and AFTER_EDITOR, AFTER_EDIT_BATON
- will be wrapped around the edit using svn_delta_wrap_editor()
- (which see in svn_delta.h).
-
If neither SRC_PATH nor DST_PATH is a URL, then this is just a
variant of svn_client_add, where the DST_PATH items are scheduled
for addition as copies. No changes will happen to the repository
@@ -760,10 +711,9 @@
function can use to query for a commit log message when one is
needed.
- For each item added (at the new location), NOTIFY_FUNC will be
- called with the NOTIFY_BATON and the (new, relative) path of the
- added item. If this information is not required, then NOTIFY_FUNC
- may be NULL. */
+ If NOTIFY_FUNC is non-null, invoke it with NOTIFY_BATON for each
+ item added at the new location (using the new, relative path of the
+ added item) */
svn_error_t *
svn_client_copy (svn_client_commit_info_t **commit_info,
const char *src_path,
@@ -772,10 +722,6 @@
svn_client_auth_baton_t *auth_baton,
svn_client_get_commit_log_t log_msg_func,
void *log_msg_baton,
- const svn_delta_editor_t *before_editor,
- void *before_edit_baton,
- const svn_delta_editor_t *after_editor,
- void *after_edit_baton,
svn_wc_notify_func_t notify_func,
void *notify_baton,
apr_pool_t *pool);
@@ -819,10 +765,12 @@
function can use to query for a commit log message when one is
needed.
- For each item moved, NOTIFY_FUNC will be called with the
- NOTIFY_BATON twice, once to indicate the deletion of the moved
- thing, and once to indicate the addition of the new location of the
- thing. NOTIFY_FUNC can be NULL if this feedback is not required. */
+ If NOTIFY_FUNC is non-null, then for each item moved, call
+ NOTIFY_FUNC with the NOTIFY_BATON twice, once to indicate the
+ deletion of the moved thing, and once to indicate the addition of
+ the new location of the thing. ### Is this really true? What about
+ svn_wc_notify_commit_replaced? ###
+*/
svn_error_t *
svn_client_move (svn_client_commit_info_t **commit_info,
const char *src_path,
@@ -888,6 +836,12 @@
/* Cancellation. */
+
+/* ### Plan is to get rid of tihs, and make svn_wc_notify_func_t
+ ### return boolean, where true indicates that the user requested
+ ### cancellation. The caller of the notification func can then
+ ### take whatever action is appropriate (most editor functions will
+ ### probably return SVN_ERR_CANCELED, for example). */
/* A function type for determining whether or not to cancel an operation.
* Returns TRUE if should cancel, FALSE if should not.
Index: ./subversion/libsvn_wc/update_editor.c
===================================================================
--- ./subversion/libsvn_wc/update_editor.c
+++ ./subversion/libsvn_wc/update_editor.c Tue Jun 11 17:06:48 2002
@@ -1214,7 +1214,7 @@
used extensively by the update-editor, as well as by
svn_client_switch(), when switching a single file in-place. */
svn_error_t *
-svn_wc_install_file (svn_wc_notify_state_t *text_state,
+svn_wc_install_file (svn_wc_notify_state_t *content_state,
svn_wc_notify_state_t *prop_state,
const char *file_path,
svn_revnum_t new_revision,
@@ -1736,7 +1736,7 @@
}
}
- if (text_state)
+ if (content_state)
{
svn_wc_entry_t *entry;
svn_boolean_t tc, pc;
@@ -1757,16 +1757,16 @@
seems okay to me. I guess. I dunno. You? */
if (tc)
- *text_state = svn_wc_notify_state_conflicted;
+ *content_state = svn_wc_notify_state_conflicted;
else if (new_text_path)
{
if (is_locally_modified)
- *text_state = svn_wc_notify_state_merged;
+ *content_state = svn_wc_notify_state_merged;
else
- *text_state = svn_wc_notify_state_modified;
+ *content_state = svn_wc_notify_state_modified;
}
else
- *text_state = svn_wc_notify_state_unknown;
+ *content_state = svn_wc_notify_state_unknown;
}
/* Unlock the parent dir, we're done with this file installation. */
@@ -1784,7 +1784,7 @@
struct file_baton *fb = file_baton;
const char *new_text_path = NULL;
apr_array_header_t *propchanges = NULL;
- svn_wc_notify_state_t text_state, prop_state;
+ svn_wc_notify_state_t content_state, prop_state;
/* window-handler assembles new pristine text in .svn/tmp/text-base/ */
if (fb->text_changed)
@@ -1793,7 +1793,7 @@
if (fb->prop_changed)
propchanges = fb->propchanges;
- SVN_ERR (svn_wc_install_file (&text_state,
+ SVN_ERR (svn_wc_install_file (&content_state,
&prop_state,
fb->path,
fb->edit_baton->target_revision,
@@ -1814,7 +1814,7 @@
fb->path,
fb->added ? svn_wc_notify_add : svn_wc_notify_update,
svn_node_file,
- text_state,
+ content_state,
prop_state,
SVN_INVALID_REVNUM);
@@ -1958,6 +1958,8 @@
const char *target,
svn_revnum_t target_revision,
svn_boolean_t recurse,
+ svn_wc_notify_func_t notify_func,
+ void *notify_baton,
const svn_delta_editor_t **editor,
void **edit_baton,
svn_wc_traversal_info_t **traversal_info,
@@ -1965,7 +1967,7 @@
{
return make_editor (anchor, target, target_revision,
FALSE, NULL, NULL,
- recurse, NULL, NULL,
+ recurse, notify_func, notify_baton,
editor, edit_baton, traversal_info, pool);
}
@@ -1996,6 +1998,8 @@
svn_revnum_t target_revision,
const char *switch_url,
svn_boolean_t recurse,
+ svn_wc_notify_func_t notify_func,
+ void *notify_baton,
const svn_delta_editor_t **editor,
void **edit_baton,
svn_wc_traversal_info_t **traversal_info,
@@ -2005,7 +2009,7 @@
return make_editor (anchor, target, target_revision,
FALSE, NULL, switch_url,
- recurse, NULL, NULL,
+ recurse, notify_func, notify_baton,
editor, edit_baton,
traversal_info, pool);
}
Index: ./subversion/libsvn_client/switch.c
===================================================================
--- ./subversion/libsvn_client/switch.c
+++ ./subversion/libsvn_client/switch.c Tue Jun 11 17:05:56 2002
@@ -49,11 +49,7 @@
svn_error_t *
-svn_client_switch (const svn_delta_editor_t *before_editor,
- void *before_edit_baton,
- const svn_delta_editor_t *after_editor,
- void *after_edit_baton,
- svn_client_auth_baton_t *auth_baton,
+svn_client_switch (svn_client_auth_baton_t *auth_baton,
const char *path,
const char *switch_url,
const svn_client_revision_t *revision,
@@ -126,8 +122,6 @@
{
const svn_delta_editor_t *switch_editor;
void *switch_edit_baton;
- const svn_delta_editor_t *wrap_editor;
- void *wrap_edit_baton;
const svn_delta_edit_fns_t *wrapped_old_editor;
void *wrapped_old_edit_baton;
@@ -143,19 +137,14 @@
on. */
SVN_ERR (svn_wc_get_switch_editor (anchor, target,
revnum, switch_url, recurse,
+ notify_func, notify_baton,
&switch_editor, &switch_edit_baton,
NULL, pool));
- /* Wrap it up with outside editors. */
- svn_delta_wrap_editor (&wrap_editor, &wrap_edit_baton,
- before_editor, before_edit_baton,
- switch_editor, switch_edit_baton,
- after_editor, after_edit_baton, pool);
-
/* ### todo: This is a TEMPORARY wrapper around our editor so we
can use it with an old driver. */
svn_delta_compat_wrap (&wrapped_old_editor, &wrapped_old_edit_baton,
- wrap_editor, wrap_edit_baton, pool);
+ switch_editor, switch_edit_baton, pool);
/* Tell RA to do a update of URL+TARGET to REVISION; if we pass an
invalid revnum, that means RA will use the latest revision. */
Index: ./subversion/libsvn_client/copy.c
===================================================================
--- ./subversion/libsvn_client/copy.c
+++ ./subversion/libsvn_client/copy.c Tue Jun 11 15:24:25 2002
@@ -445,10 +445,8 @@
const char *dst_url,
svn_client_auth_baton_t *auth_baton,
const char *message,
- const svn_delta_editor_t *before_editor,
- void *before_edit_baton,
- const svn_delta_editor_t *after_editor,
- void *after_edit_baton,
+ svn_wc_notify_func_t notify_func,
+ void *notify_baton,
apr_pool_t *pool)
{
const char *anchor, *target, *parent, *base_name;
@@ -558,15 +556,10 @@
/* Make a note that we have a commit-in-progress. */
commit_in_progress = TRUE;
- /* Wrap the resulting editor with BEFORE and AFTER editors. */
- svn_delta_wrap_editor (&editor, &edit_baton,
- before_editor, before_edit_baton,
- editor, edit_baton,
- after_editor, after_edit_baton, pool);
-
/* Perform the commit. */
cmt_err = svn_client__do_commit (base_url, commit_items, editor, edit_baton,
- NULL, NULL, 0,
+ notify_func, notify_baton,
+ 0, /* ### any notify_path_offset needed? */
&tempfiles, pool);
commit_in_progress = FALSE;
@@ -605,10 +598,6 @@
const svn_client_revision_t *src_revision,
const char *dst_path,
svn_client_auth_baton_t *auth_baton,
- const svn_delta_editor_t *before_editor,
- void *before_edit_baton,
- const svn_delta_editor_t *after_editor,
- void *after_edit_baton,
svn_wc_notify_func_t notify_func,
void *notify_baton,
apr_pool_t *pool)
@@ -698,15 +687,10 @@
/* Get a checkout editor and wrap it. */
SVN_ERR (svn_wc_get_checkout_editor (dst_path, src_url, src_revnum, 1,
- NULL, NULL,
+ notify_func, notify_baton,
&editor, &edit_baton,
NULL, pool));
- svn_delta_wrap_editor (&editor, &edit_baton,
- before_editor, before_edit_baton,
- editor, edit_baton,
- after_editor, after_edit_baton, pool);
-
/* Check out the new tree. The parent dir will get no entry, so
it will be as if the new tree isn't really there yet. */
SVN_ERR (ra_lib->do_checkout (sess, src_revnum, 1,
@@ -822,10 +806,6 @@
svn_client_auth_baton_t *auth_baton,
svn_client_get_commit_log_t log_msg_func,
void *log_msg_baton,
- const svn_delta_editor_t *before_editor,
- void *before_edit_baton,
- const svn_delta_editor_t *after_editor,
- void *after_edit_baton,
svn_boolean_t is_move,
svn_boolean_t force,
svn_wc_notify_func_t notify_func,
@@ -908,15 +888,12 @@
else if ((! src_is_url) && (dst_is_url))
SVN_ERR (wc_to_repos_copy (commit_info, src_path, dst_path,
auth_baton, message,
- before_editor, before_edit_baton,
- after_editor, after_edit_baton,
+ notify_func, notify_baton,
pool));
else if ((src_is_url) && (! dst_is_url))
SVN_ERR (repos_to_wc_copy (src_path, src_revision,
dst_path, auth_baton,
- before_editor, before_edit_baton,
- after_editor, after_edit_baton,
notify_func, notify_baton,
pool));
@@ -940,10 +917,6 @@
svn_client_auth_baton_t *auth_baton,
svn_client_get_commit_log_t log_msg_func,
void *log_msg_baton,
- const svn_delta_editor_t *before_editor,
- void *before_edit_baton,
- const svn_delta_editor_t *after_editor,
- void *after_edit_baton,
svn_wc_notify_func_t notify_func,
void *notify_baton,
apr_pool_t *pool)
@@ -951,8 +924,6 @@
return setup_copy (commit_info,
src_path, src_revision, dst_path, auth_baton,
log_msg_func, log_msg_baton,
- before_editor, before_edit_baton,
- after_editor, after_edit_baton,
FALSE /* is_move */,
TRUE /* force, set to avoid deletion check */,
notify_func, notify_baton,
@@ -976,8 +947,6 @@
return setup_copy (commit_info,
src_path, src_revision, dst_path, auth_baton,
log_msg_func, log_msg_baton,
- NULL, NULL, /* no before_editor, before_edit_baton */
- NULL, NULL, /* no after_editor, after_edit_baton */
TRUE /* is_move */,
force,
notify_func, notify_baton,
Index: ./subversion/libsvn_client/apply_edits.c
===================================================================
--- ./subversion/libsvn_client/apply_edits.c
+++ ./subversion/libsvn_client/.svn/empty-file Sun Mar 17 17:12:45 2002
@@ -1,214 +0,0 @@
-/*
- * apply_edits.c: shared code for checkouts and updates
- *
- * ====================================================================
- * Copyright (c) 2000-2002 CollabNet. All rights reserved.
- *
- * This software is licensed as described in the file COPYING, which
- * you should have received as part of this distribution. The terms
- * are also available at http://subversion.tigris.org/license-1.html.
- * If newer versions of this license are posted there, you may use a
- * newer version instead, at your option.
- *
- * This software consists of voluntary contributions made by many
- * individuals. For exact contribution history, see the revision
- * history and logs, available at http://subversion.tigris.org/.
- * ====================================================================
- */
-
-/* ==================================================================== */
-
-
-
-/*** Includes. ***/
-
-#include <assert.h>
-#include "svn_wc.h"
-#include "svn_delta.h"
-#include "svn_client.h"
-#include "svn_string.h"
-#include "svn_error.h"
-#include "svn_path.h"
-#include "client.h"
-
-
-
-/*** Helpers ***/
-
-static svn_error_t *
-apply_delta (const svn_delta_editor_t *before_editor,
- void *before_edit_baton,
- const svn_delta_editor_t *after_editor,
- void *after_edit_baton,
- svn_stream_t *delta,
- const char *dest,
- const char *ancestor_path, /* ignored if update */
- svn_revnum_t ancestor_revision, /* ignored if update */
- svn_boolean_t recurse,
- apr_pool_t *pool,
- svn_boolean_t is_update)
-{
- const svn_delta_editor_t *editor;
- void *edit_baton;
- const svn_delta_editor_t *wrap_editor;
- void *wrap_edit_baton;
- const svn_delta_edit_fns_t *wrapped_old_editor;
- void *wrapped_old_edit_baton;
- svn_error_t *err;
-
- /* If not given an ancestor path, we will (for the time being)
- simply create an empty one. */
- if (! ancestor_path)
- ancestor_path = "";
-
- if (is_update)
- {
- const char *anchor, *target;
-
- SVN_ERR (svn_wc_get_actual_target (dest, &anchor, &target, pool));
- err = svn_wc_get_update_editor (anchor,
- target,
- ancestor_revision,
- recurse,
- &editor,
- &edit_baton,
- NULL,
- pool);
- }
- else /* checkout */
- {
- err = svn_wc_get_checkout_editor (dest,
- ancestor_path,
- ancestor_revision,
- recurse,
- NULL, NULL,
- &editor, &edit_baton,
- NULL,
- pool);
- }
- if (err)
- return err;
-
- svn_delta_wrap_editor (&wrap_editor,
- &wrap_edit_baton,
- before_editor,
- before_edit_baton,
- editor,
- edit_baton,
- after_editor,
- after_edit_baton,
- pool);
-
- /* ### todo: This is a TEMPORARY wrapper around our editor so we
- can use it with an old driver. */
- svn_delta_compat_wrap (&wrapped_old_editor, &wrapped_old_edit_baton,
- wrap_editor, wrap_edit_baton, pool);
-
- return svn_delta_xml_auto_parse (delta,
- wrapped_old_editor,
- wrapped_old_edit_baton,
- ancestor_path,
- ancestor_revision,
- pool);
-}
-
-
-
-static svn_error_t *
-do_edits (const svn_delta_editor_t *before_editor,
- void *before_edit_baton,
- const svn_delta_editor_t *after_editor,
- void *after_edit_baton,
- const char *path,
- const char *xml_src,
- const char *URL, /* ignored if update */
- svn_revnum_t revision, /* ignored if update */
- svn_boolean_t recurse,
- apr_pool_t *pool,
- svn_boolean_t is_update)
-{
- svn_error_t *err;
- apr_status_t apr_err;
- apr_file_t *in = NULL;
-
- assert (path != NULL);
- assert (xml_src != NULL);
-
- /* Open the XML source file. */
- apr_err = apr_file_open (&in, xml_src,
- (APR_READ | APR_CREATE),
- APR_OS_DEFAULT,
- pool);
- if (apr_err)
- return svn_error_createf (apr_err, 0, NULL, pool,
- "unable to open %s", xml_src);
-
- /* Check out the delta. */
- err = apply_delta (before_editor,
- before_edit_baton,
- after_editor,
- after_edit_baton,
- svn_stream_from_aprfile (in, pool),
- path,
- URL,
- revision,
- recurse,
- pool,
- is_update);
- if (err)
- {
- apr_file_close (in);
- return err;
- }
-
- apr_file_close (in);
-
- return SVN_NO_ERROR;
-}
-
-
-
-/*** Public Interfaces. ***/
-
-svn_error_t *
-svn_client__checkout_internal (const svn_delta_editor_t *before_editor,
- void *before_edit_baton,
- const svn_delta_editor_t *after_editor,
- void *after_edit_baton,
- const char *path,
- const char *xml_src,
- const char *URL,
- svn_revnum_t revision,
- svn_boolean_t recurse,
- apr_pool_t *pool)
-{
- return do_edits (before_editor, before_edit_baton,
- after_editor, after_edit_baton,
- path, xml_src, URL, revision, recurse,
- pool, FALSE);
-}
-
-
-svn_error_t *
-svn_client__update_internal (const svn_delta_editor_t *before_editor,
- void *before_edit_baton,
- const svn_delta_editor_t *after_editor,
- void *after_edit_baton,
- const char *path,
- const char *xml_src,
- svn_revnum_t ancestor_revision,
- svn_boolean_t recurse,
- apr_pool_t *pool)
-{
- return do_edits (before_editor, before_edit_baton,
- after_editor, after_edit_baton,
- path, xml_src, NULL, ancestor_revision, recurse,
- pool, TRUE);
-}
-
-
-
-/*
- * local variables:
- * eval: (load-file "../../tools/dev/svn-dev.el")
- * end: */
Index: ./subversion/libsvn_client/update.c
===================================================================
--- ./subversion/libsvn_client/update.c
+++ ./subversion/libsvn_client/update.c Tue Jun 11 14:10:19 2002
@@ -36,11 +36,7 @@
/*** Code. ***/
svn_error_t *
-svn_client_update (const svn_delta_editor_t *before_editor,
- void *before_edit_baton,
- const svn_delta_editor_t *after_editor,
- void *after_edit_baton,
- svn_client_auth_baton_t *auth_baton,
+svn_client_update (svn_client_auth_baton_t *auth_baton,
const char *path,
const char *xml_src,
const svn_client_revision_t *revision,
@@ -95,17 +91,10 @@
target,
revnum,
recurse,
- &update_editor,
- &update_edit_baton,
+ notify_func, notify_baton,
+ &update_editor, &update_edit_baton,
&traversal_info,
pool));
-
-
- /* Wrap it up with outside editors. */
- svn_delta_wrap_editor (&wrap_editor, &wrap_edit_baton,
- before_editor, before_edit_baton,
- update_editor, update_edit_baton,
- after_editor, after_edit_baton, pool);
/* ### todo: This is a TEMPORARY wrapper around our editor so we
can use it with an old driver. */
Index: ./subversion/libsvn_client/commit.c
===================================================================
--- ./subversion/libsvn_client/commit.c
+++ ./subversion/libsvn_client/commit.c Tue Jun 11 16:35:09 2002
@@ -90,9 +90,16 @@
/* Import file PATH as EDIT_PATH in the repository directory indicated
* by DIR_BATON in EDITOR.
*
- * Use POOL for any temporary allocation. */
+ * If NOTIFY_FUNC is non-null, invoke it with NOTIFY_BATON for each
+ * file. ### add mime-type (or at least binary) indicator to
+ * notify_func ###
+ *
+ * Use POOL for any temporary allocation.
+ */
static svn_error_t *
import_file (apr_hash_t *files,
+ svn_wc_notify_func_t notify_func,
+ void *notify_baton,
const svn_delta_editor_t *editor,
void *dir_baton,
const char *path,
@@ -118,6 +125,16 @@
svn_string_create (mimetype, pool),
pool));
+ /* ### wish we could pass the mime-type here */
+ if (notify_func)
+ notify_func (notify_baton,
+ path,
+ svn_wc_notify_commit_added,
+ svn_node_file,
+ svn_wc_notify_state_inapplicable,
+ svn_wc_notify_state_inapplicable,
+ SVN_INVALID_REVNUM);
+
/* Finally, add the file's path and baton to the FILES hash. */
value->subpool = subpool;
value->file_baton = file_baton;
@@ -131,9 +148,14 @@
* DIR_BATON in EDITOR. ROOT_PATH is the path imported as the root
* directory, so all edits are relative to that.
*
+ * If NOTIFY_FUNC is non-null, invoke it with NOTIFY_BATON for each
+ * directory.
+ *
* Use POOL for any temporary allocation. */
static svn_error_t *
import_dir (apr_hash_t *files,
+ svn_wc_notify_func_t notify_func,
+ void *notify_baton,
const svn_delta_editor_t *editor,
void *dir_baton,
const char *path,
@@ -160,8 +182,9 @@
if (finfo.filetype == APR_DIR)
{
/* Skip entries for this dir and its parent.
- ### kff todo: APR actually promises that they'll come first,
- so this guard could be moved outside the loop. */
+ (APR promises that they'll come first, so technically
+ this guard could be moved outside the loop. But somehow
+ that feels iffy. */
if (! (strcmp (finfo.name, ".") && strcmp (finfo.name, "..")))
continue;
@@ -194,8 +217,23 @@
NULL, SVN_INVALID_REVNUM, subpool,
&this_dir_baton));
+ /* By notifying before the recursive call below, we display
+ a directory add before displaying adds underneath the
+ directory. To do it the other way around, just move this
+ after the recursive call. */
+ if (notify_func)
+ notify_func (notify_baton,
+ path,
+ svn_wc_notify_commit_added,
+ svn_node_dir,
+ svn_wc_notify_state_inapplicable,
+ svn_wc_notify_state_inapplicable,
+ SVN_INVALID_REVNUM);
+
/* Recurse. */
- SVN_ERR (import_dir (files, editor, this_dir_baton,
+ SVN_ERR (import_dir (files,
+ notify_func, notify_baton,
+ editor, this_dir_baton,
this_path, this_edit_path,
FALSE, subpool));
@@ -205,10 +243,12 @@
else if (finfo.filetype == APR_REG)
{
/* Import a file. */
- SVN_ERR (import_file (files, editor, dir_baton,
+ SVN_ERR (import_file (files,
+ notify_func, notify_baton,
+ editor, dir_baton,
this_path, this_edit_path, subpool));
}
- /* ### We're silently ignoring things that aren't files or
+ /* We're silently ignoring things that aren't files or
directories. If we stop doing that, here is the place to
change your world. */
}
@@ -243,6 +283,10 @@
*
* NEW_ENTRY can never be the empty string.
*
+ * If NOTIFY_FUNC is non-null, invoke it with NOTIFY_BATON for each
+ * imported path, passing the actions svn_wc_notify_commit_added or
+ * svn_wc_notify_commit_postfix_txdelta.
+ *
* Use POOL for any temporary allocation.
*
* Note: the repository directory receiving the import was specified
@@ -253,6 +297,8 @@
static svn_error_t *
import (const char *path,
const char *new_entry,
+ svn_wc_notify_func_t notify_func,
+ void *notify_baton,
const svn_delta_editor_t *editor,
void *edit_baton,
svn_boolean_t nonrecursive,
@@ -286,7 +332,9 @@
(SVN_ERR_UNKNOWN_NODE_KIND, 0, NULL, pool,
"new entry name required when importing a file");
- SVN_ERR (import_file (files, editor, root_baton,
+ SVN_ERR (import_file (files,
+ notify_func, notify_baton,
+ editor, root_baton,
path, new_entry, pool));
}
else if (kind == svn_node_dir)
@@ -298,10 +346,22 @@
SVN_ERR (editor->add_directory (new_entry, root_baton,
NULL, SVN_INVALID_REVNUM,
pool, &new_dir_baton));
-
+
+ if (notify_func)
+ notify_func (notify_baton,
+ path,
+ svn_wc_notify_commit_added,
+ svn_node_dir,
+ svn_wc_notify_state_inapplicable,
+ svn_wc_notify_state_inapplicable,
+ SVN_INVALID_REVNUM);
+
SVN_ERR (import_dir
- (files, editor, new_dir_baton ? new_dir_baton : root_baton,
- path, new_entry ? new_entry : "", nonrecursive, pool));
+ (files,
+ notify_func, notify_baton,
+ editor, new_dir_baton ? new_dir_baton : root_baton,
+ path, new_entry ? new_entry : "",
+ nonrecursive, pool));
/* Close one baton or two. */
if (new_dir_baton)
@@ -330,6 +390,18 @@
full_path = key;
SVN_ERR (send_file_contents (full_path, value->file_baton,
editor, value->subpool));
+
+ /* ### full_path is wrong, should be remainder when path is
+ subtracted */
+ if (notify_func)
+ notify_func (notify_baton,
+ full_path,
+ svn_wc_notify_commit_postfix_txdelta,
+ svn_node_file,
+ svn_wc_notify_state_inapplicable,
+ svn_wc_notify_state_inapplicable,
+ SVN_INVALID_REVNUM);
+
SVN_ERR (editor->close_file (value->file_baton));
svn_pool_destroy (value->subpool);
}
@@ -401,10 +473,8 @@
svn_error_t *
svn_client_import (svn_client_commit_info_t **commit_info,
- const svn_delta_editor_t *before_editor,
- void *before_edit_baton,
- const svn_delta_editor_t *after_editor,
- void *after_edit_baton,
+ svn_wc_notify_func_t notify_func,
+ void *notify_baton,
svn_client_auth_baton_t *auth_baton,
const char *path,
const char *url,
@@ -473,15 +543,11 @@
log_msg, NULL, &committed_rev, &committed_date,
&committed_author, FALSE, pool));
- /* Wrap the resulting editor with BEFORE and AFTER editors. */
- svn_delta_wrap_editor (&editor, &edit_baton,
- before_editor, before_edit_baton,
- editor, edit_baton,
- after_editor, after_edit_baton, pool);
-
/* If an error occured during the commit, abort the edit and return
the error. We don't even care if the abort itself fails. */
- if ((err = import (path, new_entry, editor, edit_baton, nonrecursive, pool)))
+ if ((err = import (path, new_entry,
+ notify_func, notify_baton,
+ editor, edit_baton, nonrecursive, pool)))
{
editor->abort_edit (edit_baton);
return err;
@@ -632,10 +698,6 @@
svn_error_t *
svn_client_commit (svn_client_commit_info_t **commit_info,
- const svn_delta_editor_t *before_editor,
- void *before_edit_baton,
- const svn_delta_editor_t *after_editor,
- void *after_edit_baton,
svn_wc_notify_func_t notify_func,
void *notify_baton,
svn_client_auth_baton_t *auth_baton,
@@ -791,13 +853,6 @@
}
}
}
-
- /* Wrap the resulting editor with BEFORE and AFTER editors. */
- svn_delta_wrap_editor (&editor, &edit_baton,
- before_editor, before_edit_baton,
- editor, edit_baton,
- after_editor, after_edit_baton, pool);
-
/* Determine prefix to strip from the commit notify messages */
/* ### this cast is a kluge */
Index: ./subversion/bindings/ruby/client.c
===================================================================
--- ./subversion/bindings/ruby/client.c
+++ ./subversion/bindings/ruby/client.c Tue Jun 11 10:35:14 2002
@@ -505,6 +505,8 @@
else
log_msg = NULL;
+ /* ### The svn_client_commit() interface has changed, but I'm not
+ sure how to update this code. -kff */
err = svn_client_commit (&commit_info,
before_editor, before_edit_baton,
after_editor, after_edit_baton,
Index: ./subversion/clients/cmdline/merge-cmd.c
===================================================================
--- ./subversion/clients/cmdline/merge-cmd.c
+++ ./subversion/clients/cmdline/merge-cmd.c Tue Jun 11 18:29:45 2002
@@ -41,9 +41,9 @@
apr_pool_t *pool)
{
apr_array_header_t *targets;
+ const svn_delta_editor_t *trace_editor = NULL;
+ void *trace_edit_baton = NULL;
svn_client_auth_baton_t *auth_baton;
- const svn_delta_editor_t *trace_editor;
- void *trace_edit_baton;
const char *parent_dir, *entry;
const char *sourcepath1, *sourcepath2, *targetpath;
svn_boolean_t using_alternate_syntax = FALSE;
@@ -119,8 +119,10 @@
*/
SVN_ERR (svn_wc_get_actual_target (targetpath, &parent_dir, &entry, pool));
- SVN_ERR (svn_cl__get_trace_update_editor (&trace_editor, &trace_edit_baton,
- parent_dir, FALSE, TRUE, pool));
+
+ if (! opt_state->quiet)
+ SVN_ERR (svn_cl__get_trace_update_editor (&trace_editor, &trace_edit_baton,
+ parent_dir, FALSE, TRUE, pool));
err = svn_client_merge (trace_editor, trace_edit_baton,
auth_baton,
Index: ./subversion/clients/cmdline/cl.h
===================================================================
--- ./subversion/clients/cmdline/cl.h
+++ ./subversion/clients/cmdline/cl.h Tue Jun 11 18:22:25 2002
@@ -262,10 +262,15 @@
to property values (svn_stringbuf_t *). */
void svn_cl__print_prop_names (apr_hash_t *prop_hash, apr_pool_t *pool);
+
/* Returns an editor that prints out events in an update or checkout.
The IS_CHECKOUT boolean tells the editor what kind of final
revision line to print; the SUPPRESS_FINAL_LINE flag indicates
- whether to print the final revision line at all. */
+ whether to print the final revision line at all.
+
+ ### OBSOLETE, please do not use. Left only for merge-cmd.c, until
+ ### svn_client_merge() changes to the new notification system.
+*/
svn_error_t *
svn_cl__get_trace_update_editor (const svn_delta_editor_t **editor,
void **edit_baton,
@@ -274,13 +279,6 @@
svn_boolean_t suppress_final_line,
apr_pool_t *pool);
-/* Returns an editor that prints out events in a commit. */
-svn_error_t *
-svn_cl__get_trace_commit_editor (const svn_delta_editor_t **editor,
- void **edit_baton,
- const char *initial_path,
- apr_pool_t *pool);
-
/* Search for a text editor command in standard environment variables,
and invoke it to edit CONTENTS (using a temporary file created in
@@ -331,33 +329,19 @@
/*** Notification functions to display results on the terminal. */
-/* This implements `svn_wc_notify_func_t'.
- A notifier for non-update operations, and its baton. */
-void svn_cl__notify_func (void *baton,
- const char *path,
- svn_wc_notify_action_t action,
- svn_node_kind_t kind,
- svn_wc_notify_state_t text_state,
- svn_wc_notify_state_t prop_state,
- svn_revnum_t revision);
-
-void *svn_cl__make_notify_baton (apr_pool_t *pool);
-
-/* Set *NOTIFY_FUNC_P and *NOTIFY_BATON_P to a notifier/baton for
- checkouts, updates, and switches. The notifier will use POOL for
- temporary allocations. */
-void svn_cl__get_checkout_notifier (svn_wc_notify_func_t *notify_func_p,
- void **notify_baton_p,
- svn_boolean_t is_checkout,
- svn_boolean_t suppress_final_line,
- apr_pool_t *pool);
-
-
-/* This macro is used to specify a notification function, or NULL if the
- user has requested "quiet" mode. */
-#define SVN_CL_NOTIFY(opt_state) \
- ((opt_state)->quiet ? NULL : svn_cl__notify_func)
-
+/* Set *NOTIFY_FUNC_P and *NOTIFY_BATON_P to a notifier/baton for all
+ * operations, allocated in POOL.
+ *
+ * If this is a checkout, set IS_CHECKOUT.
+ *
+ * If don't want a summary line at the end of notifications, set
+ * SUPPRESS_FINAL_LINE.
+ */
+void svn_cl__get_notifier (svn_wc_notify_func_t *notify_func_p,
+ void **notify_baton_p,
+ svn_boolean_t is_checkout,
+ svn_boolean_t suppress_final_line,
+ apr_pool_t *pool);
/*** Log message callback stuffs. ***/
Index: ./subversion/clients/cmdline/checkout-cmd.c
===================================================================
--- ./subversion/clients/cmdline/checkout-cmd.c
+++ ./subversion/clients/cmdline/checkout-cmd.c Tue Jun 11 17:07:16 2002
@@ -115,8 +115,8 @@
void *notify_baton = NULL;
if (! opt_state->quiet)
- svn_cl__get_checkout_notifier (¬ify_func, ¬ify_baton,
- TRUE, FALSE, pool);
+ svn_cl__get_notifier (¬ify_func, ¬ify_baton,
+ TRUE, FALSE, pool);
SVN_ERR (svn_client_checkout (notify_func,
notify_baton,
Index: ./subversion/clients/cmdline/move-cmd.c
===================================================================
--- ./subversion/clients/cmdline/move-cmd.c
+++ ./subversion/clients/cmdline/move-cmd.c Mon Jun 10 18:07:06 2002
@@ -44,6 +44,8 @@
svn_client_auth_baton_t *auth_baton = NULL;
svn_client_commit_info_t *commit_info = NULL;
svn_error_t *err;
+ svn_wc_notify_func_t notify_func = NULL;
+ void *notify_baton = NULL;
targets = svn_cl__args_to_target_array (os, opt_state, FALSE, pool);
@@ -59,14 +61,16 @@
src_path = ((const char **) (targets->elts))[0];
dst_path = ((const char **) (targets->elts))[1];
+ if (! opt_state->quiet)
+ svn_cl__get_notifier (¬ify_func, ¬ify_baton, FALSE, FALSE, pool);
+
err = svn_client_move
(&commit_info,
src_path, &(opt_state->start_revision), dst_path,
opt_state->force, auth_baton,
&svn_cl__get_log_message,
svn_cl__make_log_msg_baton (opt_state, NULL, pool),
- SVN_CL_NOTIFY(opt_state),
- svn_cl__make_notify_baton (pool),
+ notify_func, notify_baton,
pool);
if (err)
return svn_cl__may_need_force (err);
Index: ./subversion/clients/cmdline/mkdir-cmd.c
===================================================================
--- ./subversion/clients/cmdline/mkdir-cmd.c
+++ ./subversion/clients/cmdline/mkdir-cmd.c Mon Jun 10 18:07:39 2002
@@ -43,12 +43,17 @@
svn_client_auth_baton_t *auth_baton = NULL;
int i;
svn_client_commit_info_t *commit_info = NULL;
+ svn_wc_notify_func_t notify_func = NULL;
+ void *notify_baton = NULL;
targets = svn_cl__args_to_target_array (os, opt_state, FALSE, pool);
/* Build an authentication object to give to libsvn_client. */
auth_baton = svn_cl__make_auth_baton (opt_state, pool);
+ if (! opt_state->quiet)
+ svn_cl__get_notifier (¬ify_func, ¬ify_baton, FALSE, FALSE, pool);
+
if (targets->nelts)
for (i = 0; i < targets->nelts; i++)
{
@@ -58,9 +63,7 @@
(&commit_info, target, auth_baton,
&svn_cl__get_log_message,
svn_cl__make_log_msg_baton (opt_state, NULL, pool),
- SVN_CL_NOTIFY(opt_state),
- svn_cl__make_notify_baton (pool),
- pool));
+ notify_func, notify_baton, pool));
if (commit_info)
svn_cl__print_commit_info (commit_info);
}
Index: ./subversion/clients/cmdline/revert-cmd.c
===================================================================
--- ./subversion/clients/cmdline/revert-cmd.c
+++ ./subversion/clients/cmdline/revert-cmd.c Mon Jun 10 18:06:21 2002
@@ -40,22 +40,24 @@
apr_array_header_t *targets;
int i;
svn_boolean_t recursive = opt_state->recursive;
+ svn_wc_notify_func_t notify_func = NULL;
+ void *notify_baton = NULL;
targets = svn_cl__args_to_target_array (os, opt_state, FALSE, pool);
/* Revert has no implicit dot-target `.', so don't you put that code
here! */
+ if (! opt_state->quiet)
+ svn_cl__get_notifier (¬ify_func, ¬ify_baton, FALSE, FALSE, pool);
+
if (targets->nelts)
for (i = 0; i < targets->nelts; i++)
{
const char *target = ((const char **) (targets->elts))[i];
SVN_ERR (svn_client_revert
- (target, recursive,
- SVN_CL_NOTIFY(opt_state),
- svn_cl__make_notify_baton (pool),
- pool));
+ (target, recursive, notify_func, notify_baton, pool));
}
else
{
Index: ./subversion/clients/cmdline/copy-cmd.c
===================================================================
--- ./subversion/clients/cmdline/copy-cmd.c
+++ ./subversion/clients/cmdline/copy-cmd.c Tue Jun 11 17:11:21 2002
@@ -42,10 +42,10 @@
apr_array_header_t *targets;
const char *src_path, *dst_path;
svn_client_auth_baton_t *auth_baton = NULL;
- const svn_delta_editor_t *trace_editor = NULL;
- void *trace_edit_baton = NULL;
svn_boolean_t src_is_url, dst_is_url;
svn_client_commit_info_t *commit_info = NULL;
+ svn_wc_notify_func_t notify_func = NULL;
+ void *notify_baton = NULL;
targets = svn_cl__args_to_target_array (os, opt_state, FALSE, pool);
if (targets->nelts != 2)
@@ -65,15 +65,16 @@
dst_is_url = svn_path_is_url (dst_path);
if ((! src_is_url) && (! dst_is_url))
- /* WC->WC : No trace editor needed. */
+ /* WC->WC : No notification needed. */
;
else if ((! src_is_url) && (dst_is_url))
{
- /* WC->URL : Use commit trace editor. */
+ /* WC->URL : Use notification. */
/* ### todo:
- We'd like to use the trace commit editor, but we have a
- couple of problems with that:
+ We'd like to use the notifier, but we MAY have a couple of
+ problems with that, the same problems that used to apply to
+ the old trace_editor:
1) We don't know where the commit editor for this case will
be anchored with respect to the repository, so we can't
@@ -86,26 +87,15 @@
display like: "Adding dir1/foo-copy.c", which could be a
bogus path.
*/
- /*
- svn_stringbuf_t *src_parent = svn_stringbuf_dup (src_path, pool);
- svn_path_remove_component (src_parent);
- SVN_ERR (svn_cl__get_trace_commit_editor (&trace_editor,
- &trace_edit_baton,
- src_parent, pool));
- */
}
else if ((src_is_url) && (! dst_is_url))
{
- /* URL->WC : Use checkout trace editor. */
- SVN_ERR (svn_cl__get_trace_update_editor (&trace_editor,
- &trace_edit_baton,
- dst_path,
- TRUE,
- TRUE, /* suppress final line */
- pool));
+ /* URL->WC : Use checkout-style notification. */
+ if (! opt_state->quiet)
+ svn_cl__get_notifier (¬ify_func, ¬ify_baton, TRUE, FALSE, pool);
}
else
- /* URL->URL : No trace editor needed. */
+ /* URL->URL : No notification needed. */
;
SVN_ERR (svn_client_copy
@@ -113,10 +103,7 @@
src_path, &(opt_state->start_revision), dst_path, auth_baton,
&svn_cl__get_log_message,
svn_cl__make_log_msg_baton (opt_state, NULL, pool),
- NULL, NULL, /* no before_editor */
- trace_editor, trace_edit_baton, /* one after_editor */
- SVN_CL_NOTIFY(opt_state),
- svn_cl__make_notify_baton (pool),
+ notify_func, notify_baton,
pool));
if (commit_info)
Index: ./subversion/clients/cmdline/update-cmd.c
===================================================================
--- ./subversion/clients/cmdline/update-cmd.c
+++ ./subversion/clients/cmdline/update-cmd.c Tue Jun 11 18:32:38 2002
@@ -42,6 +42,8 @@
apr_array_header_t *condensed_targets;
int i;
svn_client_auth_baton_t *auth_baton;
+ svn_wc_notify_func_t notify_func = NULL;
+ void *notify_baton = NULL;
targets = svn_cl__args_to_target_array (os, opt_state, FALSE, pool);
@@ -56,11 +58,12 @@
targets,
pool));
+ if (! opt_state->quiet)
+ svn_cl__get_notifier (¬ify_func, ¬ify_baton, FALSE, FALSE, pool);
+
for (i = 0; i < condensed_targets->nelts; i++)
{
const char *target = ((const char **) (condensed_targets->elts))[i];
- const svn_delta_editor_t *trace_editor;
- void *trace_edit_baton;
const char *parent_dir, *entry;
SVN_ERR (svn_wc_get_actual_target (target,
@@ -68,23 +71,13 @@
&entry,
pool));
- SVN_ERR (svn_cl__get_trace_update_editor (&trace_editor,
- &trace_edit_baton,
- parent_dir,
- FALSE, /* is checkout */
- FALSE,
- pool));
-
SVN_ERR (svn_client_update
- (NULL, NULL,
- trace_editor, trace_edit_baton,
- auth_baton,
+ (auth_baton,
target,
opt_state->xml_file,
&(opt_state->start_revision),
opt_state->nonrecursive ? FALSE : TRUE,
- SVN_CL_NOTIFY(opt_state),
- svn_cl__make_notify_baton (pool),
+ notify_func, notify_baton,
pool));
}
Index: ./subversion/clients/cmdline/commit-cmd.c
===================================================================
--- ./subversion/clients/cmdline/commit-cmd.c
+++ ./subversion/clients/cmdline/commit-cmd.c Tue Jun 11 17:07:28 2002
@@ -50,6 +50,8 @@
svn_client_auth_baton_t *auth_baton;
svn_client_commit_info_t *commit_info = NULL;
svn_revnum_t revnum;
+ svn_wc_notify_func_t notify_func = NULL;
+ void *notify_baton = NULL;
targets = svn_cl__args_to_target_array (os, opt_state, FALSE, pool);
@@ -81,13 +83,13 @@
else
revnum = SVN_INVALID_REVNUM; /* no matter, this is fine */
+ if (! opt_state->quiet)
+ svn_cl__get_notifier (¬ify_func, ¬ify_baton, FALSE, FALSE, pool);
+
/* Commit. */
- SVN_ERR (svn_client_commit
+ SVN_ERR (svn_client_commit
(&commit_info,
- NULL, NULL,
- NULL, NULL,
- SVN_CL_NOTIFY(opt_state),
- svn_cl__make_notify_baton (pool),
+ notify_func, notify_baton,
auth_baton,
targets,
svn_cl__get_log_message,
Index: ./subversion/clients/cmdline/add-cmd.c
===================================================================
--- ./subversion/clients/cmdline/add-cmd.c
+++ ./subversion/clients/cmdline/add-cmd.c Mon Jun 10 18:10:33 2002
@@ -50,13 +50,16 @@
if (targets->nelts)
{
apr_pool_t *subpool = svn_pool_create (pool);
+ svn_wc_notify_func_t notify_func = NULL;
+ void *notify_baton = NULL;
+
+ if (! opt_state->quiet)
+ svn_cl__get_notifier (¬ify_func, ¬ify_baton, FALSE, FALSE, pool);
for (i = 0; i < targets->nelts; i++)
{
const char *target = ((const char **) (targets->elts))[i];
- err = svn_client_add (target, recursive,
- SVN_CL_NOTIFY(opt_state),
- svn_cl__make_notify_baton (subpool),
+ err = svn_client_add (target, recursive, notify_func, notify_baton,
subpool);
if (err)
{
Index: ./subversion/clients/cmdline/switch-cmd.c
===================================================================
--- ./subversion/clients/cmdline/switch-cmd.c
+++ ./subversion/clients/cmdline/switch-cmd.c Tue Jun 11 18:30:48 2002
@@ -46,6 +46,8 @@
const svn_delta_editor_t *trace_editor;
void *trace_edit_baton;
const char *parent_dir, *base_tgt;
+ svn_wc_notify_func_t notify_func = NULL;
+ void *notify_baton = NULL;
/* This command should discover (or derive) exactly two cmdline
arguments: a local path to update ("target"), and a new url to
@@ -96,17 +98,17 @@
FALSE,
pool));
+ if (! opt_state->quiet)
+ svn_cl__get_notifier (¬ify_func, ¬ify_baton, FALSE, FALSE, pool);
+
/* Do the 'switch' update. */
SVN_ERR (svn_client_switch
- (NULL, NULL,
- trace_editor, trace_edit_baton,
- auth_baton,
+ (auth_baton,
target,
switch_url,
&(opt_state->start_revision),
opt_state->nonrecursive ? FALSE : TRUE,
- SVN_CL_NOTIFY(opt_state),
- svn_cl__make_notify_baton (pool),
+ notify_func, notify_baton,
pool));
return SVN_NO_ERROR;
Index: ./subversion/clients/cmdline/delete-cmd.c
===================================================================
--- ./subversion/clients/cmdline/delete-cmd.c
+++ ./subversion/clients/cmdline/delete-cmd.c Mon Jun 10 18:09:08 2002
@@ -69,6 +69,11 @@
if (targets->nelts)
{
apr_pool_t *subpool = svn_pool_create (pool);
+ svn_wc_notify_func_t notify_func = NULL;
+ void *notify_baton = NULL;
+
+ if (! opt_state->quiet)
+ svn_cl__get_notifier (¬ify_func, ¬ify_baton, FALSE, FALSE, pool);
for (i = 0; i < targets->nelts; i++)
{
@@ -80,9 +85,7 @@
auth_baton,
&svn_cl__get_log_message,
svn_cl__make_log_msg_baton (opt_state, NULL, subpool),
- SVN_CL_NOTIFY(opt_state),
- svn_cl__make_notify_baton (subpool),
- subpool);
+ notify_func, notify_baton, subpool);
if (err)
return svn_cl__may_need_force (err);
if (commit_info)
Index: ./subversion/clients/cmdline/import-cmd.c
===================================================================
--- ./subversion/clients/cmdline/import-cmd.c
+++ ./subversion/clients/cmdline/import-cmd.c Tue Jun 11 17:13:53 2002
@@ -42,11 +42,11 @@
const char *path;
const char *url;
const char *new_entry;
- const svn_delta_editor_t *trace_editor;
- void *trace_edit_baton;
svn_client_auth_baton_t *auth_baton;
svn_client_commit_info_t *commit_info = NULL;
svn_revnum_t revnum;
+ svn_wc_notify_func_t notify_func = NULL;
+ void *notify_baton = NULL;
/* Build an authentication object to give to libsvn_client. */
auth_baton = svn_cl__make_auth_baton (opt_state, pool);
@@ -108,27 +108,19 @@
(SVN_ERR_CL_ARG_PARSING_ERROR, 0, NULL, pool,
"too many arguments to import command");
- /* Because we're working outside the context of a working copy, we
- don't want the trace_editor to print out the 'local' paths like
- it normally does. This leads to very confusing output. Instead,
- for consistency, it will print those paths being added in the
- repository, completely ignoring the local source. */
- SVN_ERR (svn_cl__get_trace_commit_editor (&trace_editor,
- &trace_edit_baton,
- NULL,
- pool));
-
/* Get revnum set to something meaningful, to cover the xml case. */
if (opt_state->start_revision.kind == svn_client_revision_number)
revnum = opt_state->start_revision.value.number;
else
revnum = SVN_INVALID_REVNUM; /* no matter, this is fine */
+ if (! opt_state->quiet)
+ svn_cl__get_notifier (¬ify_func, ¬ify_baton,
+ FALSE, FALSE, pool);
+
SVN_ERR (svn_client_import
(&commit_info,
- NULL, NULL,
- opt_state->quiet ? NULL : trace_editor,
- opt_state->quiet ? NULL : trace_edit_baton,
+ notify_func, notify_baton,
auth_baton,
path,
url,
Index: ./subversion/clients/cmdline/resolve-cmd.c
===================================================================
--- ./subversion/clients/cmdline/resolve-cmd.c
+++ ./subversion/clients/cmdline/resolve-cmd.c Mon Jun 10 18:08:34 2002
@@ -49,13 +49,16 @@
if (targets->nelts)
{
apr_pool_t *subpool = svn_pool_create (pool);
+ svn_wc_notify_func_t notify_func = NULL;
+ void *notify_baton = NULL;
+
+ if (! opt_state->quiet)
+ svn_cl__get_notifier (¬ify_func, ¬ify_baton, FALSE, FALSE, pool);
for (i = 0; i < targets->nelts; i++)
{
const char *target = ((const char **) (targets->elts))[i];
- err = svn_client_resolve (target,
- SVN_CL_NOTIFY(opt_state),
- svn_cl__make_notify_baton (subpool),
+ err = svn_client_resolve (target, notify_func, notify_baton,
subpool);
if (err)
{
Index: ./subversion/clients/cmdline/feedback.c
===================================================================
--- ./subversion/clients/cmdline/feedback.c
+++ ./subversion/clients/cmdline/feedback.c Tue Jun 11 17:12:18 2002
@@ -32,18 +32,21 @@
#include "cl.h"
+/* Baton for notify and friends. */
struct notify_baton
{
- apr_pool_t *pool;
+ svn_boolean_t received_some_change;
+ svn_boolean_t is_checkout;
+ svn_boolean_t suppress_final_line;
svn_boolean_t sent_first_txdelta;
+ apr_pool_t *pool;
};
+
static void
-notify_added (void *baton, const char *path)
+notify_added (struct notify_baton *nb, const char *path)
{
- struct notify_baton *nb = (struct notify_baton *) baton;
-
/* the pool (BATON) is typically the global pool; don't keep filling it */
apr_pool_t *subpool = svn_pool_create (nb->pool);
svn_wc_entry_t *entry;
@@ -90,136 +93,41 @@
}
+/* This implements `svn_wc_notify_func_t'. */
static void
-notify_commit_postfix_txdelta (void *baton,
- const char *path)
+notify (void *baton,
+ const char *path,
+ svn_wc_notify_action_t action,
+ svn_node_kind_t kind,
+ svn_wc_notify_state_t content_state,
+ svn_wc_notify_state_t prop_state,
+ svn_revnum_t revision)
{
- struct notify_baton *nb = (struct notify_baton *) baton;
-
- if (! nb->sent_first_txdelta)
- {
- printf ("Transmitting file data ");
- nb->sent_first_txdelta = TRUE;
- }
-
- printf (".");
- fflush (stdout);
-}
-
-
-void
-svn_cl__notify_func (void *baton,
- const char *path,
- svn_wc_notify_action_t action,
- svn_node_kind_t kind,
- svn_wc_notify_state_t text_state,
- svn_wc_notify_state_t prop_state,
- svn_revnum_t revision)
-{
- /* Note that KIND, TEXT_STATE, PROP_STATE, and REVISION are ignored
- by this implementation. */
+ struct notify_baton *nb = baton;
+ char statchar_buf[3] = "_ ";
switch (action)
{
- case svn_wc_notify_add:
- notify_added (baton, path);
- return;
-
case svn_wc_notify_delete:
+ nb->received_some_change = TRUE;
printf ("D %s\n", path);
- return;
+ break;
case svn_wc_notify_restore:
printf ("Restored %s\n", path);
- return;
+ break;
case svn_wc_notify_revert:
printf ("Reverted %s\n", path);
- return;
+ break;
case svn_wc_notify_resolve:
printf ("Resolved conflicted state of %s\n", path);
- return;
-
- case svn_wc_notify_update:
- printf ("U %s\n", path);
- return;
-
- case svn_wc_notify_commit_modified:
- printf ("Sending %s\n", path);
- return;
-
- case svn_wc_notify_commit_added:
- printf ("Adding %s\n", path);
- return;
-
- case svn_wc_notify_commit_deleted:
- printf ("Deleting %s\n", path);
- return;
-
- case svn_wc_notify_commit_replaced:
- printf ("Replacing %s\n", path);
- return;
-
- case svn_wc_notify_commit_postfix_txdelta:
- notify_commit_postfix_txdelta (baton, path);
- return;
-
- default:
- break;
- }
-}
-
-
-void *
-svn_cl__make_notify_baton (apr_pool_t *pool)
-{
- struct notify_baton *nb = apr_palloc (pool, sizeof(*nb));
-
- nb->pool = pool;
- nb->sent_first_txdelta = 0;
-
- return nb;
-}
-
-
-/*** Notifiers for checkout. ***/
-
-/* ### This should handle update/switch, as well as checkouts;
- see http://subversion.tigris.org/issues/show_bug.cgi?id=662. */
-
-/* Baton for checkout/update/switche notification. */
-struct update_notify_baton
-{
- svn_boolean_t received_some_change;
- svn_boolean_t is_checkout;
- svn_boolean_t suppress_final_line;
- apr_pool_t *pool;
-};
-
-
-/* This implements `svn_wc_notify_func_t'. */
-static void
-update_notify (void *baton,
- const char *path,
- svn_wc_notify_action_t action,
- svn_node_kind_t kind,
- svn_wc_notify_state_t text_state,
- svn_wc_notify_state_t prop_state,
- svn_revnum_t revision)
-{
- struct update_notify_baton *ub = baton;
- char statchar_buf[3] = "_ ";
-
- switch (action)
- {
- case svn_wc_notify_delete:
- ub->received_some_change = TRUE;
- printf ("D %s\n", path);
break;
case svn_wc_notify_add:
- ub->received_some_change = TRUE;
+ nb->received_some_change = TRUE;
+ /* ### notify_added (nb, path); */
if (kind == svn_node_dir)
{
printf ("A %s\n", path);
@@ -233,18 +141,18 @@
case svn_wc_notify_update:
/* note: maybe fell thru from above case */
- ub->received_some_change = TRUE;
+ /* ### printf ("U %s\n", path); */
+
+ nb->received_some_change = TRUE;
if ((kind == svn_node_file) && (action == svn_wc_notify_update))
{
- if (text_state == svn_wc_notify_state_conflicted)
+ if (content_state == svn_wc_notify_state_conflicted)
statchar_buf[0] = 'C';
- else if (text_state == svn_wc_notify_state_merged)
+ else if (content_state == svn_wc_notify_state_merged)
statchar_buf[0] = 'G';
- else if (text_state == svn_wc_notify_state_modified)
- {
- statchar_buf[0] = 'U';
- }
+ else if (content_state == svn_wc_notify_state_modified)
+ statchar_buf[0] = 'U';
}
if (prop_state == svn_wc_notify_state_conflicted)
@@ -263,16 +171,16 @@
case svn_wc_notify_update_completed:
{
- if (! ub->suppress_final_line)
+ if (! nb->suppress_final_line)
{
if (SVN_IS_VALID_REVNUM (revision))
{
- if (ub->is_checkout)
+ if (nb->is_checkout)
printf ("Checked out revision %" SVN_REVNUM_T_FMT ".\n",
revision);
else
{
- if (ub->received_some_change)
+ if (nb->received_some_change)
printf ("Updated to revision %" SVN_REVNUM_T_FMT ".\n",
revision);
else
@@ -282,7 +190,7 @@
}
else /* no revision */
{
- if (ub->is_checkout)
+ if (nb->is_checkout)
printf ("Checkout complete.\n");
else
printf ("Update complete\n");
@@ -292,6 +200,47 @@
break;
+ case svn_wc_notify_commit_modified:
+ /* ### trace-commit.c has:
+ printf ("Sending %s\n", db->path);
+ */
+ printf ("Sending %s\n", path);
+ break;
+
+ case svn_wc_notify_commit_added:
+#if 0
+ fooo;
+ /* The actual code from trace-commit.c's close_directory() was: */
+ if (vp == ITEM_ADDED)
+ printf ("Adding %s\n", db->path);
+ else if (db->prop_changed)
+ printf ("Sending %s\n", db->path);
+#endif /* 0 */
+
+ /* ### trace-commit.c has:
+ printf ("Adding %s\n", path); */
+ printf ("Adding %s\n", path);
+ break;
+
+ case svn_wc_notify_commit_deleted:
+ printf ("Deleting %s\n", path);
+ break;
+
+ case svn_wc_notify_commit_replaced:
+ printf ("Replacing %s\n", path);
+ break;
+
+ case svn_wc_notify_commit_postfix_txdelta:
+ if (! nb->sent_first_txdelta)
+ {
+ printf ("Transmitting file data ");
+ nb->sent_first_txdelta = TRUE;
+ }
+
+ printf (".");
+ fflush (stdout);
+ break;
+
default:
break;
}
@@ -299,21 +248,22 @@
void
-svn_cl__get_checkout_notifier (svn_wc_notify_func_t *notify_func_p,
- void **notify_baton_p,
- svn_boolean_t is_checkout,
- svn_boolean_t suppress_final_line,
- apr_pool_t *pool)
-{
- struct update_notify_baton *ub = apr_palloc (pool, sizeof (*ub));
-
- ub->received_some_change = FALSE;
- ub->is_checkout = is_checkout;
- ub->suppress_final_line = suppress_final_line;
- ub->pool = pool;
+svn_cl__get_notifier (svn_wc_notify_func_t *notify_func_p,
+ void **notify_baton_p,
+ svn_boolean_t is_checkout,
+ svn_boolean_t suppress_final_line,
+ apr_pool_t *pool)
+{
+ struct notify_baton *nb = apr_palloc (pool, sizeof (*nb));
+
+ nb->received_some_change = FALSE;
+ nb->sent_first_txdelta = FALSE;
+ nb->is_checkout = is_checkout;
+ nb->suppress_final_line = suppress_final_line;
+ nb->pool = pool;
- *notify_func_p = update_notify;
- *notify_baton_p = ub;
+ *notify_func_p = notify;
+ *notify_baton_p = nb;
}
Index: ./subversion/clients/cmdline/trace-commit.c
===================================================================
--- ./subversion/clients/cmdline/trace-commit.c
+++ ./subversion/clients/cmdline/trace-commit.c Tue Jun 11 18:34:04 2002
@@ -24,6 +24,7 @@
/*** Includes. ***/
+#if 0 /* now unused, left only for reference */
#define APR_WANT_STDIO
#define APR_WANT_STRFUNC
#include <apr_want.h>
@@ -472,7 +473,7 @@
return SVN_NO_ERROR;
}
-
+#endif /* 0 */
/*
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Jun 12 01:17:59 2002