subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From phi...@apache.org
Subject svn commit: r1136137 - /subversion/trunk/subversion/libsvn_wc/workqueue.c
Date Wed, 15 Jun 2011 18:12:20 GMT
Author: philip
Date: Wed Jun 15 18:12:20 2011
New Revision: 1136137

URL: http://svn.apache.org/viewvc?rev=1136137&view=rev
Log:
Revert part of r1136038 as it is unnecessary.  Add some
SVN_DEBUG_WORK_QUEUE code.

* subversion/libsvn_wc/workqueue.c
  (run_file_copy_translated): Revert allowing source to be missing.
  (dispatch_work_item): Add some more SVN_DEBUG_WORK_QUEUE code.
  (svn_wc__wq_run): Add some SVN_DEBUG_WORK_QUEUE code to allow
   cancellation to be simulated.

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

Modified: subversion/trunk/subversion/libsvn_wc/workqueue.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/workqueue.c?rev=1136137&r1=1136136&r2=1136137&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/workqueue.c (original)
+++ subversion/trunk/subversion/libsvn_wc/workqueue.c Wed Jun 15 18:12:20 2011
@@ -955,7 +955,6 @@ run_file_copy_translated(svn_wc__db_t *d
   const char *eol;
   apr_hash_t *keywords;
   svn_boolean_t special;
-  svn_error_t *err;
 
   local_relpath = apr_pstrmemdup(scratch_pool, arg1->data, arg1->len);
   SVN_ERR(svn_wc__db_from_relpath(&local_abspath, db, wri_abspath,
@@ -977,28 +976,12 @@ run_file_copy_translated(svn_wc__db_t *d
                                      db, local_abspath, NULL, FALSE,
                                      scratch_pool, scratch_pool));
 
-  err = svn_subst_copy_and_translate4(src_abspath, dst_abspath,
-                                      eol, TRUE /* repair */,
-                                      keywords, TRUE /* expand */,
-                                      special,
-                                      cancel_func, cancel_baton,
-                                      scratch_pool);
-  if (err && APR_STATUS_IS_ENOENT(err->apr_err))
-    {
-      svn_error_t *err2;
-      svn_node_kind_t kind;
-
-      /* The source file can be missing when the wq item is rerun. */
-      err2 = svn_io_check_path(src_abspath, &kind, scratch_pool);
-      if (!err2 && kind == svn_node_none)
-        {
-          svn_error_clear(err);
-          return SVN_NO_ERROR;
-        }
-      svn_error_clear(err2);
-      return svn_error_return(err);
-    }
-
+  SVN_ERR(svn_subst_copy_and_translate4(src_abspath, dst_abspath,
+                                        eol, TRUE /* repair */,
+                                        keywords, TRUE /* expand */,
+                                        special,
+                                        cancel_func, cancel_baton,
+                                        scratch_pool));
   return SVN_NO_ERROR;
 }
 
@@ -1478,6 +1461,9 @@ dispatch_work_item(svn_wc__db_t *db,
                                 scratch_pool));
 
 #ifdef SVN_RUN_WORK_QUEUE_TWICE
+#ifdef SVN_DEBUG_WORK_QUEUE
+          SVN_DBG(("dispatch: operation='%s'\n", scan->name));
+#endif
           /* Being able to run every workqueue item twice is one
              requirement for workqueues to be restartable. */
           SVN_ERR((*scan->func)(db, work_item, wri_abspath,
@@ -1521,6 +1507,13 @@ svn_wc__wq_run(svn_wc__db_t *db,
 
 #ifdef SVN_DEBUG_WORK_QUEUE
   SVN_DBG(("wq_run: wri='%s'\n", wri_abspath));
+  {
+    static int count = 0;
+    const char *count_env_var = getenv("SVN_DEBUG_WORK_QUEUE");
+
+    if (count_env_var && ++count == atoi(count_env_var))
+      return svn_error_create(SVN_ERR_CANCELLED, NULL, "fake cancel");
+  }
 #endif
 
   while (TRUE)



Mime
View raw message