You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ju...@apache.org on 2010/03/29 16:10:41 UTC

svn commit: r928786 - in /subversion/trunk/subversion/libsvn_client: client.h commit.c commit_util.c

Author: julianfoad
Date: Mon Mar 29 14:10:41 2010
New Revision: 928786

URL: http://svn.apache.org/viewvc?rev=928786&view=rev
Log:
Change svn_client__do_commit() to return the list of new text base files in
a form that relates them to the corresponding versioned files, so the caller
will later be able to use these paths in finishing the commit.

* subversion/libsvn_client/client.h,
  subversion/libsvn_client/commit_util.c
  (svn_client__do_commit): Rename the parameter "tempfiles" to
    "new_text_base_abspaths". Change the hash to be a mapping from the
    versioned file path to the new text base path, instead of from the new
    text base path to an unspecified value.

* subversion/libsvn_client/commit.c
  (remove_tmpfiles): Use the values, instead of the keys, in the hash. Add a
    doc string.

Modified:
    subversion/trunk/subversion/libsvn_client/client.h
    subversion/trunk/subversion/libsvn_client/commit.c
    subversion/trunk/subversion/libsvn_client/commit_util.c

Modified: subversion/trunk/subversion/libsvn_client/client.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/client.h?rev=928786&r1=928785&r2=928786&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/client.h (original)
+++ subversion/trunk/subversion/libsvn_client/client.h Mon Mar 29 14:10:41 2010
@@ -918,11 +918,11 @@ svn_client__condense_commit_items(const 
    NOTIFY_PATH_PREFIX will be passed to CTX->notify_func2() as the
    common absolute path prefix of the committed paths.  It can be NULL.
 
-   If TEMPFILES is not NULL, create in the temporary-text-base directory a
-   copy of the working version of each file transmitted, but with keywords
-   and eol translated to repository-normal form, and set *TEMPFILES to a
-   hash whose keys are the (const char *) abspaths of these files and whose
-   values are unspecified.
+   If NEW_TEXT_BASE_ABSPATHS is not NULL, create in the temporary-text-base
+   directory a copy of the working version of each file transmitted, but
+   with keywords and eol translated to repository-normal form, and set
+   *NEW_TEXT_BASE_ABSPATHS to a hash that maps (const char *) paths (from
+   the items' paths) to the (const char *) abspaths of these files.
 
    MD5 checksums, if available,  for the new text bases of committed
    files are stored in *CHECKSUMS, which maps const char* paths (from the
@@ -934,7 +934,7 @@ svn_client__do_commit(const char *base_u
                       const svn_delta_editor_t *editor,
                       void *edit_baton,
                       const char *notify_path_prefix,
-                      apr_hash_t **tempfiles,
+                      apr_hash_t **new_text_base_abspaths,
                       apr_hash_t **checksums,
                       svn_client_ctx_t *ctx,
                       apr_pool_t *pool);

Modified: subversion/trunk/subversion/libsvn_client/commit.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/commit.c?rev=928786&r1=928785&r2=928786&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/commit.c (original)
+++ subversion/trunk/subversion/libsvn_client/commit.c Mon Mar 29 14:10:41 2010
@@ -801,6 +801,9 @@ svn_client_import3(svn_commit_info_t **c
 }
 
 
+/* Remove (if it exists) each file whose path is given by a value in the
+ * hash TEMPFILES, which is a mapping from (const char *) path to (const
+ * char *) tempfile abspath.  Ignore the keys of TEMPFILES. */
 static svn_error_t *
 remove_tmpfiles(apr_hash_t *tempfiles,
                 apr_pool_t *pool)
@@ -818,7 +821,7 @@ remove_tmpfiles(apr_hash_t *tempfiles,
   /* Clean up any tempfiles. */
   for (hi = apr_hash_first(pool, tempfiles); hi; hi = apr_hash_next(hi))
     {
-      const char *path = svn__apr_hash_index_key(hi);
+      const char *path = svn__apr_hash_index_val(hi);
 
       svn_pool_clear(subpool);
 

Modified: subversion/trunk/subversion/libsvn_client/commit_util.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/commit_util.c?rev=928786&r1=928785&r2=928786&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/commit_util.c (original)
+++ subversion/trunk/subversion/libsvn_client/commit_util.c Mon Mar 29 14:10:41 2010
@@ -1583,7 +1583,7 @@ svn_client__do_commit(const char *base_u
                       const svn_delta_editor_t *editor,
                       void *edit_baton,
                       const char *notify_path_prefix,
-                      apr_hash_t **tempfiles,
+                      apr_hash_t **new_text_base_abspaths,
                       apr_hash_t **checksums,
                       svn_client_ctx_t *ctx,
                       apr_pool_t *pool)
@@ -1607,8 +1607,8 @@ svn_client__do_commit(const char *base_u
 
   /* If the caller wants us to track temporary file creation, create a
      hash to store those paths in. */
-  if (tempfiles)
-    *tempfiles = apr_hash_make(pool);
+  if (new_text_base_abspaths)
+    *new_text_base_abspaths = apr_hash_make(pool);
 
   /* Ditto for the md5 checksums. */
   if (checksums)
@@ -1673,15 +1673,14 @@ svn_client__do_commit(const char *base_u
       if (item->state_flags & SVN_CLIENT_COMMIT_ITEM_ADD)
         fulltext = TRUE;
 
-      SVN_ERR(svn_wc_transmit_text_deltas3(tempfiles ? &tempfile : NULL,
+      SVN_ERR(svn_wc_transmit_text_deltas3(new_text_base_abspaths ? &tempfile
+                                                                  : NULL,
                                            digest, ctx->wc_ctx, item_abspath,
                                            fulltext, editor, file_baton,
                                            iterpool, iterpool));
-      if (tempfiles && tempfile)
-        {
-          tempfile = apr_pstrdup(pool, tempfile);
-          apr_hash_set(*tempfiles, tempfile, APR_HASH_KEY_STRING, (void *)1);
-        }
+      if (new_text_base_abspaths && tempfile)
+        apr_hash_set(*new_text_base_abspaths, item->path, APR_HASH_KEY_STRING,
+                     apr_pstrdup(pool, tempfile));
       if (checksums)
         apr_hash_set(*checksums, item->path, APR_HASH_KEY_STRING,
                      svn_checksum__from_digest(digest, svn_checksum_md5,