You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by hw...@apache.org on 2012/05/02 22:10:23 UTC

svn commit: r1333183 - in /subversion/branches/ev2-export/subversion: include/private/svn_wc_private.h libsvn_wc/node.c

Author: hwright
Date: Wed May  2 20:10:23 2012
New Revision: 1333183

URL: http://svn.apache.org/viewvc?rev=1333183&view=rev
Log:
On the ev2-export branch:
Expose a couple more pristine APIs needed by the commit process.

My hope is that this exposure is only temporary as we rewrite the Ev2 commit
process to be more sane.  During the transition, however, these are needed.

* subversion/include/private/svn_wc_private.h
  (svn_wc__node_pristine_read, svn_wc__node_pristine_get_tempdir): New.

* subversion/libsvn_wc/node.c
  (svn_wc__node_pristine_read, svn_wc__node_pristine_get_tempdir): New.

Modified:
    subversion/branches/ev2-export/subversion/include/private/svn_wc_private.h
    subversion/branches/ev2-export/subversion/libsvn_wc/node.c

Modified: subversion/branches/ev2-export/subversion/include/private/svn_wc_private.h
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/include/private/svn_wc_private.h?rev=1333183&r1=1333182&r2=1333183&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/include/private/svn_wc_private.h (original)
+++ subversion/branches/ev2-export/subversion/include/private/svn_wc_private.h Wed May  2 20:10:23 2012
@@ -1087,6 +1087,35 @@ svn_wc__node_pristine_install(svn_wc_con
                               const svn_checksum_t *md5_checksum,
                               apr_pool_t *scratch_pool);
 
+/* If requested set *CONTENTS to a readable stream that will yield the pristine
+   text identified by SHA1_CHECKSUM (must be a SHA-1 checksum) within the WC
+   identified by WRI_ABSPATH in DB.
+
+   Even if the pristine text is removed from the store while it is being
+   read, the stream will remain valid and readable until it is closed.
+
+   Allocate the stream in RESULT_POOL. */
+svn_error_t *
+svn_wc__node_pristine_read(svn_stream_t **contents,
+                           svn_wc_context_t *wc_ctx,
+                           const char *wri_abspath,
+                           const svn_checksum_t *sha1_checksum,
+                           apr_pool_t *result_pool,
+                           apr_pool_t *scratch_pool);
+
+/* Set *TEMP_DIR_ABSPATH to a directory in which the caller should create
+   a uniquely named file for later installation as a pristine text file.
+
+   The directory is guaranteed to be one that svn_wc__node_pristine_install()
+   can use: specifically, one from which it can atomically move the file.
+
+   Allocate *TEMP_DIR_ABSPATH in RESULT_POOL. */
+svn_error_t *
+svn_wc__node_pristine_get_tempdir(const char **temp_dir_abspath,
+                                  svn_wc_context_t *wc_ctx,
+                                  const char *wri_abspath,
+                                  apr_pool_t *result_pool,
+                                  apr_pool_t *scratch_pool);
 
 /* Gets an array of const char *repos_relpaths of descendants of LOCAL_ABSPATH,
  * which must be the op root of an addition, copy or move. The descendants

Modified: subversion/branches/ev2-export/subversion/libsvn_wc/node.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_wc/node.c?rev=1333183&r1=1333182&r2=1333183&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_wc/node.c (original)
+++ subversion/branches/ev2-export/subversion/libsvn_wc/node.c Wed May  2 20:10:23 2012
@@ -1648,6 +1648,33 @@ svn_wc__node_pristine_install(svn_wc_con
 }
 
 svn_error_t *
+svn_wc__node_pristine_read(svn_stream_t **contents,
+                           svn_wc_context_t *wc_ctx,
+                           const char *wri_abspath,
+                           const svn_checksum_t *sha1_checksum,
+                           apr_pool_t *result_pool,
+                           apr_pool_t *scratch_pool)
+{
+  return svn_error_trace(svn_wc__db_pristine_read(contents, NULL, wc_ctx->db,
+                                                  wri_abspath, sha1_checksum,
+                                                  result_pool, scratch_pool));
+}
+
+svn_error_t *
+svn_wc__node_pristine_get_tempdir(const char **temp_dir_abspath,
+                                  svn_wc_context_t *wc_ctx,
+                                  const char *wri_abspath,
+                                  apr_pool_t *result_pool,
+                                  apr_pool_t *scratch_pool)
+{
+  return svn_error_trace(svn_wc__node_pristine_get_tempdir(temp_dir_abspath,
+                                                           wc_ctx->db,
+                                                           wri_abspath,
+                                                           result_pool,
+                                                           scratch_pool));
+}
+
+svn_error_t *
 svn_wc__get_not_present_descendants(const apr_array_header_t **descendants,
                                     svn_wc_context_t *wc_ctx,
                                     const char *local_abspath,



Re: svn commit: r1333183 - in /subversion/branches/ev2-export/subversion: include/private/svn_wc_private.h libsvn_wc/node.c

Posted by Greg Stein <gs...@gmail.com>.
On Wed, May 2, 2012 at 4:10 PM,  <hw...@apache.org> wrote:
>...
> +++ subversion/branches/ev2-export/subversion/include/private/svn_wc_private.h Wed May  2 20:10:23 2012
> @@ -1087,6 +1087,35 @@ svn_wc__node_pristine_install(svn_wc_con
>                               const svn_checksum_t *md5_checksum,
>                               apr_pool_t *scratch_pool);
>
> +/* If requested set *CONTENTS to a readable stream that will yield the pristine
> +   text identified by SHA1_CHECKSUM (must be a SHA-1 checksum) within the WC
> +   identified by WRI_ABSPATH in DB.

Based on SHA1? Couldn't you use the normal abspath and
svn_wc_get_pristine_contents2() ?

>...

Cheers,
-g