You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ju...@apache.org on 2015/01/21 18:00:21 UTC

svn commit: r1653600 - in /subversion/trunk/subversion: include/svn_ra.h include/svn_ra_svn.h include/svn_repos.h libsvn_ra_serf/ra_serf.h libsvn_repos/commit.c svnrdump/load_editor.c

Author: julianfoad
Date: Wed Jan 21 17:00:21 2015
New Revision: 1653600

URL: http://svn.apache.org/r1653600
Log:
Document the specific requirements of commit editors to be given a URL
rather than a relative path in the copyfrom_path argument of their
add_file() and add_directory() methods.

* subversion/include/svn_ra.h
  (svn_ra_get_commit_editor3): Add a comment: requires a URL.

* subversion/include/svn_ra_svn.h
  (svn_ra_svn_get_editor): Add a comment: passes on either kind, verbatim.
  (svn_ra_svn_drive_editor2): Add a comment: canonicalizes either kind.

* subversion/include/svn_repos.h
  (svn_repos_get_commit_editor5): Add a comment: requires a URL.

* subversion/libsvn_ra_serf/ra_serf.h
  (svn_ra_serf__get_commit_editor): Add a comment: requires a URL.

* subversion/libsvn_repos/commit.c
  (add_file_or_directory): Add a comment: requires a URL.

* subversion/svnrdump/load_editor.c
  (new_node_record): Add a comment: provides a URL.

Modified:
    subversion/trunk/subversion/include/svn_ra.h
    subversion/trunk/subversion/include/svn_ra_svn.h
    subversion/trunk/subversion/include/svn_repos.h
    subversion/trunk/subversion/libsvn_ra_serf/ra_serf.h
    subversion/trunk/subversion/libsvn_repos/commit.c
    subversion/trunk/subversion/svnrdump/load_editor.c

