You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by gs...@apache.org on 2010/03/23 07:30:59 UTC

svn commit: r926474 - /subversion/trunk/subversion/libsvn_wc/adm_ops.c

Author: gstein
Date: Tue Mar 23 06:30:59 2010
New Revision: 926474

URL: http://svn.apache.org/viewvc?rev=926474&view=rev
Log:
Some minor code tweaks around text base path computations.

* subversion/libsvn_wc/adm_ops.c:
  (svn_wc_get_pristine_copy_path): construct a DB rather than a WC_CTX.
    close it at the end of the function.
  (svn_wc__get_pristine_contents): add an svn_error_return

Modified:
    subversion/trunk/subversion/libsvn_wc/adm_ops.c

Modified: subversion/trunk/subversion/libsvn_wc/adm_ops.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/adm_ops.c?rev=926474&r1=926473&r2=926474&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/adm_ops.c (original)
+++ subversion/trunk/subversion/libsvn_wc/adm_ops.c Tue Mar 23 06:30:59 2010
@@ -2183,15 +2183,17 @@ svn_wc_get_pristine_copy_path(const char
                               const char **pristine_path,
                               apr_pool_t *pool)
 {
-  svn_wc_context_t *wc_ctx;
+  svn_wc__db_t *db;
   const char *local_abspath;
 
-  SVN_ERR(svn_wc_context_create(&wc_ctx, NULL, pool, pool));
+  SVN_ERR(svn_wc__db_open(&db, svn_wc__db_openmode_readonly, NULL,
+                          TRUE, TRUE, pool, pool));
   SVN_ERR(svn_dirent_get_absolute(&local_abspath, path, pool));
 
-  SVN_ERR(svn_wc__text_base_path(pristine_path, wc_ctx->db, local_abspath,
-                                          FALSE, pool));
-  return SVN_NO_ERROR;
+  SVN_ERR(svn_wc__text_base_path(pristine_path, db, local_abspath,
+                                 FALSE, pool));
+
+  return svn_error_return(svn_wc__db_close(db));
 }
 
 svn_error_t *
@@ -2276,12 +2278,14 @@ svn_wc__get_pristine_contents(svn_stream
   /* ### TODO 1.7: use pristine store instead of this block: */
   {
     const char *text_base;
+
     SVN_ERR(svn_wc__text_base_path(&text_base, db, local_abspath, FALSE,
                                    scratch_pool));
     SVN_ERR_ASSERT(text_base != NULL);
 
-    return svn_stream_open_readonly(contents, text_base, result_pool,
-                                    scratch_pool);
+    return svn_error_return(svn_stream_open_readonly(contents, text_base,
+                                                     result_pool,
+                                                     scratch_pool));
   }
 }