You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2011/07/25 17:34:38 UTC

svn commit: r1150751 [3/5] - in /subversion/branches/gpg-agent-password-store: ./ build/ac-macros/ build/generator/swig/ notes/ subversion/bindings/swig/perl/native/t/ subversion/include/ subversion/include/private/ subversion/libsvn_client/ subversion...

Modified: subversion/branches/gpg-agent-password-store/subversion/libsvn_wc/adm_crawler.c
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/libsvn_wc/adm_crawler.c?rev=1150751&r1=1150750&r2=1150751&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/libsvn_wc/adm_crawler.c (original)
+++ subversion/branches/gpg-agent-password-store/subversion/libsvn_wc/adm_crawler.c Mon Jul 25 15:34:28 2011
@@ -1112,21 +1112,12 @@ svn_wc__internal_transmit_text_deltas(co
                         NULL, NULL,
                         scratch_pool, scratch_pool);
 
-  /* Close the two streams to force writing the digest,
-     if we already have an error, ignore this one. */
-  if (err)
-    {
-      svn_error_clear(svn_stream_close(base_stream));
-      svn_error_clear(svn_stream_close(local_stream));
-    }
-  else
-    {
-      SVN_ERR(svn_stream_close(base_stream));
-      SVN_ERR(svn_stream_close(local_stream));
-    }
+  /* Close the two streams to force writing the digest */
+  err = svn_error_compose_create(err, svn_stream_close(base_stream));
+  err = svn_error_compose_create(err, svn_stream_close(local_stream));
 
-  /* If we have an error, it may be caused by a corrupt text base.
-     Check the checksum and discard `err' if they don't match. */
+  /* If we have an error, it may be caused by a corrupt text base,
+     so check the checksum. */
   if (expected_md5_checksum && verify_checksum
       && !svn_checksum_match(expected_md5_checksum, verify_checksum))
     {
@@ -1142,19 +1133,20 @@ svn_wc__internal_transmit_text_deltas(co
          investigate.  Other commands could be affected,
          too, such as `svn diff'.  */
 
-      /* Deliberately ignore errors; the error about the
-         checksum mismatch is more important to return. */
-      svn_error_clear(err);
       if (tempfile)
-        svn_error_clear(svn_io_remove_file2(*tempfile, TRUE, scratch_pool));
+        err = svn_error_compose_create(
+                      err,
+                      svn_io_remove_file2(*tempfile, TRUE, scratch_pool));
 
-      return svn_error_create(SVN_ERR_WC_CORRUPT_TEXT_BASE,
-            svn_checksum_mismatch_err(expected_md5_checksum, verify_checksum,
+      err = svn_error_compose_create(
+              svn_checksum_mismatch_err(expected_md5_checksum, verify_checksum,
                             scratch_pool,
                             _("Checksum mismatch for text base of '%s'"),
                             svn_dirent_local_style(local_abspath,
                                                    scratch_pool)),
-            NULL);
+              err);
+
+      return svn_error_create(SVN_ERR_WC_CORRUPT_TEXT_BASE, err, NULL);
     }
 
   /* Now, handle that delta transmission error if any, so we can stop

Modified: subversion/branches/gpg-agent-password-store/subversion/libsvn_wc/conflicts.c
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/libsvn_wc/conflicts.c?rev=1150751&r1=1150750&r2=1150751&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/libsvn_wc/conflicts.c (original)
+++ subversion/branches/gpg-agent-password-store/subversion/libsvn_wc/conflicts.c Mon Jul 25 15:34:28 2011
@@ -215,7 +215,6 @@ resolve_conflict_on_node(svn_wc__db_t *d
 
   if (resolve_text)
     {
-      svn_stream_t *tmp_stream = NULL;
       const char *auto_resolve_src;
 
       /* Handle automatic conflict resolution before the temporary files are
@@ -240,6 +239,7 @@ resolve_conflict_on_node(svn_wc__db_t *d
             if (conflict_old && conflict_working && conflict_new)
               {
                 const char *temp_dir;
+                svn_stream_t *tmp_stream = NULL;
                 svn_diff_t *diff;
                 svn_diff_conflict_display_style_t style =
                   conflict_choice == svn_wc_conflict_choose_theirs_conflict
@@ -252,7 +252,7 @@ resolve_conflict_on_node(svn_wc__db_t *d
                 SVN_ERR(svn_stream_open_unique(&tmp_stream,
                                                &auto_resolve_src,
                                                temp_dir,
-                                               svn_io_file_del_on_close,
+                                               svn_io_file_del_on_pool_cleanup,
                                                pool, pool));
 
                 SVN_ERR(svn_diff_file_diff3_2(&diff,
@@ -269,6 +269,7 @@ resolve_conflict_on_node(svn_wc__db_t *d
                                                     NULL, NULL, NULL, NULL,
                                                     style,
                                                     pool));
+                SVN_ERR(svn_stream_close(tmp_stream));
               }
             else
               auto_resolve_src = NULL;
@@ -283,9 +284,6 @@ resolve_conflict_on_node(svn_wc__db_t *d
         SVN_ERR(svn_io_copy_file(
           svn_dirent_join(conflict_dir_abspath, auto_resolve_src, pool),
           local_abspath, TRUE, pool));
-
-      if (tmp_stream)
-        SVN_ERR(svn_stream_close(tmp_stream));
     }
 
   /* Records whether we found any of the conflict files.  */

Modified: subversion/branches/gpg-agent-password-store/subversion/libsvn_wc/copy.c
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/libsvn_wc/copy.c?rev=1150751&r1=1150750&r2=1150751&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/libsvn_wc/copy.c (original)
+++ subversion/branches/gpg-agent-password-store/subversion/libsvn_wc/copy.c Mon Jul 25 15:34:28 2011
@@ -312,14 +312,9 @@ copy_versioned_file(svn_wc__db_t *db,
 
   /* Copy the (single) node's metadata, and move the new filesystem node
      into place. */
-  if (is_move)
-    SVN_ERR(svn_wc__db_op_move(db, src_abspath, dst_abspath,
-                               dst_op_root_abspath, work_items,
-                               scratch_pool));
-  else
-    SVN_ERR(svn_wc__db_op_copy(db, src_abspath, dst_abspath,
-                               dst_op_root_abspath, work_items,
-                               scratch_pool));
+  SVN_ERR(svn_wc__db_op_copy(db, src_abspath, dst_abspath,
+                             dst_op_root_abspath, is_move, work_items,
+                             scratch_pool));
   SVN_ERR(svn_wc__wq_run(db, dir_abspath,
                          cancel_func, cancel_baton, scratch_pool));
 
@@ -383,14 +378,9 @@ copy_versioned_dir(svn_wc__db_t *db,
 
   /* Copy the (single) node's metadata, and move the new filesystem node
      into place. */
-  if (is_move)
-    SVN_ERR(svn_wc__db_op_move(db, src_abspath, dst_abspath,
-                               dst_op_root_abspath, work_items,
-                               scratch_pool));
-  else
-    SVN_ERR(svn_wc__db_op_copy(db, src_abspath, dst_abspath,
-                               dst_op_root_abspath, work_items,
-                               scratch_pool));
+  SVN_ERR(svn_wc__db_op_copy(db, src_abspath, dst_abspath,
+                             dst_op_root_abspath, is_move, work_items,
+                             scratch_pool));
   SVN_ERR(svn_wc__wq_run(db, dir_abspath,
                          cancel_func, cancel_baton, scratch_pool));
 
@@ -499,14 +489,9 @@ copy_versioned_dir(svn_wc__db_t *db,
         {
           /* This will be copied as some kind of deletion. Don't touch
              any actual files */
-          if (is_move)
-            SVN_ERR(svn_wc__db_op_move(db, child_src_abspath,
-                                       child_dst_abspath, dst_op_root_abspath,
-                                       NULL, scratch_pool));
-          else
-            SVN_ERR(svn_wc__db_op_copy(db, child_src_abspath,
-                                       child_dst_abspath, dst_op_root_abspath,
-                                       NULL, iterpool));
+          SVN_ERR(svn_wc__db_op_copy(db, child_src_abspath,
+                                     child_dst_abspath, dst_op_root_abspath,
+                                     is_move, NULL, iterpool));
 
           /* Don't recurse on children while all we do is creating not-present
              children */

Modified: subversion/branches/gpg-agent-password-store/subversion/libsvn_wc/wc_db.c
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/libsvn_wc/wc_db.c?rev=1150751&r1=1150750&r2=1150751&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/branches/gpg-agent-password-store/subversion/libsvn_wc/wc_db.c Mon Jul 25 15:34:28 2011
@@ -3422,8 +3422,8 @@ op_depth_for_copy(apr_int64_t *op_depth,
                   apr_pool_t *scratch_pool);
 
 
-/* Like svn_wc__db_op_copy()/svn_wc__db_op_move(), but with
-   WCROOT+LOCAL_RELPATH instead of DB+LOCAL_ABSPATH.  */
+/* Like svn_wc__db_op_copy(), but with WCROOT+LOCAL_RELPATH
+ * instead of DB+LOCAL_ABSPATH.  */
 static svn_error_t *
 db_op_copy(svn_wc__db_wcroot_t *src_wcroot,
            const char *src_relpath,
@@ -3655,6 +3655,7 @@ svn_wc__db_op_copy(svn_wc__db_t *db,
                    const char *src_abspath,
                    const char *dst_abspath,
                    const char *dst_op_root_abspath,
+                   svn_boolean_t is_move,
                    const svn_skel_t *work_items,
                    apr_pool_t *scratch_pool)
 {
@@ -3676,7 +3677,7 @@ svn_wc__db_op_copy(svn_wc__db_t *db,
   VERIFY_USABLE_WCROOT(ocb.dst_wcroot);
 
   ocb.work_items = work_items;
-  ocb.is_move = FALSE;
+  ocb.is_move = is_move;
 
   /* Call with the sdb in src_wcroot. It might call itself again to
      also obtain a lock in dst_wcroot */
@@ -4715,43 +4716,6 @@ svn_wc__db_temp_working_set_props(svn_wc
 
 
 svn_error_t *
-svn_wc__db_op_move(svn_wc__db_t *db,
-                   const char *src_abspath,
-                   const char *dst_abspath,
-                   const char *dst_op_root_abspath,
-                   const svn_skel_t *work_items,
-                   apr_pool_t *scratch_pool)
-{
-  struct op_copy_baton ocb = {0};
-
-  SVN_ERR_ASSERT(svn_dirent_is_absolute(src_abspath));
-  SVN_ERR_ASSERT(svn_dirent_is_absolute(dst_abspath));
-
-  SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&ocb.src_wcroot,
-                                                &ocb.src_relpath, db,
-                                                src_abspath,
-                                                scratch_pool, scratch_pool));
-  VERIFY_USABLE_WCROOT(ocb.src_wcroot);
-
-  SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&ocb.dst_wcroot,
-                                                &ocb.dst_relpath,
-                                                db, dst_abspath,
-                                                scratch_pool, scratch_pool));
-  VERIFY_USABLE_WCROOT(ocb.dst_wcroot);
-
-  ocb.work_items = work_items;
-  ocb.is_move = TRUE;
-
-  /* Call with the sdb in src_wcroot. It might call itself again to
-     also obtain a lock in dst_wcroot */
-  SVN_ERR(svn_sqlite__with_lock(ocb.src_wcroot->sdb, op_copy_txn, &ocb,
-                                scratch_pool));
-
-  return SVN_NO_ERROR;
-}
-
-
-svn_error_t *
 svn_wc__db_op_modified(svn_wc__db_t *db,
                        const char *local_abspath,
                        apr_pool_t *scratch_pool)

Modified: subversion/branches/gpg-agent-password-store/subversion/libsvn_wc/wc_db.h
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/libsvn_wc/wc_db.h?rev=1150751&r1=1150750&r2=1150751&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/libsvn_wc/wc_db.h (original)
+++ subversion/branches/gpg-agent-password-store/subversion/libsvn_wc/wc_db.h Mon Jul 25 15:34:28 2011
@@ -1209,12 +1209,17 @@ svn_wc__db_externals_gather_definitions(
  * This copy is NOT recursive. It simply establishes this one node, plus
  * incomplete nodes for the children.
  *
+ * If IS_MOVE is TRUE, mark this copy operation as the copy-half of
+ * a move. The delete-half of the move needs to be created separately
+ * with svn_wc__db_op_delete().
+ *
  * Add WORK_ITEMS to the work queue. */
 svn_error_t *
 svn_wc__db_op_copy(svn_wc__db_t *db,
                    const char *src_abspath,
                    const char *dst_abspath,
                    const char *dst_op_root_abspath,
+                   svn_boolean_t is_move,
                    const svn_skel_t *work_items,
                    apr_pool_t *scratch_pool);
 
@@ -1227,8 +1232,7 @@ svn_wc__db_op_copy(svn_wc__db_t *db,
  * properly deleted.
  *
  * Usually this operation is directly followed by a call to svn_wc__db_op_copy
- * or svn_wc__db_op_move which performs the real copy from src_abspath to
- * dst_abspath.
+ * which performs the real copy from src_abspath to dst_abspath.
  */
 svn_error_t *
 svn_wc__db_op_copy_shadowed_layer(svn_wc__db_t *db,
@@ -1428,23 +1432,6 @@ svn_wc__db_op_delete(svn_wc__db_t *db,
                      apr_pool_t *scratch_pool);
 
 
-/* Move the node at SRC_ABSPATH (in NODES and ACTUAL_NODE tables) to
- * DST_ABSPATH, both in DB but not necessarily in the same WC.  The parent
- * of DST_ABSPATH must be a versioned directory.
- *
- * This move is NOT recursive. It simply establishes this one node, plus
- * incomplete nodes for the children.
- *
- * Add WORK_ITEMS to the work queue. */
-svn_error_t *
-svn_wc__db_op_move(svn_wc__db_t *db,
-                   const char *src_abspath,
-                   const char *dst_abspath,
-                   const char *dst_op_root_abspath,
-                   const svn_skel_t *work_items,
-                   apr_pool_t *scratch_pool);
-
-
 /* ### mark PATH as (possibly) modified. "svn edit" ... right API here? */
 svn_error_t *
 svn_wc__db_op_modified(svn_wc__db_t *db,

Modified: subversion/branches/gpg-agent-password-store/subversion/mod_authz_svn/mod_authz_svn.c
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/mod_authz_svn/mod_authz_svn.c?rev=1150751&r1=1150750&r2=1150751&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/mod_authz_svn/mod_authz_svn.c (original)
+++ subversion/branches/gpg-agent-password-store/subversion/mod_authz_svn/mod_authz_svn.c Mon Jul 25 15:34:28 2011
@@ -245,7 +245,7 @@ static char *
 get_username_to_authorize(request_rec *r, authz_svn_config_rec *conf)
 {
   char *username_to_authorize = r->user;
-  if (conf->force_username_case)
+  if (username_to_authorize && conf->force_username_case)
     {
       username_to_authorize = apr_pstrdup(r->pool, r->user);
       convert_case(username_to_authorize,

Modified: subversion/branches/gpg-agent-password-store/subversion/mod_dav_svn/repos.c
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/mod_dav_svn/repos.c?rev=1150751&r1=1150750&r2=1150751&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/mod_dav_svn/repos.c (original)
+++ subversion/branches/gpg-agent-password-store/subversion/mod_dav_svn/repos.c Mon Jul 25 15:34:28 2011
@@ -1063,7 +1063,7 @@ prep_private(dav_resource_combined *comb
             {
               svn_error_clear(serr);
               comb->res.exists = FALSE;
-              return dav_svn__new_error(pool, HTTP_INTERNAL_SERVER_ERROR, 0,
+              return dav_svn__new_error(pool, HTTP_NOT_FOUND, 0,
                                         "Named transaction doesn't exist.");
             }
           return dav_svn__convert_err(serr, HTTP_INTERNAL_SERVER_ERROR,

Modified: subversion/branches/gpg-agent-password-store/subversion/mod_dav_svn/util.c
URL: http://svn.apache.org/viewvc/subversion/branches/gpg-agent-password-store/subversion/mod_dav_svn/util.c?rev=1150751&r1=1150750&r2=1150751&view=diff
==============================================================================
--- subversion/branches/gpg-agent-password-store/subversion/mod_dav_svn/util.c (original)
+++ subversion/branches/gpg-agent-password-store/subversion/mod_dav_svn/util.c Mon Jul 25 15:34:28 2011
@@ -37,6 +37,7 @@
 
 #include "dav_svn.h"
 #include "private/svn_fspath.h"
+#include "private/svn_string_private.h"
 
 dav_error *
 dav_svn__new_error(apr_pool_t *pool,
@@ -678,7 +679,7 @@ request_body_to_string(svn_string_t **re
   content_length_str = apr_table_get(r->headers_in, "Content-Length");
   if (content_length_str)
     {
-      if (apr_strtoff(&content_length, content_length_str, &endp, 10)
+      if (svn__strtoff(&content_length, content_length_str, &endp, 10)
           || endp == content_length_str || *endp || content_length < 0)
         {
           ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, "Invalid Content-Length");