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/14 14:10:53 UTC
svn commit: r944218 - in /subversion/trunk:
notes/wc-ng/use-of-tmp-text-base-path subversion/libsvn_wc/adm_crawler.c
subversion/libsvn_wc/adm_files.c subversion/libsvn_wc/adm_files.h
subversion/libsvn_wc/adm_ops.c
Author: julianfoad
Date: Fri May 14 12:10:53 2010
New Revision: 944218
URL: http://svn.apache.org/viewvc?rev=944218&view=rev
Log:
Break out the svn_wc__text_base_path(tmp=TRUE) functionality into a
separate function, named svn_wc__text_base_deterministic_tmp_path().
The two usages are logically distinct, and whereas something like this
will have to remain for backward compatibility, the (tmp=FALSE) case will
be completely replaced in the transition to WC-NG pristine storage.
* subversion/libsvn_wc/adm_files.h,
subversion/libsvn_wc/adm_files.c
(svn_wc__text_base_deterministic_tmp_path): New function.
* subversion/libsvn_wc/adm_crawler.c
(svn_wc__internal_transmit_text_deltas): Use it.
* subversion/libsvn_wc/adm_ops.c
(process_committed_leaf): Use it.
* notes/wc-ng/use-of-tmp-text-base-path
Update accordingly.
Modified:
subversion/trunk/notes/wc-ng/use-of-tmp-text-base-path
subversion/trunk/subversion/libsvn_wc/adm_crawler.c
subversion/trunk/subversion/libsvn_wc/adm_files.c
subversion/trunk/subversion/libsvn_wc/adm_files.h
subversion/trunk/subversion/libsvn_wc/adm_ops.c
Modified: subversion/trunk/notes/wc-ng/use-of-tmp-text-base-path
URL: http://svn.apache.org/viewvc/subversion/trunk/notes/wc-ng/use-of-tmp-text-base-path?rev=944218&r1=944217&r2=944218&view=diff
==============================================================================
--- subversion/trunk/notes/wc-ng/use-of-tmp-text-base-path (original)
+++ subversion/trunk/notes/wc-ng/use-of-tmp-text-base-path Fri May 14 12:10:53 2010
@@ -1,5 +1,5 @@
-Call graphs of the use of the WC-1 temporary text base path, as of r927056.
+Call graphs of the use of the WC-1 temporary text base path.
This is to help us eliminate the use of this path and replace it with a more
encapsulated way of referring to the new text base, as part of migration to a
@@ -52,12 +52,12 @@ path is obtained, and the extent to whic
|^ |^ log_do_committed()
|^ |^ |v
|^ |^ install_committed_file()
- |^ |^ |v
- |^ |^ |v
- svn_wc__text_base_path(tmp=TRUE) svn_wc__sync_text_base()
- |^ |v
- |^ [initialization] svn_io_rename()
- |^ | + svn_io_set_file_read_only()
+ |^ |^ |v
+ |^ |^ |v
+ svn_wc__text_base_deterministic_tmp_path() svn_wc__sync_text_base()
+ |^ |v
+ |^ [initialization] svn_io_rename()
+ |^ | + svn_io_set_file_read_only()
|^ make_adm_subdir()
|^ |^
extend_with_adm_name(tmp=TRUE)
Modified: subversion/trunk/subversion/libsvn_wc/adm_crawler.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/adm_crawler.c?rev=944218&r1=944217&r2=944218&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/adm_crawler.c (original)
+++ subversion/trunk/subversion/libsvn_wc/adm_crawler.c Fri May 14 12:10:53 2010
@@ -1117,8 +1117,9 @@ svn_wc__internal_transmit_text_deltas(co
{
svn_stream_t *tempstream;
- SVN_ERR(svn_wc__text_base_path(tempfile, db, local_abspath, TRUE,
- result_pool));
+ SVN_ERR(svn_wc__text_base_deterministic_tmp_path(tempfile,
+ db, local_abspath,
+ result_pool));
/* Make an untranslated copy of the working file in the
administrative tmp area because a) we need to detranslate eol
Modified: subversion/trunk/subversion/libsvn_wc/adm_files.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/adm_files.c?rev=944218&r1=944217&r2=944218&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/adm_files.c (original)
+++ subversion/trunk/subversion/libsvn_wc/adm_files.c Fri May 14 12:10:53 2010
@@ -218,6 +218,7 @@ svn_wc__text_base_path(const char **resu
const char *newpath, *base_name;
SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
+ SVN_ERR_ASSERT(! tmp);
svn_dirent_split(local_abspath, &newpath, &base_name, pool);
*result_abspath = simple_extend(newpath,
@@ -231,6 +232,23 @@ svn_wc__text_base_path(const char **resu
}
svn_error_t *
+svn_wc__text_base_deterministic_tmp_path(const char **result_abspath,
+ svn_wc__db_t *db,
+ const char *local_abspath,
+ apr_pool_t *pool)
+{
+ const char *newpath, *base_name;
+
+ SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
+
+ svn_dirent_split(local_abspath, &newpath, &base_name, pool);
+ *result_abspath = simple_extend(newpath, TRUE, SVN_WC__ADM_TEXT_BASE,
+ base_name, SVN_WC__BASE_EXT, pool);
+
+ return SVN_NO_ERROR;
+}
+
+svn_error_t *
svn_wc__text_revert_path(const char **result_abspath,
svn_wc__db_t *db,
const char *local_abspath,
Modified: subversion/trunk/subversion/libsvn_wc/adm_files.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/adm_files.h?rev=944218&r1=944217&r2=944218&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/adm_files.h (original)
+++ subversion/trunk/subversion/libsvn_wc/adm_files.h Fri May 14 12:10:53 2010
@@ -61,8 +61,9 @@ svn_wc__sync_text_base(const char *local
apr_pool_t *pool);
-/* Set *RESULT_ABSPATH to the absolute path to LOCAL_ABSPATH's text-base file,
- or, if TMP is set, to its temporary text-base file. */
+/* Set *RESULT_ABSPATH to the absolute path to where LOCAL_ABSPATH's
+ text-base file is or should be created. The file does not necessarily
+ exist. TMP must be FALSE. */
svn_error_t *
svn_wc__text_base_path(const char **result_abspath,
svn_wc__db_t *db,
@@ -70,6 +71,14 @@ svn_wc__text_base_path(const char **resu
svn_boolean_t tmp,
apr_pool_t *pool);
+/* Set *RESULT_ABSPATH to the deterministic absolute path to where
+ LOCAL_ABSPATH's temporary text-base file is or should be created. */
+svn_error_t *
+svn_wc__text_base_deterministic_tmp_path(const char **result_abspath,
+ svn_wc__db_t *db,
+ const char *local_abspath,
+ apr_pool_t *pool);
+
/* Set *CONTENTS to a readonly stream on the pristine text of the working
* version of the file LOCAL_ABSPATH in DB. If the file is locally copied
* or moved to this path, this means the pristine text of the copy source,
@@ -139,7 +148,8 @@ svn_error_t *svn_wc__open_adm_stream(svn
associated with the versioned file LOCAL_ABSPATH in DB. Set *STREAM to
the opened stream and *TEMP_BASE_ABSPATH to the path to the temporary
file. The temporary file will have an arbitrary unique name, in contrast
- to the deterministic name that svn_wc__text_base_path(tmp=TRUE) returns.
+ to the deterministic name that svn_wc__text_base_deterministic_tmp_path()
+ returns.
Arrange that, on stream closure, *MD5_CHECKSUM and *SHA1_CHECKSUM will be
set to the MD-5 and SHA-1 checksums respectively of that file.
Modified: subversion/trunk/subversion/libsvn_wc/adm_ops.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/adm_ops.c?rev=944218&r1=944217&r2=944218&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/adm_ops.c (original)
+++ subversion/trunk/subversion/libsvn_wc/adm_ops.c Fri May 14 12:10:53 2010
@@ -457,8 +457,9 @@ process_committed_leaf(svn_wc__db_t *db,
{
svn_node_kind_t new_base_kind;
- SVN_ERR(svn_wc__text_base_path(&tmp_text_base_abspath, db, local_abspath,
- TRUE, scratch_pool));
+ SVN_ERR(svn_wc__text_base_deterministic_tmp_path(&tmp_text_base_abspath,
+ db, local_abspath,
+ scratch_pool));
SVN_ERR(svn_io_check_path(tmp_text_base_abspath, &new_base_kind,
scratch_pool));
if (new_base_kind != svn_node_file)