Modified: subversion/trunk/subversion/include/svn_ra.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_ra.h?rev=1653600&r1=1653599&r2=1653600&view=diff
==============================================================================
--- subversion/trunk/subversion/include/svn_ra.h (original)
+++ subversion/trunk/subversion/include/svn_ra.h Wed Jan 21 17:00:21 2015
@@ -1011,6 +1011,10 @@ svn_ra_rev_prop(svn_ra_session_t *sessio
  * Use @a pool for memory allocation.
  *
  * @since New in 1.5.
+ *
+ * @note Like most commit editors, the returned editor requires that the
+ * @c copyfrom_path parameter passed to its @c add_file and @c add_directory
+ * methods is a URL, not a relative path.
  */
 svn_error_t *
 svn_ra_get_commit_editor3(svn_ra_session_t *session,

Modified: subversion/trunk/subversion/include/svn_ra_svn.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_ra_svn.h?rev=1653600&r1=1653599&r2=1653600&view=diff
==============================================================================
--- subversion/trunk/subversion/include/svn_ra_svn.h (original)
+++ subversion/trunk/subversion/include/svn_ra_svn.h Wed Jan 21 17:00:21 2015
@@ -287,6 +287,12 @@ svn_ra_svn_conn_remote_host(svn_ra_svn_c
  *
  * Upon successful completion of the edit, the editor will invoke @a callback
  * with @a callback_baton as an argument.
+ *
+ * @note The @c copyfrom_path parameter passed to the @c add_file and
+ * @c add_directory methods of the returned editor may be either a URL or a
+ * relative path, and is transferred verbatim to the receiving end of the
+ * connection. See svn_ra_svn_drive_editor2() for information on the
+ * receiving end of the connection.
  */
 void
 svn_ra_svn_get_editor(const svn_delta_editor_t **editor,
@@ -302,6 +308,13 @@ svn_ra_svn_get_editor(const svn_delta_ed
  * if @a for_replay is TRUE.
  *
  * @since New in 1.4.
+ *
+ * @note The @c copyfrom_path parameter passed to the @c add_file and
+ * @c add_directory methods of the receiving editor will be canonicalized
+ * either as a URL or as a relative path (starting with a slash) according
+ * to which kind was sent by the driving end of the connection. See
+ * svn_ra_svn_get_editor() for information on the driving end of the
+ * connection.
  */
 svn_error_t *
 svn_ra_svn_drive_editor2(svn_ra_svn_conn_t *conn,

Modified: subversion/trunk/subversion/include/svn_repos.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_repos.h?rev=1653600&r1=1653599&r2=1653600&view=diff
==============================================================================
--- subversion/trunk/subversion/include/svn_repos.h (original)
+++ subversion/trunk/subversion/include/svn_repos.h Wed Jan 21 17:00:21 2015
@@ -1539,6 +1539,10 @@ svn_repos_replay(svn_fs_root_t *root,
  *
  * @note Yes, @a repos_url is a <em>decoded</em> URL.  We realize
  * that's sorta wonky.  Sorry about that.
+ *
+ * @note Like most commit editors, the returned editor requires that the
+ * @c copyfrom_path parameter passed to its @c add_file and @c add_directory
+ * methods is a URL, not a relative path.
  */
 svn_error_t *
 svn_repos_get_commit_editor5(const svn_delta_editor_t **editor,

Modified: subversion/trunk/subversion/libsvn_ra_serf/ra_serf.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_serf/ra_serf.h?rev=1653600&r1=1653599&r2=1653600&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_serf/ra_serf.h (original)
+++ subversion/trunk/subversion/libsvn_ra_serf/ra_serf.h Wed Jan 21 17:00:21 2015
@@ -1461,7 +1461,12 @@ svn_ra_serf__get_dated_revision(svn_ra_s
                                 apr_time_t tm,
                                 apr_pool_t *pool);
 
-/* Implements svn_ra__vtable_t.get_commit_editor(). */
+/* Implements svn_ra__vtable_t.get_commit_editor().
+ *
+ * Note: Like other commit editors, the returned editor requires that the
+ * @c copyfrom_path parameter passed to its @c add_file and @c add_directory
+ * methods is a URL, not a relative path.
+ */
 svn_error_t *
 svn_ra_serf__get_commit_editor(svn_ra_session_t *session,
                                const svn_delta_editor_t **editor,

Modified: subversion/trunk/subversion/libsvn_repos/commit.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_repos/commit.c?rev=1653600&r1=1653599&r2=1653600&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_repos/commit.c (original)
+++ subversion/trunk/subversion/libsvn_repos/commit.c Wed Jan 21 17:00:21 2015
@@ -262,7 +262,9 @@ make_dir_baton(struct edit_baton *edit_b
 /* This function is the shared guts of add_file() and add_directory(),
    which see for the meanings of the parameters.  The only extra
    parameter here is IS_DIR, which is TRUE when adding a directory,
-   and FALSE when adding a file.  */
+   and FALSE when adding a file.
+
+   COPY_PATH must be a full URL, not a relative path. */
 static svn_error_t *
 add_file_or_directory(const char *path,
                       void *parent_baton,

Modified: subversion/trunk/subversion/svnrdump/load_editor.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svnrdump/load_editor.c?rev=1653600&r1=1653599&r2=1653600&view=diff
==============================================================================
--- subversion/trunk/subversion/svnrdump/load_editor.c (original)
+++ subversion/trunk/subversion/svnrdump/load_editor.c Wed Jan 21 17:00:21 2015
@@ -604,6 +604,7 @@ new_node_record(void **node_baton,
       if (rb->pb->parent_dir)
         nb->copyfrom_path = svn_relpath_join(rb->pb->parent_dir,
                                              nb->copyfrom_path, rb->pool);
+      /* Convert to a URL, as the commit editor requires. */
       nb->copyfrom_path = svn_path_url_add_component2(rb->pb->root_url,
                                                       nb->copyfrom_path,
                                                       rb->pool);