|
svn commit: r13134 - in branches/locking/subversion: include libsvn_client : msg#00310version-control.subversion.svn
Author: lundblad Date: Thu Feb 24 06:14:18 2005 New Revision: 13134 Modified: branches/locking/subversion/include/svn_ra.h branches/locking/subversion/include/svn_wc.h branches/locking/subversion/libsvn_client/diff.c branches/locking/subversion/libsvn_client/export.c branches/locking/subversion/libsvn_client/status.c branches/locking/subversion/libsvn_client/switch.c branches/locking/subversion/libsvn_client/update.c branches/locking/subversion/libsvn_ra/ra_loader.c branches/locking/subversion/libsvn_ra/ra_loader.h branches/locking/subversion/libsvn_ra/wrapper_template.h branches/locking/subversion/libsvn_ra_dav/fetch.c branches/locking/subversion/libsvn_ra_dav/ra_dav.h branches/locking/subversion/libsvn_ra_local/ra_plugin.c branches/locking/subversion/libsvn_ra_svn/client.c branches/locking/subversion/libsvn_ra_svn/protocol branches/locking/subversion/libsvn_wc/adm_crawler.c Log: Locking branch: Change RA reporter to accept lock tokens. Update RA functions and the WC crawling to handle this. Pass lock tokens through in ra_local and ra_svn (not in svnserve yet). ra_dav and mod_dav are to be done. * subversion/include/svn_ra.h (svn_ra_reporter2_t): New typedef. Add lock_token argument to link_path and set_path functions. (svn_ra_reporter_t): Deprecate. (svn_ra_do_update, svn_ra_do_switch, svn_ra_do_status, svn_ra_do_diff): Take new reporter instead of old. * subversion/libsvn_ra/wrapper_template.h (compat_report_baton): New struct. (compat_set_path, compat_delete_path, compat_link_path, compat_finish_report, compat_abort_report, compat_wrap_reporter): New functions. (compat_reporter): New static variable. (compat_do_update, compat_do_status, compat_do_switch, compat_do_diff): Adapt to the new vtable API and wrap the reporter. * subversion/libsvn_ra/ra_loader.c (svn_ra_do_update, svn_ra_do_switch, svn_ra_do_status, svn_ra_do_diff): Replace svn_ra_reporter_t with new reporter. * subversion/libsvn_ra/ra_loader.h (svn_ra_vtable_t): Replace old reporter with new in functions taking a reproter. * subversion/include/svn_wc.h (svn_wc_crawl_revisions2): New function, taking an svn_ra_reporter2_t instead of hte old reporter. Doc fix. (svn_wc_crawl_revisions): Deprecate. * subversion/libsvn_wc/adm_crawler.c (report_revisions): Take new reporter Report lock tokens. (svn_wc_crawl_revisions2): New, from svn_wc_crawl_revisions. Report lock tokens (or the absence thereof). (wrap_report_baton): New struct. (wrap_set_path, wrap_delete_path, wrap_link_path, wrap_finish_report, wrap_abort_report): New functions. (wrap_reporter): New static variable. (svn_wc_crawl_revisions): Wrap new function above. * subversion/libsvn_ra_local/ra_plugin.c (reporter_set_path, reporter_link_path): Take new lock token argument and call new repository function. (ra_local_reporter): Change type to svn_ra_reporter2_t. (make_reporter, svn_ra_local__do_update, svn_ra_local__do_switch, svn_ra_local__do_status, svn_ra_local__do_diff): Change argument type of reporter to svn_ra_reporter2_t. * subversion/libsvn_ra_svn/client.c (ra_svn_set_path, ra_svn_link_path): Take lock_token argument and pass to the server. (ra_svn_reporter): Change type to new reporter. (ra_svn_get_reporter, ra_svn_update, ra_svn_switch, ra_svn_status, ra_svn_diff): Take new reporter argument. * subversion/libsvn_ra_svn/protocol (set-path and link-path commands): Add lock-token parameter. * subversion/libsvn_ra_dav/ra_dav.h (svn_ra_dav__do_update, svn_ra_dav__do_switch, svn_ra_dav__do_status, svn_ra_dav__do_diff): Change type of reporter argument. * subversion/libsvn_ra_dav/fetch.c (reporter_set_path, reporter_link_path): Take lock_token argument, leave TODO for sussman:-) (ra_dav_reporter): Change type to svn_ra_reporter2_t. (make_reporter, svn_ra_dav__do_update, svn_ra_dav__do_switch, svn_ra_dav__do_status, svn_ra_dav__do_diff): Change argument type to new reporter. * subversion/libsvn_client/switch.c (svn_client_switch), * subversion/libsvn_client/export.c (svn_client_export3), * subversion/libsvn_client/status.c (svn_client_status2), * subversion/libsvn_client/diff.c (do_merge, diff_repos_repos, diff_repos_wc), * subversion/libsvn_client/update.c (svn_client__update_internal): Use new APIs. Modified: branches/locking/subversion/include/svn_ra.h Url: http://svn.collab.net/viewcvs/svn/branches/locking/subversion/include/svn_ra.h?view=diff&rev=13134&p1=branches/locking/subversion/include/svn_ra.h&r1=13133&p2=branches/locking/subversion/include/svn_ra.h&r2=13134 ============================================================================== --- branches/locking/subversion/include/svn_ra.h (original) +++ branches/locking/subversion/include/svn_ra.h Thu Feb 24 06:14:18 2005 @@ -143,7 +143,9 @@ apr_pool_t *pool); -/** The update Reporter. +/** @since New in 1.2. + * + * The update Reporter. * * A vtable structure which allows a working copy to describe a subset * (or possibly all) of its working-copy to an RA layer, for the @@ -164,7 +166,7 @@ * it may be reported as having revision 0 or as having the parent * directory's revision. */ -typedef struct svn_ra_reporter_t +typedef struct svn_ra_reporter2_t { /** Describe a working copy @a path as being at a particular @a revision. * @@ -174,12 +176,15 @@ * This will *override* any previous @c set_path() calls made on parent * paths. @a path is relative to the URL specified in @c open(). * + * If @a lock_token is non-NULL, it is the lock token for @a path in the WC. + * * All temporary allocations are done in @a pool. */ svn_error_t *(*set_path) (void *report_baton, const char *path, svn_revnum_t revision, svn_boolean_t start_empty, + const char *lock_token, apr_pool_t *pool); /** Describing a working copy @a path as missing. @@ -199,6 +204,8 @@ * If @a START_EMPTY is set and @a path is a directory, * the implementor should assume the directory has no entries or props. * + * If @a lock_token is non-NULL, it is the lock token for @a path in the WC. + * * All temporary allocations are done in @a pool. */ svn_error_t *(*link_path) (void *report_baton, @@ -206,6 +213,7 @@ const char *url, svn_revnum_t revision, svn_boolean_t start_empty, + const char *lock_token, apr_pool_t *pool); /** WC calls this when the state report is finished; any directories @@ -221,8 +229,44 @@ svn_error_t *(*abort_report) (void *report_baton, apr_pool_t *pool); -} svn_ra_reporter_t; +} svn_ra_reporter2_t; + +/** @deprecated Provided for backward compatibility with the 1.1 API. + * + * Similar to @c svn_ra_reporter2_t, but without support for lock tokens. + */ +typedef struct svn_ra_reporter_t +{ + /** Similar to the correspoinding field in @c svn_ra_reporter2_t, but + * with @a lock_token always set to NULL. */ + svn_error_t *(*set_path) (void *report_baton, + const char *path, + svn_revnum_t revision, + svn_boolean_t start_empty, + apr_pool_t *pool); + + /** Same as the correspondning field in @c svn_ra_reporter2_t. */ + svn_error_t *(*delete_path) (void *report_baton, + const char *path, + apr_pool_t *pool); + + /** Similar to the correspoinding field in @c svn_ra_reporter2_t, but + * with @a lock_token always set to NULL. */ + svn_error_t *(*link_path) (void *report_baton, + const char *path, + const char *url, + svn_revnum_t revision, + svn_boolean_t start_empty, + apr_pool_t *pool); + + /** Same as the correspondning field in @c svn_ra_reporter2_t. */ + svn_error_t *(*finish_report) (void *report_baton, + apr_pool_t *pool); + /** Same as the correspondning field in @c svn_ra_reporter2_t. */ + svn_error_t *(*abort_report) (void *report_baton, + apr_pool_t *pool); +} svn_ra_reporter_t; /** A collection of callbacks implemented by libsvn_client which allows @@ -525,7 +569,7 @@ * Use @a pool for memory allocation. */ svn_error_t *svn_ra_do_update (svn_ra_session_t *session, - const svn_ra_reporter_t **reporter, + const svn_ra_reporter2_t **reporter, void **report_baton, svn_revnum_t revision_to_update_to, const char *update_target, @@ -573,7 +617,7 @@ * Use @a pool for memory allocation. */ svn_error_t *svn_ra_do_switch (svn_ra_session_t *session, - const svn_ra_reporter_t **reporter, + const svn_ra_reporter2_t **reporter, void **report_baton, svn_revnum_t revision_to_switch_to, const char *switch_target, @@ -618,7 +662,7 @@ * Use @a pool for memory allocation. */ svn_error_t *svn_ra_do_status (svn_ra_session_t *session, - const svn_ra_reporter_t **reporter, + const svn_ra_reporter2_t **reporter, void **report_baton, const char *status_target, svn_revnum_t revision, @@ -676,7 +720,7 @@ * Use @a pool for memory allocation. */ svn_error_t *svn_ra_do_diff (svn_ra_session_t *session, - const svn_ra_reporter_t **reporter, + const svn_ra_reporter2_t **reporter, void **report_baton, svn_revnum_t revision, const char *diff_target, Modified: branches/locking/subversion/include/svn_wc.h Url: http://svn.collab.net/viewcvs/svn/branches/locking/subversion/include/svn_wc.h?view=diff&rev=13134&p1=branches/locking/subversion/include/svn_wc.h&r1=13133&p2=branches/locking/subversion/include/svn_wc.h&r2=13134 ============================================================================== --- branches/locking/subversion/include/svn_wc.h (original) +++ branches/locking/subversion/include/svn_wc.h Thu Feb 24 06:14:18 2005 @@ -1778,7 +1778,9 @@ -/** Do a depth-first crawl in a working copy, beginning at @a path. +/** @since New in 1.2. + * + * Do a depth-first crawl in a working copy, beginning at @a path. * * Communicate the `state' of the working copy's revisions to * @a reporter/@a report_baton. Obviously, if @a path is a file instead @@ -1804,6 +1806,23 @@ * If @a traversal_info is non-null, then record pre-update traversal * state in it. (Caller should obtain @a traversal_info from * @c svn_wc_init_traversal_info.) + */ +svn_error_t * +svn_wc_crawl_revisions2 (const char *path, + svn_wc_adm_access_t *adm_access, + const svn_ra_reporter2_t *reporter, + void *report_baton, + svn_boolean_t restore_files, + svn_boolean_t recurse, + svn_boolean_t use_commit_times, + svn_wc_notify_func_t notify_func, + void *notify_baton, + svn_wc_traversal_info_t *traversal_info, + apr_pool_t *pool); + +/** @deprecated Provided for backwards compatibility with the 1.1 API. + * + * Similar to svn_wc_crawl_revisions2, but taking an @c svn_ra_reporter_t. */ svn_error_t * svn_wc_crawl_revisions (const char *path, Modified: branches/locking/subversion/libsvn_client/diff.c Url: http://svn.collab.net/viewcvs/svn/branches/locking/subversion/libsvn_client/diff.c?view=diff&rev=13134&p1=branches/locking/subversion/libsvn_client/diff.c&r1=13133&p2=branches/locking/subversion/libsvn_client/diff.c&r2=13134 ============================================================================== --- branches/locking/subversion/libsvn_client/diff.c (original) +++ branches/locking/subversion/libsvn_client/diff.c Thu Feb 24 06:14:18 2005 @@ -1419,7 +1419,7 @@ { svn_revnum_t start_revnum, end_revnum; svn_ra_session_t *ra_session, *ra_session2; - const svn_ra_reporter_t *reporter; + const svn_ra_reporter2_t *reporter; void *report_baton; const svn_delta_editor_t *diff_editor; void *diff_edit_baton; @@ -1511,7 +1511,8 @@ URL2, diff_editor, diff_edit_baton, pool)); - SVN_ERR (reporter->set_path (report_baton, "", start_revnum, FALSE, pool)); + SVN_ERR (reporter->set_path (report_baton, "", start_revnum, FALSE, NULL, + pool)); SVN_ERR (reporter->finish_report (report_baton, pool)); @@ -1790,7 +1791,7 @@ svn_node_kind_t kind1, kind2; svn_revnum_t rev1, rev2; svn_ra_session_t *ra_session1, *ra_session2; - const svn_ra_reporter_t *reporter; + const svn_ra_reporter2_t *reporter; void *report_baton; const svn_delta_editor_t *diff_editor; void *diff_edit_baton; @@ -1915,7 +1916,7 @@ diff_editor, diff_edit_baton, pool)); /* Drive the reporter; do the diff. */ - SVN_ERR (reporter->set_path (report_baton, "", rev1, FALSE, pool)); + SVN_ERR (reporter->set_path (report_baton, "", rev1, FALSE, NULL, pool)); SVN_ERR (reporter->finish_report (report_baton, pool)); return SVN_NO_ERROR; @@ -1952,7 +1953,7 @@ const svn_wc_entry_t *entry; svn_revnum_t rev; svn_ra_session_t *ra_session; - const svn_ra_reporter_t *reporter; + const svn_ra_reporter2_t *reporter; void *report_baton; const svn_delta_editor_t *diff_editor; void *diff_edit_baton; @@ -2033,11 +2034,11 @@ /* Create a txn mirror of path2; the diff editor will print diffs in reverse. :-) */ - SVN_ERR (svn_wc_crawl_revisions (path2, dir_access, - reporter, report_baton, - FALSE, recurse, FALSE, - NULL, NULL, /* notification is N/A */ - NULL, pool)); + SVN_ERR (svn_wc_crawl_revisions2 (path2, dir_access, + reporter, report_baton, + FALSE, recurse, FALSE, + NULL, NULL, /* notification is N/A */ + NULL, pool)); SVN_ERR (svn_wc_adm_close (adm_access)); return SVN_NO_ERROR; Modified: branches/locking/subversion/libsvn_client/export.c Url: http://svn.collab.net/viewcvs/svn/branches/locking/subversion/libsvn_client/export.c?view=diff&rev=13134&p1=branches/locking/subversion/libsvn_client/export.c&r1=13133&p2=branches/locking/subversion/libsvn_client/export.c&r2=13134 ============================================================================== --- branches/locking/subversion/libsvn_client/export.c (original) +++ branches/locking/subversion/libsvn_client/export.c Thu Feb 24 06:14:18 2005 @@ -824,7 +824,7 @@ { void *edit_baton; const svn_delta_editor_t *export_editor; - const svn_ra_reporter_t *reporter; + const svn_ra_reporter2_t *reporter; void *report_baton; svn_delta_editor_t *editor = svn_delta_default_editor (pool); svn_boolean_t use_sleep = FALSE; @@ -857,7 +857,7 @@ SVN_ERR (reporter->set_path (report_baton, "", revnum, TRUE, /* "help, my dir is empty!" */ - pool)); + NULL, pool)); SVN_ERR (reporter->finish_report (report_baton, pool)); Modified: branches/locking/subversion/libsvn_client/status.c Url: http://svn.collab.net/viewcvs/svn/branches/locking/subversion/libsvn_client/status.c?view=diff&rev=13134&p1=branches/locking/subversion/libsvn_client/status.c&r1=13133&p2=branches/locking/subversion/libsvn_client/status.c&r2=13134 ============================================================================== --- branches/locking/subversion/libsvn_client/status.c (original) +++ branches/locking/subversion/libsvn_client/status.c Thu Feb 24 06:14:18 2005 @@ -119,7 +119,7 @@ { void *report_baton; svn_ra_session_t *ra_session; - const svn_ra_reporter_t *reporter; + const svn_ra_reporter2_t *reporter; const char *URL; svn_node_kind_t kind; @@ -186,9 +186,9 @@ within PATH. When we call reporter->finish_report, EDITOR will be driven to describe differences between our working copy and HEAD. */ - SVN_ERR (svn_wc_crawl_revisions (path, target_access, reporter, - report_baton, FALSE, descend, - FALSE, NULL, NULL, NULL, pool)); + SVN_ERR (svn_wc_crawl_revisions2 (path, target_access, reporter, + report_baton, FALSE, descend, + FALSE, NULL, NULL, NULL, pool)); } } else Modified: branches/locking/subversion/libsvn_client/switch.c Url: http://svn.collab.net/viewcvs/svn/branches/locking/subversion/libsvn_client/switch.c?view=diff&rev=13134&p1=branches/locking/subversion/libsvn_client/switch.c&r1=13133&p2=branches/locking/subversion/libsvn_client/switch.c&r2=13134 ============================================================================== --- branches/locking/subversion/libsvn_client/switch.c (original) +++ branches/locking/subversion/libsvn_client/switch.c Thu Feb 24 06:14:18 2005 @@ -59,7 +59,7 @@ svn_client_ctx_t *ctx, apr_pool_t *pool) { - const svn_ra_reporter_t *reporter; + const svn_ra_reporter2_t *reporter; void *report_baton; const svn_wc_entry_t *entry; const char *URL, *anchor, *target; @@ -147,11 +147,11 @@ We pass NULL for traversal_info because this is a switch, not an update, and therefore we don't want to handle any externals except the ones directly affected by the switch. */ - err = svn_wc_crawl_revisions (path, dir_access, reporter, report_baton, - TRUE, recurse, use_commit_times, - ctx->notify_func, ctx->notify_baton, - NULL, /* no traversal info */ - pool); + err = svn_wc_crawl_revisions2 (path, dir_access, reporter, report_baton, + TRUE, recurse, use_commit_times, + ctx->notify_func, ctx->notify_baton, + NULL, /* no traversal info */ + pool); /* We handle externals after the switch is complete, so that handling external items (and any errors therefrom) doesn't delay Modified: branches/locking/subversion/libsvn_client/update.c Url: http://svn.collab.net/viewcvs/svn/branches/locking/subversion/libsvn_client/update.c?view=diff&rev=13134&p1=branches/locking/subversion/libsvn_client/update.c&r1=13133&p2=branches/locking/subversion/libsvn_client/update.c&r2=13134 ============================================================================== --- branches/locking/subversion/libsvn_client/update.c (original) +++ branches/locking/subversion/libsvn_client/update.c Thu Feb 24 06:14:18 2005 @@ -50,7 +50,7 @@ { const svn_delta_editor_t *update_editor; void *update_edit_baton; - const svn_ra_reporter_t *reporter; + const svn_ra_reporter2_t *reporter; void *report_baton; const svn_wc_entry_t *entry; const char *anchor, *target; @@ -134,10 +134,10 @@ /* Drive the reporter structure, describing the revisions within PATH. When we call reporter->finish_report, the update_editor will be driven by svn_repos_dir_delta. */ - err = svn_wc_crawl_revisions (path, dir_access, reporter, report_baton, - TRUE, recurse, use_commit_times, - ctx->notify_func, ctx->notify_baton, - traversal_info, pool); + err = svn_wc_crawl_revisions2 (path, dir_access, reporter, report_baton, + TRUE, recurse, use_commit_times, + ctx->notify_func, ctx->notify_baton, + traversal_info, pool); if (err) { Modified: branches/locking/subversion/libsvn_ra/ra_loader.c Url: http://svn.collab.net/viewcvs/svn/branches/locking/subversion/libsvn_ra/ra_loader.c?view=diff&rev=13134&p1=branches/locking/subversion/libsvn_ra/ra_loader.c&r1=13133&p2=branches/locking/subversion/libsvn_ra/ra_loader.c&r2=13134 ============================================================================== --- branches/locking/subversion/libsvn_ra/ra_loader.c (original) +++ branches/locking/subversion/libsvn_ra/ra_loader.c Thu Feb 24 06:14:18 2005 @@ -355,7 +355,7 @@ } svn_error_t *svn_ra_do_update (svn_ra_session_t *session, - const svn_ra_reporter_t **reporter, + const svn_ra_reporter2_t **reporter, void **report_baton, svn_revnum_t revision_to_update_to, const char *update_target, @@ -371,7 +371,7 @@ } svn_error_t *svn_ra_do_switch (svn_ra_session_t *session, - const svn_ra_reporter_t **reporter, + const svn_ra_reporter2_t **reporter, void **report_baton, svn_revnum_t revision_to_switch_to, const char *switch_target, @@ -388,7 +388,7 @@ } svn_error_t *svn_ra_do_status (svn_ra_session_t *session, - const svn_ra_reporter_t **reporter, + const svn_ra_reporter2_t **reporter, void **report_baton, const char *status_target, svn_revnum_t revision, @@ -403,7 +403,7 @@ } svn_error_t *svn_ra_do_diff (svn_ra_session_t *session, - const svn_ra_reporter_t **reporter, + const svn_ra_reporter2_t **reporter, void **report_baton, svn_revnum_t revision, const char *diff_target, Modified: branches/locking/subversion/libsvn_ra/ra_loader.h Url: http://svn.collab.net/viewcvs/svn/branches/locking/subversion/libsvn_ra/ra_loader.h?view=diff&rev=13134&p1=branches/locking/subversion/libsvn_ra/ra_loader.h&r1=13133&p2=branches/locking/subversion/libsvn_ra/ra_loader.h&r2=13134 ============================================================================== --- branches/locking/subversion/libsvn_ra/ra_loader.h (original) +++ branches/locking/subversion/libsvn_ra/ra_loader.h Thu Feb 24 06:14:18 2005 @@ -100,7 +100,7 @@ apr_hash_t **props, apr_pool_t *pool); svn_error_t *(*do_update) (svn_ra_session_t *session, - const svn_ra_reporter_t **reporter, + const svn_ra_reporter2_t **reporter, void **report_baton, svn_revnum_t revision_to_update_to, const char *update_target, @@ -109,7 +109,7 @@ void *update_baton, apr_pool_t *pool); svn_error_t *(*do_switch) (svn_ra_session_t *session, - const svn_ra_reporter_t **reporter, + const svn_ra_reporter2_t **reporter, void **report_baton, svn_revnum_t revision_to_switch_to, const char *switch_target, @@ -119,7 +119,7 @@ void *switch_baton, apr_pool_t *pool); svn_error_t *(*do_status) (svn_ra_session_t *session, - const svn_ra_reporter_t **reporter, + const svn_ra_reporter2_t **reporter, void **report_baton, const char *status_target, svn_revnum_t revision, @@ -128,7 +128,7 @@ void *status_baton, apr_pool_t *pool); svn_error_t *(*do_diff) (svn_ra_session_t *session, - const svn_ra_reporter_t **reporter, + const svn_ra_reporter2_t **reporter, void **report_baton, svn_revnum_t revision, const char *diff_target, Modified: branches/locking/subversion/libsvn_ra/wrapper_template.h Url: http://svn.collab.net/viewcvs/svn/branches/locking/subversion/libsvn_ra/wrapper_template.h?view=diff&rev=13134&p1=branches/locking/subversion/libsvn_ra/wrapper_template.h&r1=13133&p2=branches/locking/subversion/libsvn_ra/wrapper_template.h&r2=13134 ============================================================================== --- branches/locking/subversion/libsvn_ra/wrapper_template.h (original) +++ branches/locking/subversion/libsvn_ra/wrapper_template.h Thu Feb 24 06:14:18 2005 @@ -135,6 +135,83 @@ props, pool); } +struct compat_report_baton { + const svn_ra_reporter2_t *reporter; + void *baton; +}; + +static svn_error_t *compat_set_path (void *report_baton, + const char *path, + svn_revnum_t revision, + svn_boolean_t start_empty, + apr_pool_t *pool) +{ + struct compat_report_baton *crb = report_baton; + + return crb->reporter->set_path (crb->baton, path, revision, start_empty, + NULL, pool); +} + +static svn_error_t *compat_delete_path (void *report_baton, + const char *path, + apr_pool_t *pool) +{ + struct compat_report_baton *crb = report_baton; + + return crb->reporter->delete_path (crb->baton, path, pool); +} + +svn_error_t *compat_link_path (void *report_baton, + const char *path, + const char *url, + svn_revnum_t revision, + svn_boolean_t start_empty, + apr_pool_t *pool) +{ + struct compat_report_baton *crb = report_baton; + + return crb->reporter->link_path (crb->baton, path, url, revision, + start_empty, NULL, pool); +} + +static svn_error_t *compat_finish_report (void *report_baton, + apr_pool_t *pool) +{ + struct compat_report_baton *crb = report_baton; + + return crb->reporter->finish_report (crb->baton, pool); +} + +static svn_error_t *compat_abort_report (void *report_baton, + apr_pool_t *pool) +{ + struct compat_report_baton *crb = report_baton; + + return crb->reporter->abort_report (crb->baton, pool); +} + +static const svn_ra_reporter_t compat_reporter = { + compat_set_path, + compat_delete_path, + compat_link_path, + compat_finish_report, + compat_abort_report +}; + +static void compat_wrap_reporter (const svn_ra_reporter_t **reporter, + void **baton, + const svn_ra_reporter2_t *wrapped, + void *wrapped_baton, + apr_pool_t *pool) +{ + struct compat_report_baton *crb = apr_palloc (pool, sizeof (*crb)); + crb->reporter = wrapped; + crb->baton = wrapped_baton; + + *reporter = &compat_reporter; + *baton = crb; +} + static svn_error_t *compat_do_update (void *session_baton, const svn_ra_reporter_t **reporter, void **report_baton, @@ -145,9 +222,14 @@ void *update_baton, apr_pool_t *pool) { - return VTBL.do_update (session_baton, reporter, report_baton, - revision_to_update_to, update_target, recurse, - editor, update_baton, pool); + const svn_ra_reporter2_t *reporter2; + void *baton2; + SVN_ERR (VTBL.do_update (session_baton, &reporter2, &baton2, + revision_to_update_to, update_target, recurse, + editor, update_baton, pool)); + compat_wrap_reporter (reporter, report_baton, reporter2, baton2, pool); + + return SVN_NO_ERROR; } static svn_error_t *compat_do_switch (void *session_baton, @@ -161,9 +243,15 @@ void *switch_baton, apr_pool_t *pool) { - return VTBL.do_switch (session_baton, reporter, report_baton, - revision_to_switch_to, switch_target, recurse, - switch_url, editor, switch_baton, pool); + const svn_ra_reporter2_t *reporter2; + void *baton2; + SVN_ERR (VTBL.do_switch (session_baton, &reporter2, &baton2, + revision_to_switch_to, switch_target, recurse, + switch_url, editor, switch_baton, pool)); + + compat_wrap_reporter (reporter, report_baton, reporter2, baton2, pool); + + return SVN_NO_ERROR; } static svn_error_t *compat_do_status (void *session_baton, @@ -176,8 +264,15 @@ void *status_baton, apr_pool_t *pool) { - return VTBL.do_status (session_baton, reporter, report_baton, status_target, - revision, recurse, editor, status_baton, pool); + const svn_ra_reporter2_t *reporter2; + void *baton2; + + SVN_ERR (VTBL.do_status (session_baton, &reporter2, &baton2, status_target, + revision, recurse, editor, status_baton, pool)); + + compat_wrap_reporter (reporter, report_baton, reporter2, baton2, pool); + + return SVN_NO_ERROR; } static svn_error_t *compat_do_diff (void *session_baton, @@ -192,9 +287,16 @@ void *diff_baton, apr_pool_t *pool) { - return VTBL.do_diff (session_baton, reporter, report_baton, revision, - diff_target, recurse, ignore_ancestry, versus_url, - diff_editor, diff_baton, pool); + const svn_ra_reporter2_t *reporter2; + void *baton2; + + SVN_ERR (VTBL.do_diff (session_baton, &reporter2, &baton2, revision, + diff_target, recurse, ignore_ancestry, versus_url, + diff_editor, diff_baton, pool)); + + compat_wrap_reporter (reporter, report_baton, reporter2, baton2, pool); + + return SVN_NO_ERROR; } static svn_error_t *compat_get_log (void *session_baton, Modified: branches/locking/subversion/libsvn_ra_dav/fetch.c Url: http://svn.collab.net/viewcvs/svn/branches/locking/subversion/libsvn_ra_dav/fetch.c?view=diff&rev=13134&p1=branches/locking/subversion/libsvn_ra_dav/fetch.c&r1=13133&p2=branches/locking/subversion/libsvn_ra_dav/fetch.c&r2=13134 ============================================================================== --- branches/locking/subversion/libsvn_ra_dav/fetch.c (original) +++ branches/locking/subversion/libsvn_ra_dav/fetch.c Thu Feb 24 06:14:18 2005 @@ -2641,12 +2641,14 @@ const char *path, svn_revnum_t revision, svn_boolean_t start_empty, + const char *lock_token, apr_pool_t *pool) { report_baton_t *rb = report_baton; const char *entry; svn_stringbuf_t *qpath = NULL; + /* ### sussman TODO: Pass lock token as extra attribute. */ svn_xml_escape_cdata_cstring (&qpath, path, pool); if (start_empty) entry = apr_psprintf(pool, @@ -2668,6 +2670,7 @@ const char *url, svn_revnum_t revision, svn_boolean_t start_empty, + const char *lock_token, apr_pool_t *pool) { report_baton_t *rb = report_baton; @@ -2686,6 +2689,7 @@ svn_xml_escape_cdata_cstring (&qpath, path, pool); svn_xml_escape_attr_cstring (&qlinkpath, bc_relative.data, pool); + /* ### sussman TODO: Pass lock token as extra attribute. */ if (start_empty) entry = apr_psprintf(pool, "<S:entry rev=\"%ld\"" @@ -2792,7 +2796,7 @@ return SVN_NO_ERROR; } -static const svn_ra_reporter_t ra_dav_reporter = { +static const svn_ra_reporter2_t ra_dav_reporter = { reporter_set_path, reporter_delete_path, reporter_link_path, @@ -2805,7 +2809,7 @@ working copy during updates or status checks. */ static svn_error_t * make_reporter (svn_ra_session_t *session, - const svn_ra_reporter_t **reporter, + const svn_ra_reporter2_t **reporter, void **report_baton, svn_revnum_t revision, const char *target, @@ -2937,7 +2941,7 @@ svn_error_t * svn_ra_dav__do_update(svn_ra_session_t *session, - const svn_ra_reporter_t **reporter, + const svn_ra_reporter2_t **reporter, void **report_baton, svn_revnum_t revision_to_update_to, const char *update_target, @@ -2963,7 +2967,7 @@ svn_error_t * svn_ra_dav__do_status(svn_ra_session_t *session, - const svn_ra_reporter_t **reporter, + const svn_ra_reporter2_t **reporter, void **report_baton, const char *status_target, svn_revnum_t revision, @@ -2989,7 +2993,7 @@ svn_error_t * svn_ra_dav__do_switch(svn_ra_session_t *session, - const svn_ra_reporter_t **reporter, + const svn_ra_reporter2_t **reporter, void **report_baton, svn_revnum_t revision_to_update_to, const char *update_target, @@ -3017,7 +3021,7 @@ svn_error_t * svn_ra_dav__do_diff(svn_ra_session_t *session, - const svn_ra_reporter_t **reporter, + const svn_ra_reporter2_t **reporter, void **report_baton, svn_revnum_t revision, const char *diff_target, Modified: branches/locking/subversion/libsvn_ra_dav/ra_dav.h Url: http://svn.collab.net/viewcvs/svn/branches/locking/subversion/libsvn_ra_dav/ra_dav.h?view=diff&rev=13134&p1=branches/locking/subversion/libsvn_ra_dav/ra_dav.h&r1=13133&p2=branches/locking/subversion/libsvn_ra_dav/ra_dav.h&r2=13134 ============================================================================== --- branches/locking/subversion/libsvn_ra_dav/ra_dav.h (original) +++ branches/locking/subversion/libsvn_ra_dav/ra_dav.h Thu Feb 24 06:14:18 2005 @@ -211,7 +211,7 @@ svn_error_t * svn_ra_dav__do_update( svn_ra_session_t *session, - const svn_ra_reporter_t **reporter, + const svn_ra_reporter2_t **reporter, void **report_baton, svn_revnum_t revision_to_update_to, const char *update_target, @@ -222,7 +222,7 @@ svn_error_t * svn_ra_dav__do_status( svn_ra_session_t *session, - const svn_ra_reporter_t **reporter, + const svn_ra_reporter2_t **reporter, void **report_baton, const char *status_target, svn_revnum_t revision, @@ -233,7 +233,7 @@ svn_error_t * svn_ra_dav__do_switch( svn_ra_session_t *session, - const svn_ra_reporter_t **reporter, + const svn_ra_reporter2_t **reporter, void **report_baton, svn_revnum_t revision_to_update_to, const char *update_target, @@ -245,7 +245,7 @@ svn_error_t * svn_ra_dav__do_diff( svn_ra_session_t *session, - const svn_ra_reporter_t **reporter, + const svn_ra_reporter2_t **reporter, void **report_baton, svn_revnum_t revision, const char *diff_target, Modified: branches/locking/subversion/libsvn_ra_local/ra_plugin.c Url: http://svn.collab.net/viewcvs/svn/branches/locking/subversion/libsvn_ra_local/ra_plugin.c?view=diff&rev=13134&p1=branches/locking/subversion/libsvn_ra_local/ra_plugin.c&r1=13133&p2=branches/locking/subversion/libsvn_ra_local/ra_plugin.c&r2=13134 ============================================================================== --- branches/locking/subversion/libsvn_ra_local/ra_plugin.c (original) +++ branches/locking/subversion/libsvn_ra_local/ra_plugin.c Thu Feb 24 06:14:18 2005 @@ -62,11 +62,12 @@ const char *path, svn_revnum_t revision, svn_boolean_t start_empty, + const char *lock_token, apr_pool_t *pool) { reporter_baton_t *rbaton = reporter_baton; - return svn_repos_set_path (rbaton->report_baton, path, - revision, start_empty, pool); + return svn_repos_set_path2 (rbaton->report_baton, path, + revision, start_empty, lock_token, pool); } @@ -86,6 +87,7 @@ const char *url, svn_revnum_t revision, svn_boolean_t start_empty, + const char *lock_token, apr_pool_t *pool) { reporter_baton_t *rbaton = reporter_baton; @@ -103,8 +105,8 @@ "'%s'"), url, rbaton->session->repos_url); fs_path = url + repos_url_len; - return svn_repos_link_path (rbaton->report_baton, path, - fs_path, revision, start_empty, pool); + return svn_repos_link_path2 (rbaton->report_baton, path, fs_path, revision, + start_empty, lock_token, pool); } @@ -126,7 +128,7 @@ } -static const svn_ra_reporter_t ra_local_reporter = +static const svn_ra_reporter2_t ra_local_reporter = { reporter_set_path, reporter_delete_path, @@ -531,7 +533,7 @@ static svn_error_t * make_reporter (svn_ra_session_t *session, - const svn_ra_reporter_t **reporter, + const svn_ra_reporter2_t **reporter, void **report_baton, svn_revnum_t revision, const char *target, @@ -605,7 +607,7 @@ static svn_error_t * svn_ra_local__do_update (svn_ra_session_t *session, - const svn_ra_reporter_t **reporter, + const svn_ra_reporter2_t **reporter, void **report_baton, svn_revnum_t update_revision, const char *update_target, @@ -631,7 +633,7 @@ static svn_error_t * svn_ra_local__do_switch (svn_ra_session_t *session, - const svn_ra_reporter_t **reporter, + const svn_ra_reporter2_t **reporter, void **report_baton, svn_revnum_t update_revision, const char *update_target, @@ -658,7 +660,7 @@ static svn_error_t * svn_ra_local__do_status (svn_ra_session_t *session, - const svn_ra_reporter_t **reporter, + const svn_ra_reporter2_t **reporter, void **report_baton, const char *status_target, svn_revnum_t revision, @@ -684,7 +686,7 @@ static svn_error_t * svn_ra_local__do_diff (svn_ra_session_t *session, - const svn_ra_reporter_t **reporter, + const svn_ra_reporter2_t **reporter, void **report_baton, svn_revnum_t update_revision, const char *update_target, Modified: branches/locking/subversion/libsvn_ra_svn/client.c Url: http://svn.collab.net/viewcvs/svn/branches/locking/subversion/libsvn_ra_svn/client.c?view=diff&rev=13134&p1=branches/locking/subversion/libsvn_ra_svn/client.c&r1=13133&p2=branches/locking/subversion/libsvn_ra_svn/client.c&r2=13134 ============================================================================== --- branches/locking/subversion/libsvn_ra_svn/client.c (original) +++ branches/locking/subversion/libsvn_ra_svn/client.c Thu Feb 24 06:14:18 2005 @@ -363,12 +363,13 @@ static svn_error_t *ra_svn_set_path(void *baton, const char *path, svn_revnum_t rev, svn_boolean_t start_empty, + const char *lock_token, apr_pool_t *pool) { ra_svn_reporter_baton_t *b = baton; - SVN_ERR(svn_ra_svn_write_cmd(b->conn, pool, "set-path", "crb", path, rev, - start_empty)); + SVN_ERR(svn_ra_svn_write_cmd(b->conn, pool, "set-path", "crb(?c)", path, rev, + start_empty, lock_token)); return SVN_NO_ERROR; } @@ -385,12 +386,13 @@ const char *url, svn_revnum_t rev, svn_boolean_t start_empty, + const char *lock_token, apr_pool_t *pool) { ra_svn_reporter_baton_t *b = baton; - SVN_ERR(svn_ra_svn_write_cmd(b->conn, pool, "link-path", "ccrb", path, url, - rev, start_empty)); + SVN_ERR(svn_ra_svn_write_cmd(b->conn, pool, "link-path", "ccrb(?c)", + path, url, rev, start_empty, lock_token)); return SVN_NO_ERROR; } @@ -416,7 +418,7 @@ return SVN_NO_ERROR; } -static svn_ra_reporter_t ra_svn_reporter = { +static svn_ra_reporter2_t ra_svn_reporter = { ra_svn_set_path, ra_svn_delete_path, ra_svn_link_path, @@ -428,7 +430,7 @@ apr_pool_t *pool, const svn_delta_editor_t *editor, void *edit_baton, - const svn_ra_reporter_t **reporter, + const svn_ra_reporter2_t **reporter, void **report_baton) { ra_svn_reporter_baton_t *b; @@ -977,7 +979,7 @@ static svn_error_t *ra_svn_update(svn_ra_session_t *session, - const svn_ra_reporter_t **reporter, + const svn_ra_reporter2_t **reporter, void **report_baton, svn_revnum_t rev, const char *target, svn_boolean_t recurse, const svn_delta_editor_t *update_editor, @@ -999,7 +1001,7 @@ } static svn_error_t *ra_svn_switch(svn_ra_session_t *session, - const svn_ra_reporter_t **reporter, + const svn_ra_reporter2_t **reporter, void **report_baton, svn_revnum_t rev, const char *target, svn_boolean_t recurse, const char *switch_url, @@ -1022,7 +1024,7 @@ } static svn_error_t *ra_svn_status(svn_ra_session_t *session, - const svn_ra_reporter_t **reporter, + const svn_ra_reporter2_t **reporter, void **report_baton, const char *target, svn_revnum_t rev, svn_boolean_t recurse, @@ -1045,7 +1047,7 @@ } static svn_error_t *ra_svn_diff(svn_ra_session_t *session, - const svn_ra_reporter_t **reporter, + const svn_ra_reporter2_t **reporter, void **report_baton, svn_revnum_t rev, const char *target, svn_boolean_t recurse, Modified: branches/locking/subversion/libsvn_ra_svn/protocol Url: http://svn.collab.net/viewcvs/svn/branches/locking/subversion/libsvn_ra_svn/protocol?view=diff&rev=13134&p1=branches/locking/subversion/libsvn_ra_svn/protocol&r1=13133&p2=branches/locking/subversion/libsvn_ra_svn/protocol&r2=13134 ============================================================================== --- branches/locking/subversion/libsvn_ra_svn/protocol (original) +++ branches/locking/subversion/libsvn_ra_svn/protocol Thu Feb 24 06:14:18 2005 @@ -413,13 +413,14 @@ call). Errors resulting from an abort-report call are ignored. set-path: - params: ( path:string rev:number start-empty:bool ) + params: ( path:string rev:number start-empty:bool ? [ lock-token:string ] ) delete-path: params: ( path:string ) link-path: - params: ( path:string url:string rev:number start-empty:bool ) + params: ( path:string url:string rev:number start-empty:bool + ? [ lock-token:string ] ) finish-report: params: ( ) Modified: branches/locking/subversion/libsvn_wc/adm_crawler.c Url: http://svn.collab.net/viewcvs/svn/branches/locking/subversion/libsvn_wc/adm_crawler.c?view=diff&rev=13134&p1=branches/locking/subversion/libsvn_wc/adm_crawler.c&r1=13133&p2=branches/locking/subversion/libsvn_wc/adm_crawler.c&r2=13134 ============================================================================== --- branches/locking/subversion/libsvn_wc/adm_crawler.c (original) +++ branches/locking/subversion/libsvn_wc/adm_crawler.c Thu Feb 24 06:14:18 2005 @@ -159,7 +159,7 @@ report_revisions (svn_wc_adm_access_t *adm_access, const char *dir_path, svn_revnum_t dir_rev, - const svn_ra_reporter_t *reporter, + const svn_ra_reporter2_t *reporter, void *report_baton, svn_wc_notify_func_t notify_func, void *notify_baton, @@ -321,11 +321,13 @@ SVN_ERR (reporter->link_path (report_baton, this_path, current_entry->url, current_entry->revision, - FALSE, iterpool)); + FALSE, current_entry->lock_token, + iterpool)); else SVN_ERR (reporter->set_path (report_baton, this_path, current_entry->revision, - FALSE, iterpool)); + FALSE, current_entry->lock_token, + iterpool)); } /* Possibly report a disjoint URL ... */ @@ -337,13 +339,16 @@ current_entry->url, current_entry->revision, FALSE, + current_entry->lock_token, iterpool)); - /* ... or perhaps just a differing revision. */ - else if (current_entry->revision != dir_rev) + /* ... or perhaps just a differing revision or lock token. */ + else if (current_entry->revision != dir_rev + || current_entry->lock_token) SVN_ERR (reporter->set_path (report_baton, this_path, current_entry->revision, FALSE, + current_entry->lock_token, iterpool)); } /* end file case */ @@ -393,11 +398,13 @@ subdir_entry->url, subdir_entry->revision, subdir_entry->incomplete, + subdir_entry->lock_token, iterpool)); else SVN_ERR (reporter->set_path (report_baton, this_path, subdir_entry->revision, subdir_entry->incomplete, + subdir_entry->lock_token, iterpool)); } @@ -408,14 +415,18 @@ subdir_entry->url, subdir_entry->revision, subdir_entry->incomplete, + subdir_entry->lock_token, iterpool)); - /* ... or perhaps just a differing revision or incomplete subdir. */ + /* ... or perhaps just a differing revision, lock token or + incomplete subdir. */ else if (subdir_entry->revision != dir_rev + || subdir_entry->lock_token || subdir_entry->incomplete) SVN_ERR (reporter->set_path (report_baton, this_path, subdir_entry->revision, subdir_entry->incomplete, + subdir_entry->lock_token, iterpool)); /* Recurse. */ @@ -445,17 +456,17 @@ /* This is the main driver of the working copy state "reporter", used for updates. */ svn_error_t * -svn_wc_crawl_revisions (const char *path, - svn_wc_adm_access_t *adm_access, - const svn_ra_reporter_t *reporter, - void *report_baton, - svn_boolean_t restore_files, - svn_boolean_t recurse, - svn_boolean_t use_commit_times, - svn_wc_notify_func_t notify_func, - void *notify_baton, - svn_wc_traversal_info_t *traversal_info, - apr_pool_t *pool) +svn_wc_crawl_revisions2 (const char *path, + svn_wc_adm_access_t *adm_access, + const svn_ra_reporter2_t *reporter, + void *report_baton, + svn_boolean_t restore_files, + svn_boolean_t recurse, + svn_boolean_t use_commit_times, + svn_wc_notify_func_t notify_func, + void *notify_baton, + svn_wc_traversal_info_t *traversal_info, + apr_pool_t *pool) { svn_error_t *err = SVN_NO_ERROR; const svn_wc_entry_t *entry; @@ -478,7 +489,7 @@ base_rev = parent_entry->revision; SVN_ERR (reporter->set_path (report_baton, "", base_rev, entry ? entry->incomplete : TRUE, - pool)); + NULL, pool)); SVN_ERR (reporter->delete_path (report_baton, "", pool)); /* Finish the report, which causes the update editor to be @@ -503,7 +514,7 @@ argument is ignored. */ SVN_ERR (reporter->set_path (report_baton, "", base_rev, entry->incomplete , /* start_empty ? */ - pool)); + NULL, pool)); if (entry->schedule != svn_wc_schedule_delete) { @@ -590,16 +601,18 @@ entry->url, entry->revision, FALSE, + entry->lock_token, pool)); } - else if (entry->revision != base_rev) + else if (entry->revision != base_rev || entry->lock_token) { /* If this entry is a file node, we just want to report that node's revision. Since we are looking at the actual target of the report (not some file in a subdirectory of a target directory), and that target is a file, we need to pass an empty string to set_path. */ - err = reporter->set_path (report_baton, "", base_rev, FALSE, pool); + err = reporter->set_path (report_baton, "", base_rev, FALSE, + entry->lock_token, pool); if (err) goto abort_report; } @@ -624,6 +637,97 @@ return SVN_NO_ERROR; } +/*** Compatibility wrapper: turns an svn_ra_reporter_t into an + svn_ra_reporter2_t. ***/ + +struct wrap_report_baton { + const svn_ra_reporter_t *reporter; + void *baton; +}; + +static svn_error_t *wrap_set_path (void *report_baton, + const char *path, + svn_revnum_t revision, + svn_boolean_t start_empty, + const char *lock_token, + apr_pool_t *pool) +{ + struct wrap_report_baton *wrb = report_baton; + + return wrb->reporter->set_path (wrb->baton, path, revision, start_empty, + pool); +} + +static svn_error_t *wrap_delete_path (void *report_baton, + const char *path, + apr_pool_t *pool) +{ + struct wrap_report_baton *wrb = report_baton; + + return wrb->reporter->delete_path (wrb->baton, path, pool); +} + +static svn_error_t *wrap_link_path (void *report_baton, + const char *path, + const char *url, + svn_revnum_t revision, + svn_boolean_t start_empty, + const char *lock_token, + apr_pool_t *pool) +{ + struct wrap_report_baton *wrb = report_baton; + + return wrb->reporter->link_path (wrb->baton, path, url, revision, + start_empty, pool); +} + +static svn_error_t *wrap_finish_report (void *report_baton, + apr_pool_t *pool) +{ + struct wrap_report_baton *wrb = report_baton; + + return wrb->reporter->finish_report (wrb->baton, pool); +} + +static svn_error_t *wrap_abort_report (void *report_baton, + apr_pool_t *pool) +{ + struct wrap_report_baton *wrb = report_baton; + + return wrb->reporter->abort_report (wrb->baton, pool); +} + +static const svn_ra_reporter2_t wrap_reporter = { + wrap_set_path, + wrap_delete_path, + wrap_link_path, + wrap_finish_report, + wrap_abort_report +}; + +svn_error_t * +svn_wc_crawl_revisions (const char *path, + svn_wc_adm_access_t *adm_access, + const svn_ra_reporter_t *reporter, + void *report_baton, + svn_boolean_t restore_files, + svn_boolean_t recurse, + svn_boolean_t use_commit_times, + svn_wc_notify_func_t notify_func, + void *notify_baton, + svn_wc_traversal_info_t *traversal_info, + apr_pool_t *pool) +{ + struct wrap_report_baton wrb; + + wrb.reporter = reporter; + wrb.baton = report_baton; + + return svn_wc_crawl_revisions2 (path, adm_access, &wrap_reporter, &wrb, + restore_files, recurse, use_commit_times, + notify_func, notify_baton, traversal_info, + pool); +} svn_error_t * svn_wc_transmit_text_deltas (const char *path, |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | svn commit: r13137 - branches/ruby/subversion/bindings/swig/ruby/svn: 00310, kou-jqHnx1hy4Dsdnm+yROfE0A |
|---|---|
| Next by Date: | svn commit: r13136 - branches/ruby/subversion/bindings/swig: 00310, kou-jqHnx1hy4Dsdnm+yROfE0A |
| Previous by Thread: | svn commit: r13137 - branches/ruby/subversion/bindings/swig/ruby/svni: 00310, kou-jqHnx1hy4Dsdnm+yROfE0A |
| Next by Thread: | Re: svn commit: r13134 - in branches/locking/subversion: include libsvn_client libsvn_ra libsvn_ra_dav libsvn_ra_local libsvn_ra_svn libsvn_wc: 00310, Brian W. Fitzpatrick |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |