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/05/24 13:15:24 UTC
svn commit: r947601 - in /subversion/trunk/subversion/libsvn_wc: wc_db.c
wc_db.h
Author: julianfoad
Date: Mon May 24 11:15:24 2010
New Revision: 947601
URL: http://svn.apache.org/viewvc?rev=947601&view=rev
Log:
* subversion/libsvn_wc/wc_db.h,
subversion/libsvn_wc/wc_db.c
(svn_wc__db_pristine_get_path): New function.
Modified:
subversion/trunk/subversion/libsvn_wc/wc_db.c
subversion/trunk/subversion/libsvn_wc/wc_db.h
Modified: subversion/trunk/subversion/libsvn_wc/wc_db.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.c?rev=947601&r1=947600&r2=947601&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.c Mon May 24 11:15:24 2010
@@ -1783,6 +1783,44 @@ svn_wc__db_base_get_dav_cache(apr_hash_t
svn_error_t *
+svn_wc__db_pristine_get_path(const char **pristine_abspath,
+ svn_wc__db_t *db,
+ const char *wri_abspath,
+ const svn_checksum_t *sha1_checksum,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
+{
+ svn_wc__db_pdh_t *pdh;
+ const char *local_relpath;
+
+ SVN_ERR_ASSERT(pristine_abspath != NULL);
+ SVN_ERR_ASSERT(svn_dirent_is_absolute(wri_abspath));
+ SVN_ERR_ASSERT(sha1_checksum != NULL);
+ /* ### Transitional: accept MD-5 and look up the SHA-1. Return an error
+ * if the pristine text is not in the store. */
+ if (sha1_checksum->kind != svn_checksum_sha1)
+ SVN_ERR(svn_wc__db_pristine_get_sha1(&sha1_checksum, db, wri_abspath,
+ sha1_checksum,
+ scratch_pool, scratch_pool));
+ SVN_ERR_ASSERT(sha1_checksum->kind == svn_checksum_sha1);
+
+ SVN_ERR(svn_wc__db_pdh_parse_local_abspath(&pdh, &local_relpath,
+ db, wri_abspath,
+ svn_sqlite__mode_readonly,
+ scratch_pool, scratch_pool));
+ VERIFY_USABLE_PDH(pdh);
+
+ /* ### should we look in the PRISTINE table for anything? */
+
+ SVN_ERR(get_pristine_fname(pristine_abspath, pdh, sha1_checksum,
+ FALSE /* create_subdir */,
+ scratch_pool, scratch_pool));
+
+ return SVN_NO_ERROR;
+}
+
+
+svn_error_t *
svn_wc__db_pristine_read(svn_stream_t **contents,
svn_wc__db_t *db,
const char *wri_abspath,
Modified: subversion/trunk/subversion/libsvn_wc/wc_db.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.h?rev=947601&r1=947600&r2=947601&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db.h (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.h Mon May 24 11:15:24 2010
@@ -855,6 +855,22 @@ typedef enum {
} svn_wc__db_checkmode_t;
+/* Set *PRISTINE_ABSPATH to the path to the pristine text file
+ identified by SHA1_CHECKSUM. Error if it does not exist.
+
+ ### This is temporary - callers should not be looking at the file
+ directly.
+
+ Allocate the stream in RESULT_POOL. */
+svn_error_t *
+svn_wc__db_pristine_get_path(const char **pristine_abspath,
+ svn_wc__db_t *db,
+ const char *wri_abspath,
+ const svn_checksum_t *checksum,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool);
+
+
/* Set *CONTENTS to a readable stream that will yield the pristine text
identified by CHECKSUM (### which should/must be its SHA-1 checksum?).
Re: svn commit: r947601 - in /subversion/trunk/subversion/libsvn_wc:
wc_db.c wc_db.h
Posted by "Hyrum K. Wright" <hy...@mail.utexas.edu>.
On Mon, May 24, 2010 at 6:15 AM, <ju...@apache.org> wrote:
> Author: julianfoad
> Date: Mon May 24 11:15:24 2010
> New Revision: 947601
>
> URL: http://svn.apache.org/viewvc?rev=947601&view=rev
> Log:
> * subversion/libsvn_wc/wc_db.h,
> subversion/libsvn_wc/wc_db.c
> (svn_wc__db_pristine_get_path): New function.
>
> Modified:
> subversion/trunk/subversion/libsvn_wc/wc_db.c
> subversion/trunk/subversion/libsvn_wc/wc_db.h
>
> ...
> Modified: subversion/trunk/subversion/libsvn_wc/wc_db.h
> URL:
> http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.h?rev=947601&r1=947600&r2=947601&view=diff
>
> ==============================================================================
> --- subversion/trunk/subversion/libsvn_wc/wc_db.h (original)
> +++ subversion/trunk/subversion/libsvn_wc/wc_db.h Mon May 24 11:15:24 2010
> @@ -855,6 +855,22 @@ typedef enum {
> } svn_wc__db_checkmode_t;
>
>
> +/* Set *PRISTINE_ABSPATH to the path to the pristine text file
> + identified by SHA1_CHECKSUM. Error if it does not exist.
> +
> + ### This is temporary - callers should not be looking at the file
> + directly.
>
svn_wc__db_temp_pristine_get_path() ?
> +
> + Allocate the stream in RESULT_POOL. */
> +svn_error_t *
> +svn_wc__db_pristine_get_path(const char **pristine_abspath,
> + svn_wc__db_t *db,
> + const char *wri_abspath,
> + const svn_checksum_t *checksum,
> + apr_pool_t *result_pool,
> + apr_pool_t *scratch_pool);
> +
> +
> /* Set *CONTENTS to a readable stream that will yield the pristine text
> identified by CHECKSUM (### which should/must be its SHA-1 checksum?).
>
>
>
>