You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by rh...@apache.org on 2012/06/05 13:31:17 UTC
svn commit: r1346352 - in /subversion/trunk/subversion/libsvn_wc:
questions.c wc_db.c wc_db.h workqueue.c
Author: rhuijben
Date: Tue Jun 5 11:31:17 2012
New Revision: 1346352
URL: http://svn.apache.org/viewvc?rev=1346352&view=rev
Log:
Revert r1346035, which exposed op_depth to more of the libsvn_wc api than
really necessary in preparation for a cleaner and even more optimized version.
* subversion/libsvn_wc/questions.c
* subversion/libsvn_wc/wc_db.c
* subversion/libsvn_wc/wc_db.h
* subversion/libsvn_wc/workqueue.c
Revert r1346035's change to the svn_wc__db_global_record_fileinfo api.
Modified:
subversion/trunk/subversion/libsvn_wc/questions.c
subversion/trunk/subversion/libsvn_wc/wc_db.c
subversion/trunk/subversion/libsvn_wc/wc_db.h
subversion/trunk/subversion/libsvn_wc/workqueue.c
Modified: subversion/trunk/subversion/libsvn_wc/questions.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/questions.c?rev=1346352&r1=1346351&r2=1346352&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/questions.c (original)
+++ subversion/trunk/subversion/libsvn_wc/questions.c Tue Jun 5 11:31:17 2012
@@ -360,7 +360,7 @@ svn_wc__internal_file_modified_p(svn_boo
SVN_ERR(svn_wc__db_wclock_owns_lock(&own_lock, db, local_abspath, FALSE,
scratch_pool));
if (own_lock)
- SVN_ERR(svn_wc__db_global_record_fileinfo(db, local_abspath, -1,
+ SVN_ERR(svn_wc__db_global_record_fileinfo(db, local_abspath,
dirent->filesize,
dirent->mtime,
scratch_pool));
Modified: subversion/trunk/subversion/libsvn_wc/wc_db.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.c?rev=1346352&r1=1346351&r2=1346352&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.c Tue Jun 5 11:31:17 2012
@@ -4602,7 +4602,6 @@ svn_wc__db_op_add_symlink(svn_wc__db_t *
struct record_baton_t {
svn_filesize_t translated_size;
apr_time_t last_mod_time;
- int op_depth;
};
@@ -4618,15 +4617,9 @@ db_record_fileinfo(void *baton,
int affected_rows;
SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
- (rb->op_depth >= 0)
- ? STMT_UPDATE_NODE_FILEINFO_OPDEPTH
- : STMT_UPDATE_NODE_FILEINFO));
+ STMT_UPDATE_NODE_FILEINFO));
SVN_ERR(svn_sqlite__bindf(stmt, "isii", wcroot->wc_id, local_relpath,
rb->translated_size, rb->last_mod_time));
-
- if (rb->op_depth >= 0)
- SVN_ERR(svn_sqlite__bind_int(stmt, 5, rb->op_depth));
-
SVN_ERR(svn_sqlite__update(&affected_rows, stmt));
SVN_ERR_ASSERT(affected_rows == 1);
@@ -4638,7 +4631,6 @@ db_record_fileinfo(void *baton,
svn_error_t *
svn_wc__db_global_record_fileinfo(svn_wc__db_t *db,
const char *local_abspath,
- int op_depth,
svn_filesize_t translated_size,
apr_time_t last_mod_time,
apr_pool_t *scratch_pool)
@@ -4655,9 +4647,9 @@ svn_wc__db_global_record_fileinfo(svn_wc
rb.translated_size = translated_size;
rb.last_mod_time = last_mod_time;
- rb.op_depth = op_depth;
- SVN_ERR(db_record_fileinfo(&rb, wcroot, local_relpath, scratch_pool));
+ SVN_ERR(svn_wc__db_with_txn(wcroot, local_relpath, db_record_fileinfo, &rb,
+ scratch_pool));
/* We *totally* monkeyed the entries. Toss 'em. */
SVN_ERR(flush_entries(wcroot, local_abspath, svn_depth_empty, scratch_pool));
@@ -4752,7 +4744,6 @@ set_props_txn(void *baton,
struct record_baton_t rb;
rb.translated_size = SVN_INVALID_FILESIZE;
rb.last_mod_time = 0;
- rb.op_depth = -1;
SVN_ERR(db_record_fileinfo(&rb, wcroot, local_relpath, scratch_pool));
}
@@ -7948,7 +7939,6 @@ svn_wc__db_read_node_install_info(const
const svn_checksum_t **sha1_checksum,
apr_hash_t **pristine_props,
apr_time_t *changed_date,
- int *op_depth,
svn_wc__db_t *db,
const char *local_abspath,
const char *wri_abspath,
@@ -8004,9 +7994,6 @@ svn_wc__db_read_node_install_info(const
if (changed_date)
*changed_date = svn_sqlite__column_int64(stmt, 9);
-
- if (op_depth)
- *op_depth = svn_sqlite__column_int(stmt, 0);
}
else
return svn_error_createf(SVN_ERR_WC_PATH_NOT_FOUND,
Modified: subversion/trunk/subversion/libsvn_wc/wc_db.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.h?rev=1346352&r1=1346351&r2=1346352&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db.h (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.h Tue Jun 5 11:31:17 2012
@@ -1973,8 +1973,7 @@ svn_wc__db_read_pristine_info(svn_wc__db
Set WCROOT_ABSPATH to the working copy root, SHA1_CHECKSUM to the
checksum of the node (a valid reference into the pristine store)
and PRISTINE_PROPS to the node's pristine properties (to use for
- installing the file). Set *CHANGED_DATE to the recorded changed date and
- *OP_DEPTH to the nodes highest/current op_depth.
+ installing the file).
If WRI_ABSPATH is not NULL, check for information in the working copy
identified by WRI_ABSPATH.
@@ -1984,7 +1983,6 @@ svn_wc__db_read_node_install_info(const
const svn_checksum_t **sha1_checksum,
apr_hash_t **pristine_props,
apr_time_t *changed_date,
- int *op_depth,
svn_wc__db_t *db,
const char *local_abspath,
const char *wri_abspath,
@@ -2402,8 +2400,9 @@ svn_wc__db_op_bump_revisions_post_update
/* Record the TRANSLATED_SIZE and LAST_MOD_TIME for a versioned node.
- This function will record the information within the highest WORKING node,
- or if OP_DEPTH >= 0 at the specified OP_DEPTH.
+ This function will record the information within the WORKING node,
+ if present, or within the BASE tree. If neither node is present, then
+ SVN_ERR_WC_PATH_NOT_FOUND will be returned.
TRANSLATED_SIZE may be SVN_INVALID_FILESIZE, which will be recorded
as such, implying "unknown size".
@@ -2414,7 +2413,6 @@ svn_wc__db_op_bump_revisions_post_update
svn_error_t *
svn_wc__db_global_record_fileinfo(svn_wc__db_t *db,
const char *local_abspath,
- int op_depth,
svn_filesize_t translated_size,
apr_time_t last_mod_time,
apr_pool_t *scratch_pool);
Modified: subversion/trunk/subversion/libsvn_wc/workqueue.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/workqueue.c?rev=1346352&r1=1346351&r2=1346352&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/workqueue.c (original)
+++ subversion/trunk/subversion/libsvn_wc/workqueue.c Tue Jun 5 11:31:17 2012
@@ -72,7 +72,6 @@ struct work_item_dispatch {
static svn_error_t *
get_and_record_fileinfo(svn_wc__db_t *db,
const char *local_abspath,
- int op_depth,
svn_boolean_t ignore_enoent,
apr_pool_t *scratch_pool)
{
@@ -88,7 +87,7 @@ get_and_record_fileinfo(svn_wc__db_t *db
}
return svn_error_trace(svn_wc__db_global_record_fileinfo(
- db, local_abspath, op_depth,
+ db, local_abspath,
dirent->filesize, dirent->mtime,
scratch_pool));
}
@@ -464,16 +463,13 @@ process_commit_file_install(svn_wc__db_t
/* We will compute and modify the size and timestamp */
if (overwrote_working)
{
- const svn_io_dirent2_t *dirent;
+ apr_finfo_t finfo;
- SVN_ERR(svn_io_stat_dirent(&dirent, local_abspath, TRUE,
- scratch_pool, scratch_pool));
-
- if (dirent->kind == svn_node_file)
- SVN_ERR(svn_wc__db_global_record_fileinfo(db, local_abspath, 0,
- dirent->filesize,
- dirent->mtime,
- scratch_pool));
+ SVN_ERR(svn_io_stat(&finfo, local_abspath,
+ APR_FINFO_MIN | APR_FINFO_LINK, scratch_pool));
+ SVN_ERR(svn_wc__db_global_record_fileinfo(db, local_abspath,
+ finfo.size, finfo.mtime,
+ scratch_pool));
}
else
{
@@ -648,7 +644,6 @@ run_file_install(svn_wc__db_t *db,
const svn_checksum_t *checksum;
apr_hash_t *props;
apr_time_t changed_date;
- int op_depth;
local_relpath = apr_pstrmemdup(scratch_pool, arg1->data, arg1->len);
SVN_ERR(svn_wc__db_from_relpath(&local_abspath, db, wri_abspath,
@@ -661,7 +656,7 @@ run_file_install(svn_wc__db_t *db,
SVN_ERR(svn_wc__db_read_node_install_info(&wcroot_abspath,
&checksum, &props,
- &changed_date, &op_depth,
+ &changed_date,
db, local_abspath, wri_abspath,
scratch_pool, scratch_pool));
@@ -805,7 +800,7 @@ run_file_install(svn_wc__db_t *db,
/* ### this should happen before we rename the file into place. */
if (record_fileinfo)
{
- SVN_ERR(get_and_record_fileinfo(db, local_abspath, op_depth,
+ SVN_ERR(get_and_record_fileinfo(db, local_abspath,
FALSE /* ignore_enoent */,
scratch_pool));
}
@@ -1249,7 +1244,7 @@ run_record_fileinfo(svn_wc__db_t *db,
}
- return svn_error_trace(get_and_record_fileinfo(db, local_abspath, -1,
+ return svn_error_trace(get_and_record_fileinfo(db, local_abspath,
TRUE /* ignore_enoent */,
scratch_pool));
}
RE: svn commit: r1346352 - in /subversion/trunk/subversion/libsvn_wc: questions.c wc_db.c wc_db.h workqueue.c
Posted by Bert Huijben <be...@qqmail.nl>.
> -----Original Message-----
> From: Greg Stein [mailto:gstein@gmail.com]
> Sent: dinsdag 5 juni 2012 17:11
> To: dev@subversion.apache.org
> Subject: Re: svn commit: r1346352 - in
> /subversion/trunk/subversion/libsvn_wc: questions.c wc_db.c wc_db.h
> workqueue.c
>
> On Tue, Jun 5, 2012 at 7:31 AM, <rh...@apache.org> wrote:
> > Author: rhuijben
> > Date: Tue Jun 5 11:31:17 2012
> > New Revision: 1346352
> >
> > URL: http://svn.apache.org/viewvc?rev=1346352&view=rev
> > Log:
> > Revert r1346035, which exposed op_depth to more of the libsvn_wc api
> than
> > really necessary in preparation for a cleaner and even more optimized
> version.
>
> Thanks. Sounds like you have a new idea?
The only case that really needs optimization would be op_depth 0, called
from the working queue install operation. That could be expressed by a
Boolean instead of an int.
But it would be much cleaner to move most of that code in a new
svn_wc__db_pristine api, which would also allow using a db read lock to get
even higher performance during checkout and update.
Bert
Re: svn commit: r1346352 - in /subversion/trunk/subversion/libsvn_wc:
questions.c wc_db.c wc_db.h workqueue.c
Posted by Greg Stein <gs...@gmail.com>.
On Tue, Jun 5, 2012 at 7:31 AM, <rh...@apache.org> wrote:
> Author: rhuijben
> Date: Tue Jun 5 11:31:17 2012
> New Revision: 1346352
>
> URL: http://svn.apache.org/viewvc?rev=1346352&view=rev
> Log:
> Revert r1346035, which exposed op_depth to more of the libsvn_wc api than
> really necessary in preparation for a cleaner and even more optimized version.
Thanks. Sounds like you have a new idea?