You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by gs...@apache.org on 2010/03/19 21:04:03 UTC

svn commit: r925401 - in /subversion/trunk/subversion/libsvn_wc: workqueue.c workqueue.h

Author: gstein
Date: Fri Mar 19 20:04:03 2010
New Revision: 925401

URL: http://svn.apache.org/viewvc?rev=925401&view=rev
Log:
Sketch out the basics for the OP_FILE_INSTALL work item.

* subversion/libsvn_wc/workqueue.h:
  (svn_wc__wq_build_file_install): new function to build an OP_FILE_INSTALL
    work item.

* subversion/libsvn_wc/workqueue.c:
  (OP_FILE_INSTALL): new operation code
  (run_file_install): new handler to perform the installation of the
    working file.
  (svn_wc__wq_build_file_install): build and return a work item to install
    a new working file.
  (dispatch_table): add the new work item

Modified:
    subversion/trunk/subversion/libsvn_wc/workqueue.c
    subversion/trunk/subversion/libsvn_wc/workqueue.h

Modified: subversion/trunk/subversion/libsvn_wc/workqueue.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/workqueue.c?rev=925401&r1=925400&r2=925401&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/workqueue.c (original)
+++ subversion/trunk/subversion/libsvn_wc/workqueue.c Fri Mar 19 20:04:03 2010
@@ -60,6 +60,7 @@
 #define OP_POSTCOMMIT "postcommit"
 #define OP_INSTALL_PROPERTIES "install-properties"
 #define OP_DELETE "delete"
+#define OP_FILE_INSTALL "file-install"
 
 
 struct work_item_dispatch {
@@ -1806,6 +1807,7 @@ svn_wc__wq_add_install_properties(svn_wc
   return SVN_NO_ERROR;
 }
 
+
 /* ------------------------------------------------------------------------ */
 
 /* OP_DELETE */
@@ -1899,6 +1901,60 @@ svn_wc__wq_add_delete(svn_wc__db_t *db,
 
 /* ------------------------------------------------------------------------ */
 
+/* OP_FILE_INSTALL */
+
+/* Process the OP_FILE_INSTALL work item WORK_ITEM.
+ * See svn_wc__wq_build_file_install() which generates this work item.
+ * Implements (struct work_item_dispatch).func. */
+static svn_error_t *
+run_file_install(svn_wc__db_t *db,
+                 const svn_skel_t *work_item,
+                 svn_cancel_func_t cancel_func,
+                 void *cancel_baton,
+                 apr_pool_t *scratch_pool)
+{
+  const svn_skel_t *arg1 = work_item->children->next;
+  const char *local_abspath;
+  svn_boolean_t use_commit_times;
+  svn_boolean_t record_fileinfo;
+
+  local_abspath = apr_pstrmemdup(scratch_pool, arg1->data, arg1->len);
+  use_commit_times = svn_skel__parse_int(arg1->next, scratch_pool) != 0;
+  record_fileinfo = svn_skel__parse_int(arg1->next->next, scratch_pool) != 0;
+
+  /* ### do something  */
+  NOT_IMPLEMENTED();
+
+  return SVN_NO_ERROR;
+}
+
+
+svn_error_t *
+svn_wc__wq_build_file_install(const svn_skel_t **work_item,
+                              svn_wc__db_t *db,
+                              const char *local_abspath,
+                              svn_boolean_t use_commit_times,
+                              svn_boolean_t record_fileinfo,
+                              apr_pool_t *result_pool,
+                              apr_pool_t *scratch_pool)
+{
+  svn_skel_t *build_item = svn_skel__make_empty_list(result_pool);
+
+  svn_skel__prepend_int(record_fileinfo, build_item, result_pool);
+  svn_skel__prepend_int(use_commit_times, build_item, result_pool);
+  svn_skel__prepend_str(apr_pstrdup(result_pool, local_abspath),
+                        build_item, result_pool);
+  svn_skel__prepend_str(OP_FILE_INSTALL, build_item, result_pool);
+
+  /* Done. Assign to the const-ful WORK_ITEM.  */
+  *work_item = build_item;
+
+  return SVN_NO_ERROR;
+}
+
+
+/* ------------------------------------------------------------------------ */
+
 static const struct work_item_dispatch dispatch_table[] = {
   { OP_REVERT, run_revert },
   { OP_PREPARE_REVERT_FILES, run_prepare_revert_files },
@@ -1909,6 +1965,7 @@ static const struct work_item_dispatch d
   { OP_POSTCOMMIT, run_postcommit },
   { OP_INSTALL_PROPERTIES, run_install_properties },
   { OP_DELETE, run_delete },
+  { OP_FILE_INSTALL, run_file_install },
 
   /* Sentinel.  */
   { NULL }

Modified: subversion/trunk/subversion/libsvn_wc/workqueue.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/workqueue.h?rev=925401&r1=925400&r2=925401&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/workqueue.h (original)
+++ subversion/trunk/subversion/libsvn_wc/workqueue.h Fri Mar 19 20:04:03 2010
@@ -62,6 +62,21 @@ svn_wc__wq_run(svn_wc__db_t *db,
                apr_pool_t *scratch_pool);
 
 
+/* Build a work item (returned in *WORK_ITEM) that will install the working
+   copy file at LOCAL_ABSPATH. If USE_COMMIT_TIMES is TRUE, then the newly
+   installed file will use the nodes CHANGE_DATE for the file timestamp.
+   If RECORD_FILEINFO is TRUE, then the resulting LAST_MOD_TIME and
+   TRANSLATED_SIZE will be recorded in the database.  */
+svn_error_t *
+svn_wc__wq_build_file_install(const svn_skel_t **work_item,
+                              svn_wc__db_t *db,
+                              const char *local_abspath,
+                              svn_boolean_t use_commit_times,
+                              svn_boolean_t record_fileinfo,
+                              apr_pool_t *result_pool,
+                              apr_pool_t *scratch_pool);
+
+
 /* Record a work item to revert LOCAL_ABSPATH.  */
 svn_error_t *
 svn_wc__wq_add_revert(svn_boolean_t *will_revert,