subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stef...@apache.org
Subject svn commit: r1464763 [2/2] - in /subversion/trunk/subversion: include/svn_ra_svn.h libsvn_ra_svn/client.c libsvn_ra_svn/editorp.c libsvn_ra_svn/marshal.c svnserve/serve.c
Date Thu, 04 Apr 2013 21:03:54 GMT
Modified: subversion/trunk/subversion/libsvn_ra_svn/marshal.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_svn/marshal.c?rev=1464763&r1=1464762&r2=1464763&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_svn/marshal.c (original)
+++ subversion/trunk/subversion/libsvn_ra_svn/marshal.c Thu Apr  4 21:03:54 2013
@@ -40,6 +40,7 @@
 #include "svn_ra_svn.h"
 #include "svn_private_config.h"
 #include "svn_ctype.h"
+#include "svn_time.h"
 
 #include "ra_svn.h"
 
@@ -651,18 +652,6 @@ vwrite_tuple_string_opt(svn_ra_svn_conn_
 }
 
 static svn_error_t *
-vwrite_tuple_start_list(svn_ra_svn_conn_t *conn, apr_pool_t *pool, va_list *ap)
-{
-  return svn_ra_svn_start_list(conn, pool);
-}
-
-static svn_error_t *
-vwrite_tuple_end_list(svn_ra_svn_conn_t *conn, apr_pool_t *pool, va_list *ap)
-{
-  return svn_ra_svn_end_list(conn, pool);
-}
-
-static svn_error_t *
 vwrite_tuple_word(svn_ra_svn_conn_t *conn, apr_pool_t *pool, va_list *ap)
 {
   const char *cstr = va_arg(*ap, const char *);
@@ -708,476 +697,181 @@ vwrite_tuple_boolean(svn_ra_svn_conn_t *
 }
 
 static svn_error_t *
-vwrite_cmd_open_root(svn_ra_svn_conn_t *conn, apr_pool_t *pool, va_list *ap)
-{
-  SVN_ERR(vwrite_tuple_start_list(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_revision_opt(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_end_list(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_cstring(conn, pool, ap));
-
-  return SVN_NO_ERROR;
-}
-
-static svn_error_t *
-vwrite_cmd_delete_entry(svn_ra_svn_conn_t *conn, apr_pool_t *pool, va_list *ap)
-{
-  SVN_ERR(vwrite_tuple_cstring(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_start_list(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_revision_opt(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_end_list(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_cstring(conn, pool, ap));
-
-  return SVN_NO_ERROR;
-}
-
-static svn_error_t *
-vwrite_cmd_add_dir(svn_ra_svn_conn_t *conn, apr_pool_t *pool, va_list *ap)
-{
-  SVN_ERR(vwrite_tuple_cstring(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_cstring(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_cstring(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_start_list(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_cstring_opt(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_revision_opt(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_end_list(conn, pool, ap));
-
-  return SVN_NO_ERROR;
-}
-
-static svn_error_t *
-vwrite_cmd_open_dir(svn_ra_svn_conn_t *conn, apr_pool_t *pool, va_list *ap)
-{
-  SVN_ERR(vwrite_tuple_cstring(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_cstring(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_cstring(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_start_list(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_revision_opt(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_end_list(conn, pool, ap));
-
-  return SVN_NO_ERROR;
-}
-
-static svn_error_t *
-vwrite_cmd_change_dir_prop(svn_ra_svn_conn_t *conn, apr_pool_t *pool, va_list *ap)
-{
-  SVN_ERR(vwrite_tuple_cstring(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_cstring(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_start_list(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_string_opt(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_end_list(conn, pool, ap));
-
-  return SVN_NO_ERROR;
-}
-
-static svn_error_t *
-vwrite_cmd_absent_dir(svn_ra_svn_conn_t *conn, apr_pool_t *pool, va_list *ap)
-{
-  SVN_ERR(vwrite_tuple_cstring(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_cstring(conn, pool, ap));
-
-  return SVN_NO_ERROR;
-}
-
-static svn_error_t *
-vwrite_cmd_add_file(svn_ra_svn_conn_t *conn, apr_pool_t *pool, va_list *ap)
-{
-  SVN_ERR(vwrite_tuple_cstring(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_cstring(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_cstring(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_start_list(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_cstring_opt(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_revision_opt(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_end_list(conn, pool, ap));
-
-  return SVN_NO_ERROR;
-}
-
-static svn_error_t *
-vwrite_cmd_open_file(svn_ra_svn_conn_t *conn, apr_pool_t *pool, va_list *ap)
+write_tuple_cstring(svn_ra_svn_conn_t *conn,
+                    apr_pool_t *pool,
+                    const char *cstr)
 {
-  SVN_ERR(vwrite_tuple_cstring(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_cstring(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_cstring(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_start_list(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_revision_opt(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_end_list(conn, pool, ap));
-
-  return SVN_NO_ERROR;
-}
-
-static svn_error_t *
-vwrite_cmd_change_file_prop(svn_ra_svn_conn_t *conn, apr_pool_t *pool, va_list *ap)
-{
-  SVN_ERR(vwrite_tuple_cstring(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_cstring(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_start_list(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_string_opt(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_end_list(conn, pool, ap));
-
-  return SVN_NO_ERROR;
-}
-
-static svn_error_t *
-vwrite_cmd_close_file(svn_ra_svn_conn_t *conn, apr_pool_t *pool, va_list *ap)
-{
-  SVN_ERR(vwrite_tuple_cstring(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_start_list(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_cstring_opt(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_end_list(conn, pool, ap));
-
-  return SVN_NO_ERROR;
-}
-
-static svn_error_t *
-vwrite_cmd_absent_file(svn_ra_svn_conn_t *conn, apr_pool_t *pool, va_list *ap)
-{
-  SVN_ERR(vwrite_tuple_cstring(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_cstring(conn, pool, ap));
-
-  return SVN_NO_ERROR;
-}
-
-static svn_error_t *
-vwrite_cmd_textdelta_chunk(svn_ra_svn_conn_t *conn, apr_pool_t *pool, va_list *ap)
-{
-  SVN_ERR(vwrite_tuple_cstring(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_string(conn, pool, ap));
-
-  return SVN_NO_ERROR;
-}
-
-static svn_error_t *
-vwrite_cmd_apply_textdelta(svn_ra_svn_conn_t *conn, apr_pool_t *pool, va_list *ap)
-{
-  SVN_ERR(vwrite_tuple_cstring(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_start_list(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_cstring_opt(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_end_list(conn, pool, ap));
-
-  return SVN_NO_ERROR;
-}
-
-static svn_error_t *
-vwrite_cmd_no_op(svn_ra_svn_conn_t *conn, apr_pool_t *pool, va_list *ap)
-{
-  return SVN_NO_ERROR;
-}
-
-static svn_error_t *
-vwrite_cmd_set_path(svn_ra_svn_conn_t *conn, apr_pool_t *pool, va_list *ap)
-{
-  SVN_ERR(vwrite_tuple_cstring(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_revision(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_boolean(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_start_list(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_cstring_opt(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_end_list(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_word(conn, pool, ap));
-
-  return SVN_NO_ERROR;
-}
-
-static svn_error_t *
-vwrite_cmd_link_path(svn_ra_svn_conn_t *conn, apr_pool_t *pool, va_list *ap)
-{
-  SVN_ERR(vwrite_tuple_cstring(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_cstring(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_revision(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_boolean(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_start_list(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_cstring_opt(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_end_list(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_word(conn, pool, ap));
-
-  return SVN_NO_ERROR;
+  SVN_ERR_ASSERT(cstr);
+  return svn_ra_svn_write_cstring(conn, pool, cstr);
 }
 
 static svn_error_t *
-vwrite_cmd_change_rev_prop2(svn_ra_svn_conn_t *conn, apr_pool_t *pool, va_list *ap)
+write_tuple_cstring_opt(svn_ra_svn_conn_t *conn,
+                        apr_pool_t *pool,
+                        const char *cstr)
 {
-  SVN_ERR(vwrite_tuple_revision(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_cstring(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_start_list(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_string_opt(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_end_list(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_start_list(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_boolean(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_string_opt(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_end_list(conn, pool, ap));
-
-  return SVN_NO_ERROR;
+  return cstr ? svn_ra_svn_write_cstring(conn, pool, cstr) : SVN_NO_ERROR;
 }
 
 static svn_error_t *
-vwrite_cmd_change_rev_prop(svn_ra_svn_conn_t *conn, apr_pool_t *pool, va_list *ap)
+write_tuple_string(svn_ra_svn_conn_t *conn,
+                   apr_pool_t *pool,
+                   const svn_string_t *str)
 {
-  SVN_ERR(vwrite_tuple_revision(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_cstring(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_string_opt(conn, pool, ap));
-
-  return SVN_NO_ERROR;
+  SVN_ERR_ASSERT(str);
+  return svn_ra_svn_write_string(conn, pool, str);
 }
 
 static svn_error_t *
-vwrite_cmd_rev_prop(svn_ra_svn_conn_t *conn, apr_pool_t *pool, va_list *ap)
+write_tuple_string_opt(svn_ra_svn_conn_t *conn,
+                       apr_pool_t *pool,
+                       const svn_string_t *str)
 {
-  SVN_ERR(vwrite_tuple_revision(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_cstring(conn, pool, ap));
-
-  return SVN_NO_ERROR;
+  return str ? svn_ra_svn_write_string(conn, pool, str) : SVN_NO_ERROR;
 }
 
 static svn_error_t *
-vwrite_cmd_get_file(svn_ra_svn_conn_t *conn, apr_pool_t *pool, va_list *ap)
+write_tuple_start_list(svn_ra_svn_conn_t *conn,
+                       apr_pool_t *pool)
 {
-  SVN_ERR(vwrite_tuple_cstring(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_start_list(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_revision_opt(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_end_list(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_boolean(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_boolean(conn, pool, ap));
-
-  return SVN_NO_ERROR;
+  return svn_ra_svn_start_list(conn, pool);
 }
 
 static svn_error_t *
-vwrite_cmd_update(svn_ra_svn_conn_t *conn, apr_pool_t *pool, va_list *ap)
+write_tuple_end_list(svn_ra_svn_conn_t *conn,
+                     apr_pool_t *pool)
 {
-  SVN_ERR(vwrite_tuple_start_list(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_revision_opt(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_end_list(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_cstring(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_boolean(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_word(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_boolean(conn, pool, ap));
-
-  return SVN_NO_ERROR;
+  return svn_ra_svn_end_list(conn, pool);
 }
 
 static svn_error_t *
-vwrite_cmd_switch(svn_ra_svn_conn_t *conn, apr_pool_t *pool, va_list *ap)
+write_tuple_word(svn_ra_svn_conn_t *conn,
+                 apr_pool_t *pool,
+                 const char *cstr)
 {
-  SVN_ERR(vwrite_tuple_start_list(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_revision_opt(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_end_list(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_cstring(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_boolean(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_cstring(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_word(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_boolean(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_boolean(conn, pool, ap));
-
-  return SVN_NO_ERROR;
+  SVN_ERR_ASSERT(cstr);
+  return svn_ra_svn_write_word(conn, pool, cstr);
 }
 
 static svn_error_t *
-vwrite_cmd_status(svn_ra_svn_conn_t *conn, apr_pool_t *pool, va_list *ap)
+write_tuple_word_opt(svn_ra_svn_conn_t *conn,
+                     apr_pool_t *pool,
+                     const char *cstr)
 {
-  SVN_ERR(vwrite_tuple_cstring(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_boolean(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_start_list(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_revision_opt(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_end_list(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_word(conn, pool, ap));
-
-  return SVN_NO_ERROR;
+  return cstr ? svn_ra_svn_write_word(conn, pool, cstr) : SVN_NO_ERROR;
 }
 
 static svn_error_t *
-vwrite_cmd_diff(svn_ra_svn_conn_t *conn, apr_pool_t *pool, va_list *ap)
+write_tuple_revision(svn_ra_svn_conn_t *conn,
+                     apr_pool_t *pool,
+                     svn_revnum_t rev)
 {
-  SVN_ERR(vwrite_tuple_start_list(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_revision_opt(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_end_list(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_cstring(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_boolean(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_boolean(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_cstring(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_boolean(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_word(conn, pool, ap));
-
-  return SVN_NO_ERROR;
+  SVN_ERR_ASSERT(SVN_IS_VALID_REVNUM(rev));
+  return svn_ra_svn_write_number(conn, pool, rev);
 }
 
 static svn_error_t *
-vwrite_cmd_check_path(svn_ra_svn_conn_t *conn, apr_pool_t *pool, va_list *ap)
+write_tuple_revision_opt(svn_ra_svn_conn_t *conn,
+                         apr_pool_t *pool,
+                         svn_revnum_t rev)
 {
-  SVN_ERR(vwrite_tuple_cstring(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_start_list(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_revision_opt(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_end_list(conn, pool, ap));
-
-  return SVN_NO_ERROR;
+  return SVN_IS_VALID_REVNUM(rev)
+       ? svn_ra_svn_write_number(conn, pool, rev)
+       : SVN_NO_ERROR;
 }
 
 static svn_error_t *
-vwrite_cmd_stat(svn_ra_svn_conn_t *conn, apr_pool_t *pool, va_list *ap)
+write_tuple_number(svn_ra_svn_conn_t *conn,
+                   apr_pool_t *pool,
+                   apr_uint64_t number)
 {
-  SVN_ERR(vwrite_tuple_cstring(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_start_list(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_revision_opt(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_end_list(conn, pool, ap));
-
-  return SVN_NO_ERROR;
+  return svn_ra_svn_write_number(conn, pool, number);
 }
 
 static svn_error_t *
-vwrite_cmd_get_file_revs(svn_ra_svn_conn_t *conn, apr_pool_t *pool, va_list *ap)
+write_tuple_boolean(svn_ra_svn_conn_t *conn,
+                    apr_pool_t *pool,
+                    svn_boolean_t value)
 {
-  SVN_ERR(vwrite_tuple_cstring(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_start_list(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_revision_opt(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_end_list(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_start_list(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_revision_opt(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_end_list(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_boolean(conn, pool, ap));
-
-  return SVN_NO_ERROR;
+  const char *cstr = value ? "true" : "false";
+  return svn_ra_svn_write_word(conn, pool, cstr);
 }
 
 static svn_error_t *
-vwrite_cmd_lock(svn_ra_svn_conn_t *conn, apr_pool_t *pool, va_list *ap)
+write_tuple_depth(svn_ra_svn_conn_t *conn,
+                  apr_pool_t *pool,
+                  svn_depth_t depth)
 {
-  SVN_ERR(vwrite_tuple_cstring(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_start_list(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_cstring_opt(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_end_list(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_boolean(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_start_list(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_revision_opt(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_end_list(conn, pool, ap));
-
-  return SVN_NO_ERROR;
+  return svn_ra_svn_write_word(conn, pool, svn_depth_to_word(depth));
 }
 
-static svn_error_t *
-vwrite_cmd_unlock(svn_ra_svn_conn_t *conn, apr_pool_t *pool, va_list *ap)
-{
-  SVN_ERR(vwrite_tuple_cstring(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_start_list(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_cstring_opt(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_end_list(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_boolean(conn, pool, ap));
-
-  return SVN_NO_ERROR;
-}
 
 static svn_error_t *
-vwrite_cmd_get_locks(svn_ra_svn_conn_t *conn, apr_pool_t *pool, va_list *ap)
+write_cmd_add_node(svn_ra_svn_conn_t *conn,
+                   apr_pool_t *pool,
+                   const char *path,
+                   const char *parent_token,
+                   const char *token,
+                   const char *copy_path,
+                   svn_revnum_t copy_rev)
 {
-  SVN_ERR(vwrite_tuple_cstring(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_start_list(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_word(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_end_list(conn, pool, ap));
+  SVN_ERR(write_tuple_cstring(conn, pool, path));
+  SVN_ERR(write_tuple_cstring(conn, pool, parent_token));
+  SVN_ERR(write_tuple_cstring(conn, pool, token));
+  SVN_ERR(write_tuple_start_list(conn, pool));
+  SVN_ERR(write_tuple_cstring_opt(conn, pool, copy_path));
+  SVN_ERR(write_tuple_revision_opt(conn, pool, copy_rev));
+  SVN_ERR(write_tuple_end_list(conn, pool));
 
   return SVN_NO_ERROR;
 }
 
 static svn_error_t *
-vwrite_cmd_replay(svn_ra_svn_conn_t *conn, apr_pool_t *pool, va_list *ap)
+write_cmd_open_node(svn_ra_svn_conn_t *conn,
+                    apr_pool_t *pool,
+                    const char *path,
+                    const char *parent_token,
+                    const char *token,
+                    svn_revnum_t rev)
 {
-  SVN_ERR(vwrite_tuple_revision(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_revision(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_boolean(conn, pool, ap));
+  SVN_ERR(write_tuple_cstring(conn, pool, path));
+  SVN_ERR(write_tuple_cstring(conn, pool, parent_token));
+  SVN_ERR(write_tuple_cstring(conn, pool, token));
+  SVN_ERR(write_tuple_start_list(conn, pool));
+  SVN_ERR(write_tuple_revision_opt(conn, pool, rev));
+  SVN_ERR(write_tuple_end_list(conn, pool));
 
   return SVN_NO_ERROR;
 }
 
 static svn_error_t *
-vwrite_cmd_replay_range(svn_ra_svn_conn_t *conn, apr_pool_t *pool, va_list *ap)
+write_cmd_change_node_prop(svn_ra_svn_conn_t *conn,
+                           apr_pool_t *pool,
+                           const char *token,
+                           const char *name,
+                           const svn_string_t *value)
 {
-  SVN_ERR(vwrite_tuple_revision(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_revision(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_revision(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_boolean(conn, pool, ap));
+  SVN_ERR(write_tuple_cstring(conn, pool, token));
+  SVN_ERR(write_tuple_cstring(conn, pool, name));
+  SVN_ERR(write_tuple_start_list(conn, pool));
+  SVN_ERR(write_tuple_string_opt(conn, pool, value));
+  SVN_ERR(write_tuple_end_list(conn, pool));
 
   return SVN_NO_ERROR;
 }
 
 static svn_error_t *
-vwrite_cmd_get_deleted_rev(svn_ra_svn_conn_t *conn, apr_pool_t *pool, va_list *ap)
+write_cmd_absent_node(svn_ra_svn_conn_t *conn,
+                      apr_pool_t *pool,
+                      const char *path,
+                      const char *token)
 {
-  SVN_ERR(vwrite_tuple_cstring(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_revision(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_revision(conn, pool, ap));
+  SVN_ERR(write_tuple_cstring(conn, pool, path));
+  SVN_ERR(write_tuple_cstring(conn, pool, token));
 
   return SVN_NO_ERROR;
 }
 
-static svn_error_t *
-vwrite_cmd_get_iprops(svn_ra_svn_conn_t *conn, apr_pool_t *pool, va_list *ap)
-{
-  SVN_ERR(vwrite_tuple_cstring(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_start_list(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_revision_opt(conn, pool, ap));
-  SVN_ERR(vwrite_tuple_end_list(conn, pool, ap));
-
-  return SVN_NO_ERROR;
-}
- 
-typedef svn_error_t *
-(*vwrite_tuple_func)(svn_ra_svn_conn_t *, apr_pool_t *, va_list *);
-
-typedef struct cmd_template_t
-{
-  const char *start_sequence;
-  apr_size_t start_sequence_length;
-  vwrite_tuple_func write_ops;
-} cmd_template_t;
-
-static const cmd_template_t cmd_templates[svn_ra_svn_cmd__last]
-    = { {"( target-rev ( "      , 15, vwrite_tuple_revision },
-        {"( open-root ( "       , 14, vwrite_cmd_open_root },
-        {"( delete-entry ( "    , 17, vwrite_cmd_delete_entry },
-        {"( add-dir ( "         , 12, vwrite_cmd_add_dir },
-        {"( open-dir ( "        , 13, vwrite_cmd_open_dir },
-        {"( change-dir-prop ( " , 20, vwrite_cmd_change_dir_prop },
-        {"( close-dir ( "       , 14, vwrite_tuple_cstring },
-        {"( absent-dir ( "      , 15, vwrite_cmd_absent_dir },
-        {"( add-file ( "        , 13, vwrite_cmd_add_file },
-        {"( open-file ( "       , 14, vwrite_cmd_open_file },
-        {"( change-file-prop ( ", 21, vwrite_cmd_change_file_prop },
-        {"( close-file ( "      , 15, vwrite_cmd_close_file },
-        {"( absent-file ( "     , 16, vwrite_cmd_absent_file },
-        {"( textdelta-chunk ( " , 20, vwrite_cmd_textdelta_chunk },
-        {"( textdelta-end ( "   , 18, vwrite_tuple_cstring },
-        {"( apply-textdelta ( " , 20, vwrite_cmd_apply_textdelta },
-        {"( close-edit ( "      , 15, vwrite_cmd_no_op },
-        {"( abort-edit ( "      , 15, vwrite_cmd_no_op },
-
-        {"( set-path ( "        , 13, vwrite_cmd_set_path },
-        {"( delete-path ( "     , 16, vwrite_tuple_cstring },
-        {"( link-path ( "       , 14, vwrite_cmd_link_path },
-        {"( finish-report ( "   , 18, vwrite_cmd_no_op },
-        {"( abort-report ( "    , 17, vwrite_cmd_no_op },
-
-        {"( reparent ( "        , 13, vwrite_tuple_cstring },
-        {"( get-latest-rev ( "  , 19, vwrite_cmd_no_op },
-        {"( get-dated-rev ( "   , 18, vwrite_tuple_cstring },
-        {"( change-rev-prop2 ( ", 21, vwrite_cmd_change_rev_prop2 },
-        {"( change-rev-prop ( " , 20, vwrite_cmd_change_rev_prop },
-        {"( rev-proplist ( "    , 17, vwrite_tuple_revision },
-        {"( rev-prop ( "        , 13, vwrite_cmd_rev_prop },
-        {"( get-file ( "        , 13, vwrite_cmd_get_file },
-        {"( update ( "          , 11, vwrite_cmd_update },
-        {"( switch ( "          , 11, vwrite_cmd_switch },
-        {"( status ( "          , 11, vwrite_cmd_status },
-        {"( diff ( "            ,  9, vwrite_cmd_diff },
-        {"( check-path ( "      , 15, vwrite_cmd_check_path },
-        {"( stat ( "            ,  9, vwrite_cmd_stat },
-        {"( get-file-revs ( "   , 18, vwrite_cmd_get_file_revs },
-        {"( lock ( "            ,  9, vwrite_cmd_lock },
-        {"( unlock ( "          , 11, vwrite_cmd_unlock },
-        {"( get-lock ( "        , 13, vwrite_tuple_cstring },
-        {"( get-locks ( "       , 14, vwrite_cmd_get_locks },
-        {"( replay ( "          , 11, vwrite_cmd_replay },
-        {"( replay-range ( "    , 17, vwrite_cmd_replay_range },
-        {"( get-deleted-rev ( " , 20, vwrite_cmd_get_deleted_rev },
-        {"( get-iprops ( "      , 15, vwrite_cmd_get_iprops },
-        {"( finish-replay ( "   , 18, vwrite_cmd_no_op }
-    };
-
 
 
 
@@ -1199,10 +893,10 @@ static svn_error_t *vwrite_tuple(svn_ra_
         SVN_ERR(opt ? vwrite_tuple_string_opt(conn, pool, ap)
                     : vwrite_tuple_string(conn, pool, ap));
       else if (*fmt == '(' && !opt)
-        SVN_ERR(vwrite_tuple_start_list(conn, pool, ap));
+        SVN_ERR(write_tuple_start_list(conn, pool));
       else if (*fmt == ')')
         {
-          SVN_ERR(vwrite_tuple_end_list(conn, pool, ap));
+          SVN_ERR(write_tuple_end_list(conn, pool));
           opt = FALSE;
         }
       else if (*fmt == '?')
@@ -1847,21 +1541,715 @@ svn_error_t *svn_ra_svn_write_cmd(svn_ra
   return err ? svn_error_trace(err) : svn_ra_svn_end_list(conn, pool);
 }
 
-svn_error_t *svn_ra_svn_write_templated_cmd(svn_ra_svn_conn_t *conn,
+svn_error_t *svn_ra_svn_write_cmd_target_rev(svn_ra_svn_conn_t *conn,
+                                             apr_pool_t *pool,
+                                             svn_revnum_t rev)
+{
+  SVN_ERR(writebuf_write_short_string(conn, pool, "( target-rev ( ", 15));
+  SVN_ERR(write_tuple_revision(conn, pool, rev));
+  SVN_ERR(writebuf_write_short_string(conn, pool, ") ) ", 4));
+
+  return SVN_NO_ERROR;
+}
+
+svn_error_t *svn_ra_svn_write_cmd_open_root(svn_ra_svn_conn_t *conn,
                                             apr_pool_t *pool,
-                                            svn_ra_svn_cmd_t cmd, ...)
+                                            svn_revnum_t rev,
+                                            const char *token)
 {
-  va_list ap;
-  svn_error_t *err;
+  SVN_ERR(writebuf_write_short_string(conn, pool, "( open-root ( ", 14));
+  SVN_ERR(write_tuple_start_list(conn, pool));
+  SVN_ERR(write_tuple_revision_opt(conn, pool, rev));
+  SVN_ERR(write_tuple_end_list(conn, pool));
+  SVN_ERR(write_tuple_cstring(conn, pool, token));
+  SVN_ERR(writebuf_write_short_string(conn, pool, ") ) ", 4));
 
-  SVN_ERR(writebuf_write_short_string(conn, pool,
-                                      cmd_templates[cmd].start_sequence,
-                                      cmd_templates[cmd].start_sequence_length));
-  va_start(ap, cmd);
-  err = cmd_templates[cmd].write_ops(conn, pool, &ap);
-  va_end(ap);
+  return SVN_NO_ERROR;
+}
+
+svn_error_t *svn_ra_svn_write_cmd_delete_entry(svn_ra_svn_conn_t *conn,
+                                               apr_pool_t *pool,
+                                               const char *path,
+                                               svn_revnum_t rev,
+                                               const char *token)
+{
+  SVN_ERR(writebuf_write_short_string(conn, pool, "( delete-entry ( ", 17));
+  SVN_ERR(write_tuple_cstring(conn, pool, path));
+  SVN_ERR(write_tuple_start_list(conn, pool));
+  SVN_ERR(write_tuple_revision_opt(conn, pool, rev));
+  SVN_ERR(write_tuple_end_list(conn, pool));
+  SVN_ERR(write_tuple_cstring(conn, pool, token));
+  SVN_ERR(writebuf_write_short_string(conn, pool, ") ) ", 4));
+
+  return SVN_NO_ERROR;
+}
+
+svn_error_t *svn_ra_svn_write_cmd_add_dir(svn_ra_svn_conn_t *conn,
+                                          apr_pool_t *pool,
+                                          const char *path,
+                                          const char *parent_token,
+                                          const char *token,
+                                          const char *copy_path,
+                                          svn_revnum_t copy_rev)
+{
+  SVN_ERR(writebuf_write_short_string(conn, pool, "( add-dir ( ", 12));
+  SVN_ERR(write_cmd_add_node(conn, pool, path, parent_token, token,
+                              copy_path, copy_rev));
+  SVN_ERR(writebuf_write_short_string(conn, pool, ") ) ", 4));
+
+  return SVN_NO_ERROR;
+}
+
+svn_error_t *svn_ra_svn_write_cmd_open_dir(svn_ra_svn_conn_t *conn,
+                                           apr_pool_t *pool,
+                                           const char *path,
+                                           const char *parent_token,
+                                           const char *token,
+                                           svn_revnum_t rev)
+{
+  SVN_ERR(writebuf_write_short_string(conn, pool, "( open-dir ( ", 13));
+  SVN_ERR(write_cmd_open_node(conn, pool, path, parent_token, token, rev));
+  SVN_ERR(writebuf_write_short_string(conn, pool, ") ) ", 4));
+
+  return SVN_NO_ERROR;
+}
+
+svn_error_t *svn_ra_svn_write_cmd_change_dir_prop(svn_ra_svn_conn_t *conn,
+                                                  apr_pool_t *pool,
+                                                  const char *token,
+                                                  const char *name,
+                                                  const svn_string_t *value)
+{
+  SVN_ERR(writebuf_write_short_string(conn, pool, "( change-dir-prop ( ", 20));
+  SVN_ERR(write_cmd_change_node_prop(conn, pool, token, name, value));
+  SVN_ERR(writebuf_write_short_string(conn, pool, ") ) ", 4));
+
+  return SVN_NO_ERROR;
+}
+
+svn_error_t *svn_ra_svn_write_cmd_close_dir(svn_ra_svn_conn_t *conn,
+                                            apr_pool_t *pool,
+                                            const char *token)
+{
+  SVN_ERR(writebuf_write_short_string(conn, pool, "( close-dir ( ", 14));
+  SVN_ERR(write_tuple_cstring(conn, pool, token));
+  SVN_ERR(writebuf_write_short_string(conn, pool, ") ) ", 4));
+
+  return SVN_NO_ERROR;
+}
+
+svn_error_t *svn_ra_svn_write_cmd_absent_dir(svn_ra_svn_conn_t *conn,
+                                             apr_pool_t *pool,
+                                             const char *path,
+                                             const char *parent_token)
+{
+  SVN_ERR(writebuf_write_short_string(conn, pool, "( absent-dir ( ", 15));
+  SVN_ERR(write_cmd_absent_node(conn, pool, path, parent_token));
+  SVN_ERR(writebuf_write_short_string(conn, pool, ") ) ", 4));
+
+  return SVN_NO_ERROR;
+}
+
+svn_error_t *svn_ra_svn_write_cmd_add_file(svn_ra_svn_conn_t *conn,
+                                           apr_pool_t *pool,
+                                           const char *path,
+                                           const char *parent_token,
+                                           const char *token,
+                                           const char *copy_path,
+                                           svn_revnum_t copy_rev)
+{
+  SVN_ERR(writebuf_write_short_string(conn, pool, "( add-file ( ", 13));
+  SVN_ERR(write_cmd_add_node(conn, pool, path, parent_token, token,
+                              copy_path, copy_rev));
+  SVN_ERR(writebuf_write_short_string(conn, pool, ") ) ", 4));
+
+  return SVN_NO_ERROR;
+}
+
+svn_error_t *svn_ra_svn_write_cmd_open_file(svn_ra_svn_conn_t *conn,
+                                            apr_pool_t *pool,
+                                            const char *path,
+                                            const char *parent_token,
+                                            const char *token,
+                                            svn_revnum_t rev)
+{
+  SVN_ERR(writebuf_write_short_string(conn, pool, "( open-file ( ", 14));
+  SVN_ERR(write_cmd_open_node(conn, pool, path, parent_token, token, rev));
+  SVN_ERR(writebuf_write_short_string(conn, pool, ") ) ", 4));
+
+  return SVN_NO_ERROR;
+}
+
+svn_error_t *svn_ra_svn_write_cmd_change_file_prop(svn_ra_svn_conn_t *conn,
+                                                   apr_pool_t *pool,
+                                                   const char *token,
+                                                   const char *name,
+                                                   const svn_string_t *value)
+{
+  SVN_ERR(writebuf_write_short_string(conn, pool, "( change-file-prop ( ", 21));
+  SVN_ERR(write_cmd_change_node_prop(conn, pool, token, name, value));
+  SVN_ERR(writebuf_write_short_string(conn, pool, ") ) ", 4));
+
+  return SVN_NO_ERROR;
+}
+
+svn_error_t *svn_ra_svn_write_cmd_close_file(svn_ra_svn_conn_t *conn,
+                                             apr_pool_t *pool,
+                                             const char *token,
+                                             const char *text_checksum)
+{
+  SVN_ERR(writebuf_write_short_string(conn, pool, "( close-file ( ", 15));
+  SVN_ERR(write_tuple_cstring(conn, pool, token));
+  SVN_ERR(write_tuple_start_list(conn, pool));
+  SVN_ERR(write_tuple_cstring_opt(conn, pool, text_checksum));
+  SVN_ERR(write_tuple_end_list(conn, pool));
+  SVN_ERR(writebuf_write_short_string(conn, pool, ") ) ", 4));
+
+  return SVN_NO_ERROR;
+}
+
+svn_error_t *svn_ra_svn_write_cmd_absent_file(svn_ra_svn_conn_t *conn,
+                                              apr_pool_t *pool,
+                                              const char *path,
+                                              const char *parent_token)
+{
+  SVN_ERR(writebuf_write_short_string(conn, pool, "( absent-file ( ", 16));
+  SVN_ERR(write_cmd_absent_node(conn, pool, path, parent_token));
+  SVN_ERR(writebuf_write_short_string(conn, pool, ") ) ", 4));
+
+  return SVN_NO_ERROR;
+}
+
+svn_error_t *svn_ra_svn_write_cmd_textdelta_chunk(svn_ra_svn_conn_t *conn,
+                                                  apr_pool_t *pool,
+                                                  const char *token,
+                                                  const svn_string_t *chunk)
+{
+  SVN_ERR(writebuf_write_short_string(conn, pool, "( textdelta-chunk ( ", 20));
+  SVN_ERR(write_tuple_cstring(conn, pool, token));
+  SVN_ERR(write_tuple_string(conn, pool, chunk));
+  SVN_ERR(writebuf_write_short_string(conn, pool, ") ) ", 4));
+
+  return SVN_NO_ERROR;
+}
+
+svn_error_t *svn_ra_svn_write_cmd_textdelta_end(svn_ra_svn_conn_t *conn,
+                                                apr_pool_t *pool,
+                                                const char *token)
+{
+  SVN_ERR(writebuf_write_short_string(conn, pool, "( textdelta-end ( ", 18));
+  SVN_ERR(write_tuple_cstring(conn, pool, token));
+  SVN_ERR(writebuf_write_short_string(conn, pool, ") ) ", 4));
+
+  return SVN_NO_ERROR;
+}
+
+svn_error_t *
+svn_ra_svn_write_cmd_apply_textdelta(svn_ra_svn_conn_t *conn,
+                                     apr_pool_t *pool,
+                                     const char *token,
+                                     const char *base_checksum)
+{
+  SVN_ERR(writebuf_write_short_string(conn, pool, "( apply-textdelta ( ", 20));
+  SVN_ERR(write_tuple_cstring(conn, pool, token));
+  SVN_ERR(write_tuple_start_list(conn, pool));
+  SVN_ERR(write_tuple_cstring_opt(conn, pool, base_checksum));
+  SVN_ERR(write_tuple_end_list(conn, pool));
+  SVN_ERR(writebuf_write_short_string(conn, pool, ") ) ", 4));
+
+  return SVN_NO_ERROR;
+}
+
+svn_error_t *
+svn_ra_svn_write_cmd_close_edit(svn_ra_svn_conn_t *conn,
+                                apr_pool_t *pool)
+{
+  return writebuf_write_short_string(conn, pool, "( close-edit ( ) ) ", 19);
+}
+
+svn_error_t *
+svn_ra_svn_write_cmd_abort_edit(svn_ra_svn_conn_t *conn,
+                                apr_pool_t *pool)
+{
+  return writebuf_write_short_string(conn, pool, "( abort-edit ( ) ) ", 19);
+}
+
+svn_error_t *
+svn_ra_svn_write_cmd_set_path(svn_ra_svn_conn_t *conn,
+                              apr_pool_t *pool,
+                              const char *path,
+                              svn_revnum_t rev,
+                              svn_boolean_t start_empty,
+                              const char *lock_token,
+                              svn_depth_t depth)
+{
+  SVN_ERR(writebuf_write_short_string(conn, pool, "( set-path ( ", 13));
+  SVN_ERR(write_tuple_cstring(conn, pool, path));
+  SVN_ERR(write_tuple_revision(conn, pool, rev));
+  SVN_ERR(write_tuple_boolean(conn, pool, start_empty));
+  SVN_ERR(write_tuple_start_list(conn, pool));
+  SVN_ERR(write_tuple_cstring_opt(conn, pool, lock_token));
+  SVN_ERR(write_tuple_end_list(conn, pool));
+  SVN_ERR(write_tuple_depth(conn, pool, depth));
+  SVN_ERR(writebuf_write_short_string(conn, pool, ") ) ", 4));
+
+  return SVN_NO_ERROR;
+}
+
+svn_error_t *
+svn_ra_svn_write_cmd_delete_path(svn_ra_svn_conn_t *conn,
+                                 apr_pool_t *pool,
+                                 const char *path)
+{
+  SVN_ERR(writebuf_write_short_string(conn, pool, "( delete-path ( ", 16));
+  SVN_ERR(write_tuple_cstring(conn, pool, path));
+  SVN_ERR(writebuf_write_short_string(conn, pool, ") ) ", 4));
+
+  return SVN_NO_ERROR;
+}
+
+svn_error_t *
+svn_ra_svn_write_cmd_link_path(svn_ra_svn_conn_t *conn,
+                               apr_pool_t *pool,
+                               const char *path,
+                               const char *url,
+                               svn_revnum_t rev,
+                               svn_boolean_t start_empty,
+                               const char *lock_token,
+                               svn_depth_t depth)
+{
+  SVN_ERR(writebuf_write_short_string(conn, pool, "( link-path ( ", 14));
+  SVN_ERR(write_tuple_cstring(conn, pool, path));
+  SVN_ERR(write_tuple_cstring(conn, pool, url));
+  SVN_ERR(write_tuple_revision(conn, pool, rev));
+  SVN_ERR(write_tuple_boolean(conn, pool, start_empty));
+  SVN_ERR(write_tuple_start_list(conn, pool));
+  SVN_ERR(write_tuple_cstring_opt(conn, pool,lock_token));
+  SVN_ERR(write_tuple_end_list(conn, pool));
+  SVN_ERR(write_tuple_depth(conn, pool, depth));
+  SVN_ERR(writebuf_write_short_string(conn, pool, ") ) ", 4));
+
+  return SVN_NO_ERROR;
+}
+
+svn_error_t *
+svn_ra_svn_write_cmd_finish_report(svn_ra_svn_conn_t *conn,
+                                   apr_pool_t *pool)
+{
+  return writebuf_write_short_string(conn, pool, "( finish-report ( ) ) ", 22);
+}
+
+svn_error_t *
+svn_ra_svn_write_cmd_abort_report(svn_ra_svn_conn_t *conn,
+                                  apr_pool_t *pool)
+{
+  return writebuf_write_short_string(conn, pool, "( abort-report ( ) ) ", 21);
+}
+
+svn_error_t *
+svn_ra_svn_write_cmd_reparent(svn_ra_svn_conn_t *conn,
+                              apr_pool_t *pool,
+                              const char *url)
+{
+  SVN_ERR(writebuf_write_short_string(conn, pool, "( reparent ( ", 13));
+  SVN_ERR(write_tuple_cstring(conn, pool, url));
+  SVN_ERR(writebuf_write_short_string(conn, pool, ") ) ", 4));
+
+  return SVN_NO_ERROR;
+}
+
+svn_error_t *
+svn_ra_svn_write_cmd_get_latest_rev(svn_ra_svn_conn_t *conn,
+                                  apr_pool_t *pool)
+{
+  return writebuf_write_short_string(conn, pool, "( get-latest-rev ( ) ) ", 23);
+}
+
+svn_error_t *
+svn_ra_svn_write_cmd_get_dated_rev(svn_ra_svn_conn_t *conn,
+                                   apr_pool_t *pool,
+                                   apr_time_t tm)
+{
+  SVN_ERR(writebuf_write_short_string(conn, pool, "( get-dated-rev ( ", 18));
+  SVN_ERR(write_tuple_cstring(conn, pool, svn_time_to_cstring(tm, pool)));
+  SVN_ERR(writebuf_write_short_string(conn, pool, ") ) ", 4));
+
+  return SVN_NO_ERROR;
+}
+
+svn_error_t *
+svn_ra_svn_write_cmd_change_rev_prop2(svn_ra_svn_conn_t *conn,
+                                      apr_pool_t *pool,
+                                      svn_revnum_t rev,
+                                      const char *name,
+                                      const svn_string_t *value,
+                                      svn_boolean_t dont_care,
+                                      const svn_string_t *old_value)
+{
+  SVN_ERR(writebuf_write_short_string(conn, pool, "( change-rev-prop2 ( ", 21));
+  SVN_ERR(write_tuple_revision(conn, pool, rev));
+  SVN_ERR(write_tuple_cstring(conn, pool, name));
+  SVN_ERR(write_tuple_start_list(conn, pool));
+  SVN_ERR(write_tuple_string_opt(conn, pool, value));
+  SVN_ERR(write_tuple_end_list(conn, pool));
+  SVN_ERR(write_tuple_start_list(conn, pool));
+  SVN_ERR(write_tuple_boolean(conn, pool, dont_care));
+  SVN_ERR(write_tuple_string_opt(conn, pool, old_value));
+  SVN_ERR(write_tuple_end_list(conn, pool));
+  SVN_ERR(writebuf_write_short_string(conn, pool, ") ) ", 4));
+
+  return SVN_NO_ERROR;
+}
 
-  return err ? err : writebuf_write_short_string(conn, pool, ") ) ", 4);
+svn_error_t *
+svn_ra_svn_write_cmd_change_rev_prop(svn_ra_svn_conn_t *conn,
+                                     apr_pool_t *pool,
+                                     svn_revnum_t rev,
+                                     const char *name,
+                                     const svn_string_t *value)
+{
+  SVN_ERR(writebuf_write_short_string(conn, pool, "( change-rev-prop ( ", 20));
+  SVN_ERR(write_tuple_revision(conn, pool, rev));
+  SVN_ERR(write_tuple_cstring(conn, pool, name));
+  SVN_ERR(write_tuple_string_opt(conn, pool, value));
+  SVN_ERR(writebuf_write_short_string(conn, pool, ") ) ", 4));
+
+  return SVN_NO_ERROR;
+}
+
+svn_error_t *
+svn_ra_svn_write_cmd_rev_proplist(svn_ra_svn_conn_t *conn,
+                                  apr_pool_t *pool,
+                                  svn_revnum_t rev)
+{
+  SVN_ERR(writebuf_write_short_string(conn, pool, "( rev-proplist ( ", 17));
+  SVN_ERR(write_tuple_revision(conn, pool, rev));
+  SVN_ERR(writebuf_write_short_string(conn, pool, ") ) ", 4));
+
+  return SVN_NO_ERROR;
+}
+
+svn_error_t *
+svn_ra_svn_write_cmd_rev_prop(svn_ra_svn_conn_t *conn,
+                              apr_pool_t *pool,
+                              svn_revnum_t rev,
+                              const char *name)
+{
+  SVN_ERR(writebuf_write_short_string(conn, pool, "( rev-prop ( ", 13));
+  SVN_ERR(write_tuple_revision(conn, pool, rev));
+  SVN_ERR(write_tuple_cstring(conn, pool, name));
+  SVN_ERR(writebuf_write_short_string(conn, pool, ") ) ", 4));
+
+  return SVN_NO_ERROR;
+}
+
+svn_error_t *
+svn_ra_svn_write_cmd_get_file(svn_ra_svn_conn_t *conn,
+                              apr_pool_t *pool,
+                              const char *path,
+                              svn_revnum_t rev,
+                              svn_boolean_t props,
+                              svn_boolean_t stream)
+{
+  SVN_ERR(writebuf_write_short_string(conn, pool, "( get-file ( ", 13));
+  SVN_ERR(write_tuple_cstring(conn, pool, path));
+  SVN_ERR(write_tuple_start_list(conn, pool));
+  SVN_ERR(write_tuple_revision_opt(conn, pool, rev));
+  SVN_ERR(write_tuple_end_list(conn, pool));
+  SVN_ERR(write_tuple_boolean(conn, pool, props));
+  SVN_ERR(write_tuple_boolean(conn, pool, stream));
+  SVN_ERR(writebuf_write_short_string(conn, pool, ") ) ", 4));
+
+  return SVN_NO_ERROR;
+}
+
+svn_error_t *
+svn_ra_svn_write_cmd_update(svn_ra_svn_conn_t *conn,
+                            apr_pool_t *pool,
+                            svn_revnum_t rev,
+                            const char *target,
+                            svn_boolean_t recurse,
+                            svn_depth_t depth,
+                            svn_boolean_t send_copyfrom_args)
+{
+  SVN_ERR(writebuf_write_short_string(conn, pool, "( update ( ", 11));
+  SVN_ERR(write_tuple_start_list(conn, pool));
+  SVN_ERR(write_tuple_revision_opt(conn, pool, rev));
+  SVN_ERR(write_tuple_end_list(conn, pool));
+  SVN_ERR(write_tuple_cstring(conn, pool, target));
+  SVN_ERR(write_tuple_boolean(conn, pool, recurse));
+  SVN_ERR(write_tuple_depth(conn, pool, depth));
+  SVN_ERR(write_tuple_boolean(conn, pool, send_copyfrom_args));
+  SVN_ERR(writebuf_write_short_string(conn, pool, ") ) ", 4));
+
+  return SVN_NO_ERROR;
+}
+
+svn_error_t *
+svn_ra_svn_write_cmd_switch(svn_ra_svn_conn_t *conn,
+                            apr_pool_t *pool,
+                            svn_revnum_t rev,
+                            const char *target,
+                            svn_boolean_t recurse,
+                            const char *switch_url,
+                            svn_depth_t depth,
+                            svn_boolean_t send_copyfrom_args,
+                            svn_boolean_t ignore_ancestry)
+{
+  SVN_ERR(writebuf_write_short_string(conn, pool, "( switch ( ", 11));
+  SVN_ERR(write_tuple_start_list(conn, pool));
+  SVN_ERR(write_tuple_revision_opt(conn, pool, rev));
+  SVN_ERR(write_tuple_end_list(conn, pool));
+  SVN_ERR(write_tuple_cstring(conn, pool, target));
+  SVN_ERR(write_tuple_boolean(conn, pool, recurse));
+  SVN_ERR(write_tuple_cstring(conn, pool, switch_url));
+  SVN_ERR(write_tuple_depth(conn, pool, depth));
+  SVN_ERR(write_tuple_boolean(conn, pool, send_copyfrom_args));
+  SVN_ERR(write_tuple_boolean(conn, pool, ignore_ancestry));
+  SVN_ERR(writebuf_write_short_string(conn, pool, ") ) ", 4));
+
+  return SVN_NO_ERROR;
+}
+
+svn_error_t *
+svn_ra_svn_write_cmd_status(svn_ra_svn_conn_t *conn,
+                            apr_pool_t *pool,
+                            const char *target,
+                            svn_boolean_t recurse,
+                            svn_revnum_t rev,
+                            svn_depth_t depth)
+{
+  SVN_ERR(writebuf_write_short_string(conn, pool, "( status ( ", 11));
+  SVN_ERR(write_tuple_cstring(conn, pool, target));
+  SVN_ERR(write_tuple_boolean(conn, pool, recurse));
+  SVN_ERR(write_tuple_start_list(conn, pool));
+  SVN_ERR(write_tuple_revision_opt(conn, pool, rev));
+  SVN_ERR(write_tuple_end_list(conn, pool));
+  SVN_ERR(write_tuple_depth(conn, pool, depth));
+  SVN_ERR(writebuf_write_short_string(conn, pool, ") ) ", 4));
+
+  return SVN_NO_ERROR;
+}
+
+svn_error_t *
+svn_ra_svn_write_cmd_diff(svn_ra_svn_conn_t *conn,
+                          apr_pool_t *pool,
+                          svn_revnum_t rev,
+                          const char *target,
+                          svn_boolean_t recurse,
+                          svn_boolean_t ignore_ancestry,
+                          const char *versus_url,
+                          svn_boolean_t text_deltas,
+                          svn_depth_t depth)
+{
+  SVN_ERR(writebuf_write_short_string(conn, pool, "( diff ( ", 9));
+  SVN_ERR(write_tuple_start_list(conn, pool));
+  SVN_ERR(write_tuple_revision_opt(conn, pool, rev));
+  SVN_ERR(write_tuple_end_list(conn, pool));
+  SVN_ERR(write_tuple_cstring(conn, pool, target));
+  SVN_ERR(write_tuple_boolean(conn, pool, recurse));
+  SVN_ERR(write_tuple_boolean(conn, pool, ignore_ancestry));
+  SVN_ERR(write_tuple_cstring(conn, pool, versus_url));
+  SVN_ERR(write_tuple_boolean(conn, pool, text_deltas));
+  SVN_ERR(write_tuple_depth(conn, pool, depth));
+  SVN_ERR(writebuf_write_short_string(conn, pool, ") ) ", 4));
+
+  return SVN_NO_ERROR;
+}
+
+svn_error_t *
+svn_ra_svn_write_cmd_check_path(svn_ra_svn_conn_t *conn,
+                                apr_pool_t *pool,
+                                const char *path,
+                                svn_revnum_t rev)
+{
+  SVN_ERR(writebuf_write_short_string(conn, pool, "( check-path ( ", 15));
+  SVN_ERR(write_tuple_cstring(conn, pool, path));
+  SVN_ERR(write_tuple_start_list(conn, pool));
+  SVN_ERR(write_tuple_revision_opt(conn, pool, rev));
+  SVN_ERR(write_tuple_end_list(conn, pool));
+  SVN_ERR(writebuf_write_short_string(conn, pool, ") ) ", 4));
+
+  return SVN_NO_ERROR;
+}
+
+svn_error_t *
+svn_ra_svn_write_cmd_stat(svn_ra_svn_conn_t *conn,
+                          apr_pool_t *pool,
+                          const char *path,
+                          svn_revnum_t rev)
+{
+  SVN_ERR(writebuf_write_short_string(conn, pool, "( stat ( ", 9));
+  SVN_ERR(write_tuple_cstring(conn, pool, path));
+  SVN_ERR(write_tuple_start_list(conn, pool));
+  SVN_ERR(write_tuple_revision_opt(conn, pool, rev));
+  SVN_ERR(write_tuple_end_list(conn, pool));
+  SVN_ERR(writebuf_write_short_string(conn, pool, ") ) ", 4));
+
+  return SVN_NO_ERROR;
+}
+
+svn_error_t *
+svn_ra_svn_write_cmd_get_file_revs(svn_ra_svn_conn_t *conn,
+                                   apr_pool_t *pool,
+                                   const char *path,
+                                   svn_revnum_t start,
+                                   svn_revnum_t end,
+                                   svn_boolean_t include_merged_revisions)
+{
+  SVN_ERR(writebuf_write_short_string(conn, pool, "( get-file-revs ( ", 18));
+  SVN_ERR(write_tuple_cstring(conn, pool, path));
+  SVN_ERR(write_tuple_start_list(conn, pool));
+  SVN_ERR(write_tuple_revision_opt(conn, pool, start));
+  SVN_ERR(write_tuple_end_list(conn, pool));
+  SVN_ERR(write_tuple_start_list(conn, pool));
+  SVN_ERR(write_tuple_revision_opt(conn, pool, end));
+  SVN_ERR(write_tuple_end_list(conn, pool));
+  SVN_ERR(write_tuple_boolean(conn, pool, include_merged_revisions));
+  SVN_ERR(writebuf_write_short_string(conn, pool, ") ) ", 4));
+
+  return SVN_NO_ERROR;
+}
+
+svn_error_t *
+svn_ra_svn_write_cmd_lock(svn_ra_svn_conn_t *conn,
+                          apr_pool_t *pool,
+                          const char *path,
+                          const char *comment,
+                          svn_boolean_t steal_lock,
+                          svn_revnum_t revnum)
+{
+  SVN_ERR(writebuf_write_short_string(conn, pool, "( lock ( ", 9));
+  SVN_ERR(write_tuple_cstring(conn, pool, path));
+  SVN_ERR(write_tuple_start_list(conn, pool));
+  SVN_ERR(write_tuple_cstring_opt(conn, pool, comment));
+  SVN_ERR(write_tuple_end_list(conn, pool));
+  SVN_ERR(write_tuple_boolean(conn, pool, steal_lock));
+  SVN_ERR(write_tuple_start_list(conn, pool));
+  SVN_ERR(write_tuple_revision_opt(conn, pool, revnum));
+  SVN_ERR(write_tuple_end_list(conn, pool));
+  SVN_ERR(writebuf_write_short_string(conn, pool, ") ) ", 4));
+
+  return SVN_NO_ERROR;
+}
+
+svn_error_t *
+svn_ra_svn_write_cmd_unlock(svn_ra_svn_conn_t *conn,
+                            apr_pool_t *pool,
+                            const char *path,
+                            const char *token,
+                            svn_boolean_t break_lock)
+{
+  SVN_ERR(writebuf_write_short_string(conn, pool, "( unlock ( ", 11));
+  SVN_ERR(write_tuple_cstring(conn, pool, path));
+  SVN_ERR(write_tuple_start_list(conn, pool));
+  SVN_ERR(write_tuple_cstring_opt(conn, pool, token));
+  SVN_ERR(write_tuple_end_list(conn, pool));
+  SVN_ERR(write_tuple_boolean(conn, pool, break_lock));
+  SVN_ERR(writebuf_write_short_string(conn, pool, ") ) ", 4));
+
+  return SVN_NO_ERROR;
+}
+
+svn_error_t *
+svn_ra_svn_write_cmd_get_lock(svn_ra_svn_conn_t *conn,
+                              apr_pool_t *pool,
+                              const char *path)
+{
+  SVN_ERR(writebuf_write_short_string(conn, pool, "( get-lock ( ", 13));
+  SVN_ERR(write_tuple_cstring(conn, pool, path));
+  SVN_ERR(writebuf_write_short_string(conn, pool, ") ) ", 4));
+
+  return SVN_NO_ERROR;
+}
+
+svn_error_t *
+svn_ra_svn_write_cmd_get_locks(svn_ra_svn_conn_t *conn,
+                               apr_pool_t *pool,
+                               const char *path,
+                               svn_depth_t depth)
+{
+  SVN_ERR(writebuf_write_short_string(conn, pool, "( get-locks ( ", 14));
+  SVN_ERR(write_tuple_cstring(conn, pool, path));
+  SVN_ERR(write_tuple_start_list(conn, pool));
+  SVN_ERR(write_tuple_depth(conn, pool, depth));
+  SVN_ERR(write_tuple_end_list(conn, pool));
+  SVN_ERR(writebuf_write_short_string(conn, pool, ") ) ", 4));
+
+  return SVN_NO_ERROR;
+}
+
+svn_error_t *
+svn_ra_svn_write_cmd_replay(svn_ra_svn_conn_t *conn,
+                            apr_pool_t *pool,
+                            svn_revnum_t rev,
+                            svn_revnum_t low_water_mark,
+                            svn_boolean_t send_deltas)
+{
+  SVN_ERR(writebuf_write_short_string(conn, pool, "( replay ( ", 11));
+  SVN_ERR(write_tuple_revision(conn, pool, rev));
+  SVN_ERR(write_tuple_revision(conn, pool, low_water_mark));
+  SVN_ERR(write_tuple_boolean(conn, pool, send_deltas));
+  SVN_ERR(writebuf_write_short_string(conn, pool, ") ) ", 4));
+
+  return SVN_NO_ERROR;
+}
+
+svn_error_t *
+svn_ra_svn_write_cmd_replay_range(svn_ra_svn_conn_t *conn,
+                                  apr_pool_t *pool,
+                                  svn_revnum_t start_revision,
+                                  svn_revnum_t end_revision,
+                                  svn_revnum_t low_water_mark,
+                                  svn_boolean_t send_deltas)
+{
+  SVN_ERR(writebuf_write_short_string(conn, pool, "( replay-range ( ", 17));
+  SVN_ERR(write_tuple_revision(conn, pool, start_revision));
+  SVN_ERR(write_tuple_revision(conn, pool, end_revision));
+  SVN_ERR(write_tuple_revision(conn, pool, low_water_mark));
+  SVN_ERR(write_tuple_boolean(conn, pool, send_deltas));
+  SVN_ERR(writebuf_write_short_string(conn, pool, ") ) ", 4));
+
+  return SVN_NO_ERROR;
+}
+
+svn_error_t *
+svn_ra_svn_write_cmd_get_deleted_rev(svn_ra_svn_conn_t *conn,
+                                     apr_pool_t *pool,
+                                     const char *path,
+                                     svn_revnum_t peg_revision,
+                                     svn_revnum_t end_revision)
+{
+  SVN_ERR(writebuf_write_short_string(conn, pool, "( get-deleted-rev ( ", 20));
+  SVN_ERR(write_tuple_cstring(conn, pool, path));
+  SVN_ERR(write_tuple_revision(conn, pool, peg_revision));
+  SVN_ERR(write_tuple_revision(conn, pool, end_revision));
+  SVN_ERR(writebuf_write_short_string(conn, pool, ") ) ", 4));
+
+  return SVN_NO_ERROR;
+}
+
+svn_error_t *
+svn_ra_svn_write_cmd_get_iprops(svn_ra_svn_conn_t *conn,
+                                apr_pool_t *pool,
+                                const char *path,
+                                svn_revnum_t revision)
+{
+  SVN_ERR(writebuf_write_short_string(conn, pool, "( get-iprops ( ", 15));
+  SVN_ERR(write_tuple_cstring(conn, pool, path));
+  SVN_ERR(write_tuple_start_list(conn, pool));
+  SVN_ERR(write_tuple_revision_opt(conn, pool, revision));
+  SVN_ERR(write_tuple_end_list(conn, pool));
+  SVN_ERR(writebuf_write_short_string(conn, pool, ") ) ", 4));
+
+  return SVN_NO_ERROR;
+}
+
+svn_error_t *
+svn_ra_svn_write_cmd_finish_replay(svn_ra_svn_conn_t *conn,
+                                   apr_pool_t *pool)
+{
+  return writebuf_write_short_string(conn, pool, "( finish-replay ( ) ) ", 22);
 }
 
 svn_error_t *svn_ra_svn_write_cmd_response(svn_ra_svn_conn_t *conn,

Modified: subversion/trunk/subversion/svnserve/serve.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svnserve/serve.c?rev=1464763&r1=1464762&r2=1464763&view=diff
==============================================================================
--- subversion/trunk/subversion/svnserve/serve.c (original)
+++ subversion/trunk/subversion/svnserve/serve.c Thu Apr  4 21:03:54 2013
@@ -2975,8 +2975,7 @@ static svn_error_t *replay_one_revision(
     svn_error_clear(editor->abort_edit(edit_baton, pool));
   SVN_CMD_ERR(err);
 
-  return svn_ra_svn_write_templated_cmd(conn, pool,
-                                        svn_ra_svn_cmd_finish_replay);
+  return svn_ra_svn_write_cmd_finish_replay(conn, pool);
 }
 
 static svn_error_t *replay(svn_ra_svn_conn_t *conn, apr_pool_t *pool,



Mime
View raw message