subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From prabh...@apache.org
Subject svn commit: r1457684 [16/22] - in /subversion/branches/verify-keep-going: ./ build/ build/ac-macros/ build/generator/ build/generator/templates/ notes/ subversion/bindings/javahl/native/ subversion/bindings/javahl/src/org/apache/subversion/javahl/ subv...
Date Mon, 18 Mar 2013 09:35:29 GMT
Modified: subversion/branches/verify-keep-going/subversion/libsvn_wc/workqueue.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_wc/workqueue.c?rev=1457684&r1=1457683&r2=1457684&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_wc/workqueue.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_wc/workqueue.c Mon Mar 18 09:35:24
2013
@@ -63,10 +63,12 @@
 /* For work queue debugging. Generates output about its operation.  */
 /* #define SVN_DEBUG_WORK_QUEUE */
 
+typedef struct work_item_baton_t work_item_baton_t;
 
 struct work_item_dispatch {
   const char *name;
-  svn_error_t *(*func)(svn_wc__db_t *db,
+  svn_error_t *(*func)(work_item_baton_t *wqb,
+                       svn_wc__db_t *db,
                        const svn_skel_t *work_item,
                        const char *wri_abspath,
                        svn_cancel_func_t cancel_func,
@@ -74,30 +76,12 @@ struct work_item_dispatch {
                        apr_pool_t *scratch_pool);
 };
 
-
+/* Forward definition */
 static svn_error_t *
-get_and_record_fileinfo(svn_wc__db_t *db,
+get_and_record_fileinfo(work_item_baton_t *wqb,
                         const char *local_abspath,
                         svn_boolean_t ignore_enoent,
-                        apr_pool_t *scratch_pool)
-{
-  const svn_io_dirent2_t *dirent;
-
-  SVN_ERR(svn_io_stat_dirent(&dirent, local_abspath, ignore_enoent,
-                             scratch_pool, scratch_pool));
-
-  if (dirent->kind == svn_node_none)
-    {
-      /* Skip file not found if ignore_enoent */
-      return SVN_NO_ERROR;
-    }
-
-  return svn_error_trace(svn_wc__db_global_record_fileinfo(
-                           db, local_abspath,
-                           dirent->filesize, dirent->mtime,
-                           scratch_pool));
-}
-
+                        apr_pool_t *scratch_pool);
 
 /* ------------------------------------------------------------------------ */
 /* OP_REMOVE_BASE  */
@@ -111,7 +95,8 @@ get_and_record_fileinfo(svn_wc__db_t *db
  * See svn_wc__wq_build_remove_base() which generates this work item.
  * Implements (struct work_item_dispatch).func. */
 static svn_error_t *
-run_base_remove(svn_wc__db_t *db,
+run_base_remove(work_item_baton_t *wqb,
+                svn_wc__db_t *db,
                 const svn_skel_t *work_item,
                 const char *wri_abspath,
                 svn_cancel_func_t cancel_func,
@@ -349,7 +334,8 @@ process_commit_file_install(svn_wc__db_t
 
 
 static svn_error_t *
-run_file_commit(svn_wc__db_t *db,
+run_file_commit(work_item_baton_t *wqb,
+                svn_wc__db_t *db,
                 const svn_skel_t *work_item,
                 const char *wri_abspath,
                 svn_cancel_func_t cancel_func,
@@ -397,7 +383,8 @@ svn_wc__wq_build_file_commit(svn_skel_t 
 /* OP_POSTUPGRADE  */
 
 static svn_error_t *
-run_postupgrade(svn_wc__db_t *db,
+run_postupgrade(work_item_baton_t *wqb,
+                svn_wc__db_t *db,
                 const svn_skel_t *work_item,
                 const char *wri_abspath,
                 svn_cancel_func_t cancel_func,
@@ -465,7 +452,8 @@ svn_wc__wq_build_postupgrade(svn_skel_t 
  * 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,
+run_file_install(work_item_baton_t *wqb,
+                 svn_wc__db_t *db,
                  const svn_skel_t *work_item,
                  const char *wri_abspath,
                  svn_cancel_func_t cancel_func,
@@ -665,7 +653,7 @@ run_file_install(svn_wc__db_t *db,
   /* ### this should happen before we rename the file into place.  */
   if (record_fileinfo)
     {
-      SVN_ERR(get_and_record_fileinfo(db, local_abspath,
+      SVN_ERR(get_and_record_fileinfo(wqb, local_abspath,
                                       FALSE /* ignore_enoent */,
                                       scratch_pool));
     }
@@ -685,19 +673,25 @@ svn_wc__wq_build_file_install(svn_skel_t
                               apr_pool_t *scratch_pool)
 {
   const char *local_relpath;
+  const char *wri_abspath;
   *work_item = svn_skel__make_empty_list(result_pool);
 
+  /* Use the directory of the file to install as wri_abspath to avoid
+     filestats on just obtaining the wc-root */
+  wri_abspath = svn_dirent_dirname(local_abspath, scratch_pool);
+
   /* If a SOURCE_ABSPATH was provided, then put it into the skel. If this
-     value is not provided, then the file's pristine contents will be used.  */
+     value is not provided, then the file's pristine contents will be used. */
   if (source_abspath != NULL)
     {
-      SVN_ERR(svn_wc__db_to_relpath(&local_relpath, db, local_abspath,
-                                    source_abspath, result_pool, scratch_pool));
+      SVN_ERR(svn_wc__db_to_relpath(&local_relpath, db, wri_abspath,
+                                    source_abspath,
+                                    result_pool, scratch_pool));
 
       svn_skel__prepend_str(local_relpath, *work_item, result_pool);
     }
 
-  SVN_ERR(svn_wc__db_to_relpath(&local_relpath, db, local_abspath,
+  SVN_ERR(svn_wc__db_to_relpath(&local_relpath, db, wri_abspath,
                                 local_abspath, result_pool, scratch_pool));
 
   svn_skel__prepend_int(record_fileinfo, *work_item, result_pool);
@@ -717,12 +711,13 @@ svn_wc__wq_build_file_install(svn_skel_t
  * See svn_wc__wq_build_file_remove() which generates this work item.
  * Implements (struct work_item_dispatch).func. */
 static svn_error_t *
-run_file_remove(svn_wc__db_t *db,
-                 const svn_skel_t *work_item,
-                 const char *wri_abspath,
-                 svn_cancel_func_t cancel_func,
-                 void *cancel_baton,
-                 apr_pool_t *scratch_pool)
+run_file_remove(work_item_baton_t *wqb,
+                svn_wc__db_t *db,
+                const svn_skel_t *work_item,
+                const char *wri_abspath,
+                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_relpath;
@@ -766,7 +761,8 @@ svn_wc__wq_build_file_remove(svn_skel_t 
  * See svn_wc__wq_build_file_remove() which generates this work item.
  * Implements (struct work_item_dispatch).func. */
 static svn_error_t *
-run_dir_remove(svn_wc__db_t *db,
+run_dir_remove(work_item_baton_t *wqb,
+               svn_wc__db_t *db,
                const svn_skel_t *work_item,
                const char *wri_abspath,
                svn_cancel_func_t cancel_func,
@@ -847,12 +843,13 @@ svn_wc__wq_build_dir_remove(svn_skel_t *
  * See svn_wc__wq_build_file_move() which generates this work item.
  * Implements (struct work_item_dispatch).func. */
 static svn_error_t *
-run_file_move(svn_wc__db_t *db,
-                 const svn_skel_t *work_item,
-                 const char *wri_abspath,
-                 svn_cancel_func_t cancel_func,
-                 void *cancel_baton,
-                 apr_pool_t *scratch_pool)
+run_file_move(work_item_baton_t *wqb,
+              svn_wc__db_t *db,
+              const svn_skel_t *work_item,
+              const char *wri_abspath,
+              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 *src_abspath, *dst_abspath;
@@ -929,7 +926,8 @@ svn_wc__wq_build_file_move(svn_skel_t **
  * See run_file_copy_translated() which generates this work item.
  * Implements (struct work_item_dispatch).func. */
 static svn_error_t *
-run_file_copy_translated(svn_wc__db_t *db,
+run_file_copy_translated(work_item_baton_t *wqb,
+                         svn_wc__db_t *db,
                          const svn_skel_t *work_item,
                          const char *wri_abspath,
                          svn_cancel_func_t cancel_func,
@@ -1023,12 +1021,13 @@ svn_wc__wq_build_file_copy_translated(sv
 /* OP_DIRECTORY_INSTALL  */
 
 static svn_error_t *
-run_dir_install(svn_wc__db_t *db,
-                    const svn_skel_t *work_item,
-                    const char *wri_abspath,
-                    svn_cancel_func_t cancel_func,
-                    void *cancel_baton,
-                    apr_pool_t *scratch_pool)
+run_dir_install(work_item_baton_t *wqb,
+                svn_wc__db_t *db,
+                const svn_skel_t *work_item,
+                const char *wri_abspath,
+                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_relpath;
@@ -1072,7 +1071,8 @@ svn_wc__wq_build_dir_install(svn_skel_t 
  * See svn_wc__wq_build_sync_file_flags() which generates this work item.
  * Implements (struct work_item_dispatch).func. */
 static svn_error_t *
-run_sync_file_flags(svn_wc__db_t *db,
+run_sync_file_flags(work_item_baton_t *wqb,
+                    svn_wc__db_t *db,
                     const svn_skel_t *work_item,
                     const char *wri_abspath,
                     svn_cancel_func_t cancel_func,
@@ -1117,7 +1117,8 @@ svn_wc__wq_build_sync_file_flags(svn_ske
 /* OP_PREJ_INSTALL  */
 
 static svn_error_t *
-run_prej_install(svn_wc__db_t *db,
+run_prej_install(work_item_baton_t *wqb,
+                 svn_wc__db_t *db,
                  const svn_skel_t *work_item,
                  const char *wri_abspath,
                  svn_cancel_func_t cancel_func,
@@ -1196,7 +1197,8 @@ svn_wc__wq_build_prej_install(svn_skel_t
 
 
 static svn_error_t *
-run_record_fileinfo(svn_wc__db_t *db,
+run_record_fileinfo(work_item_baton_t *wqb,
+                    svn_wc__db_t *db,
                     const svn_skel_t *work_item,
                     const char *wri_abspath,
                     svn_cancel_func_t cancel_func,
@@ -1241,7 +1243,7 @@ run_record_fileinfo(svn_wc__db_t *db,
     }
 
 
-  return svn_error_trace(get_and_record_fileinfo(db, local_abspath,
+  return svn_error_trace(get_and_record_fileinfo(wqb, local_abspath,
                                                  TRUE /* ignore_enoent */,
                                                  scratch_pool));
 }
@@ -1252,12 +1254,13 @@ run_record_fileinfo(svn_wc__db_t *db,
 
 
 static svn_error_t *
-run_set_text_conflict_markers(svn_wc__db_t *db,
-                    const svn_skel_t *work_item,
-                    const char *wri_abspath,
-                    svn_cancel_func_t cancel_func,
-                    void *cancel_baton,
-                    apr_pool_t *scratch_pool)
+run_set_text_conflict_markers(work_item_baton_t *wqb,
+                              svn_wc__db_t *db,
+                              const svn_skel_t *work_item,
+                              const char *wri_abspath,
+                              svn_cancel_func_t cancel_func,
+                              void *cancel_baton,
+                              apr_pool_t *scratch_pool)
 {
   const svn_skel_t *arg = work_item->children->next;
   const char *local_relpath;
@@ -1346,7 +1349,8 @@ run_set_text_conflict_markers(svn_wc__db
 /* OP_TMP_SET_PROPERTY_CONFLICT_MARKER  */
 
 static svn_error_t *
-run_set_property_conflict_marker(svn_wc__db_t *db,
+run_set_property_conflict_marker(work_item_baton_t *wqb,
+                                 svn_wc__db_t *db,
                                  const svn_skel_t *work_item,
                                  const char *wri_abspath,
                                  svn_cancel_func_t cancel_func,
@@ -1432,9 +1436,19 @@ static const struct work_item_dispatch d
   { NULL }
 };
 
+struct work_item_baton_t
+{
+  apr_pool_t *result_pool; /* Pool to allocate result in */
+
+  svn_boolean_t used; /* needs reset */
+
+  apr_hash_t *record_map; /* const char * -> svn_io_dirent2_t map */
+};
+
 
 static svn_error_t *
-dispatch_work_item(svn_wc__db_t *db,
+dispatch_work_item(work_item_baton_t *wqb,
+                   svn_wc__db_t *db,
                    const char *wri_abspath,
                    const svn_skel_t *work_item,
                    svn_cancel_func_t cancel_func,
@@ -1452,7 +1466,7 @@ dispatch_work_item(svn_wc__db_t *db,
 #ifdef SVN_DEBUG_WORK_QUEUE
           SVN_DBG(("dispatch: operation='%s'\n", scan->name));
 #endif
-          SVN_ERR((*scan->func)(db, work_item, wri_abspath,
+          SVN_ERR((*scan->func)(wqb, db, work_item, wri_abspath,
                                 cancel_func, cancel_baton,
                                 scratch_pool));
 
@@ -1497,6 +1511,8 @@ svn_wc__wq_run(svn_wc__db_t *db,
 {
   apr_pool_t *iterpool = svn_pool_create(scratch_pool);
   apr_uint64_t last_id = 0;
+  work_item_baton_t wib = { 0 };
+  wib.result_pool = svn_pool_create(scratch_pool);
 
 #ifdef SVN_DEBUG_WORK_QUEUE
   SVN_DBG(("wq_run: wri='%s'\n", wri_abspath));
@@ -1517,11 +1533,29 @@ svn_wc__wq_run(svn_wc__db_t *db,
 
       svn_pool_clear(iterpool);
 
-      /* Make sure to do this *early* in the loop iteration. There may
-         be a LAST_ID that needs to be marked as completed, *before* we
-         start worrying about anything else.  */
-      SVN_ERR(svn_wc__db_wq_fetch_next(&id, &work_item, db, wri_abspath,
-                                       last_id, iterpool, iterpool));
+      if (! wib.used)
+        {
+          /* Make sure to do this *early* in the loop iteration. There may
+             be a LAST_ID that needs to be marked as completed, *before* we
+             start worrying about anything else.  */
+          SVN_ERR(svn_wc__db_wq_fetch_next(&id, &work_item, db, wri_abspath,
+                                           last_id, iterpool, iterpool));
+        }
+      else
+        {
+          /* Make sure to do this *early* in the loop iteration. There may
+             be a LAST_ID that needs to be marked as completed, *before* we
+             start worrying about anything else.  */
+          SVN_ERR(svn_wc__db_wq_record_and_fetch_next(&id, &work_item,
+                                                      db, wri_abspath,
+                                                      last_id, wib.record_map,
+                                                      iterpool,
+                                                      wib.result_pool));
+
+          svn_pool_clear(wib.result_pool);
+          wib.record_map = NULL;
+          wib.used = FALSE;
+        }
 
       /* Stop work queue processing, if requested. A future 'svn cleanup'
          should be able to continue the processing. Note that we may
@@ -1534,7 +1568,7 @@ svn_wc__wq_run(svn_wc__db_t *db,
       if (work_item == NULL)
         break;
 
-      err = dispatch_work_item(db, wri_abspath, work_item,
+      err = dispatch_work_item(&wib, db, wri_abspath, work_item,
                                cancel_func, cancel_baton, iterpool);
       if (err)
         {
@@ -1604,3 +1638,29 @@ svn_wc__wq_merge(svn_skel_t *work_item1,
   svn_skel__append(work_item1, work_item2->children);
   return work_item1;
 }
+
+
+static svn_error_t *
+get_and_record_fileinfo(work_item_baton_t *wqb,
+                        const char *local_abspath,
+                        svn_boolean_t ignore_enoent,
+                        apr_pool_t *scratch_pool)
+{
+  const svn_io_dirent2_t *dirent;
+
+  SVN_ERR(svn_io_stat_dirent2(&dirent, local_abspath, FALSE, ignore_enoent,
+                              wqb->result_pool, scratch_pool));
+
+  if (dirent->kind != svn_node_file)
+    return SVN_NO_ERROR;
+
+  wqb->used = TRUE;
+
+  if (! wqb->record_map)
+    wqb->record_map = apr_hash_make(wqb->result_pool);
+
+  svn_hash_sets(wqb->record_map, apr_pstrdup(wqb->result_pool, local_abspath),
+                dirent);
+
+  return SVN_NO_ERROR;
+}

Modified: subversion/branches/verify-keep-going/subversion/mod_dav_svn/liveprops.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/mod_dav_svn/liveprops.c?rev=1457684&r1=1457683&r2=1457684&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/mod_dav_svn/liveprops.c (original)
+++ subversion/branches/verify-keep-going/subversion/mod_dav_svn/liveprops.c Mon Mar 18 09:35:24
2013
@@ -436,7 +436,8 @@ insert_prop_internal(const dav_resource 
         svn_filesize_t len = 0;
 
         /* our property, but not defined on collection resources */
-        if (resource->collection || resource->baselined)
+        if (resource->type == DAV_RESOURCE_TYPE_ACTIVITY
+            || resource->collection || resource->baselined)
           return DAV_PROP_INSERT_NOTSUPP;
 
         serr = svn_fs_file_length(&len, resource->info->root.root,
@@ -466,7 +467,9 @@ insert_prop_internal(const dav_resource 
         svn_string_t *pval;
         const char *mime_type = NULL;
 
-        if (resource->baselined && resource->type == DAV_RESOURCE_TYPE_VERSION)
+        if (resource->type == DAV_RESOURCE_TYPE_ACTIVITY
+            || (resource->baselined
+                && resource->type == DAV_RESOURCE_TYPE_VERSION))
           return DAV_PROP_INSERT_NOTSUPP;
 
         if (resource->type == DAV_RESOURCE_TYPE_PRIVATE

Modified: subversion/branches/verify-keep-going/subversion/mod_dav_svn/lock.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/mod_dav_svn/lock.c?rev=1457684&r1=1457683&r2=1457684&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/mod_dav_svn/lock.c (original)
+++ subversion/branches/verify-keep-going/subversion/mod_dav_svn/lock.c Mon Mar 18 09:35:24
2013
@@ -640,6 +640,19 @@ append_locks(dav_lockdb *lockdb,
   svn_lock_t *slock;
   svn_error_t *serr;
   dav_error *derr;
+  dav_svn_repos *repos = resource->info->repos;
+      
+  /* We don't allow anonymous locks */
+  if (! repos->username)
+    return dav_svn__new_error(resource->pool, HTTP_UNAUTHORIZED,
+                              DAV_ERR_LOCK_SAVE_LOCK,
+                              "Anonymous lock creation is not allowed.");
+
+  /* Not a path in the repository so can't lock it. */
+  if (! resource->info->repos_path)
+    return dav_svn__new_error(resource->pool, HTTP_BAD_REQUEST,
+                              DAV_ERR_LOCK_SAVE_LOCK,
+                              "Attempted to lock path not in repository.");
 
   /* If the resource's fs path is unreadable, we don't allow a lock to
      be created on it. */
@@ -663,7 +676,6 @@ append_locks(dav_lockdb *lockdb,
       svn_fs_txn_t *txn;
       svn_fs_root_t *txn_root;
       const char *conflict_msg;
-      dav_svn_repos *repos = resource->info->repos;
       apr_hash_t *revprop_table = apr_hash_make(resource->pool);
       apr_hash_set(revprop_table, SVN_PROP_REVISION_AUTHOR,
                    APR_HASH_KEY_STRING, svn_string_create(repos->username,
@@ -741,14 +753,14 @@ append_locks(dav_lockdb *lockdb,
 
   /* Convert the dav_lock into an svn_lock_t. */
   derr = dav_lock_to_svn_lock(&slock, lock, resource->info->repos_path,
-                              info, resource->info->repos->is_svn_client,
+                              info, repos->is_svn_client,
                               resource->pool);
   if (derr)
     return derr;
 
   /* Now use the svn_lock_t to actually perform the lock. */
   serr = svn_repos_fs_lock(&slock,
-                           resource->info->repos->repos,
+                           repos->repos,
                            slock->path,
                            slock->token,
                            slock->comment,

Modified: subversion/branches/verify-keep-going/subversion/mod_dav_svn/version.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/mod_dav_svn/version.c?rev=1457684&r1=1457683&r2=1457684&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/mod_dav_svn/version.c (original)
+++ subversion/branches/verify-keep-going/subversion/mod_dav_svn/version.c Mon Mar 18 09:35:24
2013
@@ -150,6 +150,7 @@ get_vsn_options(apr_pool_t *p, apr_text_
   apr_text_append(p, phdr, SVN_DAV_NS_DAV_SVN_PARTIAL_REPLAY);
   apr_text_append(p, phdr, SVN_DAV_NS_DAV_SVN_INHERITED_PROPS);
   apr_text_append(p, phdr, SVN_DAV_NS_DAV_SVN_INLINE_PROPS);
+  apr_text_append(p, phdr, SVN_DAV_NS_DAV_SVN_GET_FILE_REVS_REVERSE);
   /* Mergeinfo is a special case: here we merely say that the server
    * knows how to handle mergeinfo -- whether the repository does too
    * is a separate matter.



Mime
View raw message