You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by da...@apache.org on 2010/07/23 21:37:24 UTC
svn commit: r967221 [5/7] - in /subversion/branches/atomic-revprop: ./
build/generator/ notes/ notes/tree-conflicts/
subversion/bindings/javahl/tests/org/apache/subversion/javahl/
subversion/bindings/javahl/tests/org/tigris/subversion/javahl/ subversio...
Modified: subversion/branches/atomic-revprop/subversion/libsvn_wc/wc_db.c
URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/libsvn_wc/wc_db.c?rev=967221&r1=967220&r2=967221&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/branches/atomic-revprop/subversion/libsvn_wc/wc_db.c Fri Jul 23 19:37:19 2010
@@ -622,29 +622,27 @@ insert_base_node(void *baton, svn_sqlite
{
const insert_base_baton_t *pibb = baton;
svn_sqlite__stmt_t *stmt;
+#ifdef SVN_WC__NODE_DATA
+ svn_sqlite__stmt_t *stmt_node;
+#endif
+ /* The directory at the WCROOT has a NULL parent_relpath. Otherwise,
+ bind the appropriate parent_relpath. */
+ const char *parent_relpath =
+ (*pibb->local_relpath == '\0') ? NULL
+ : svn_relpath_dirname(pibb->local_relpath, scratch_pool);
/* ### we can't handle this right now */
SVN_ERR_ASSERT(pibb->conflict == NULL);
SVN_ERR(svn_sqlite__get_statement(&stmt, sdb, STMT_INSERT_BASE_NODE));
- SVN_ERR(svn_sqlite__bindf(stmt, "is", pibb->wc_id, pibb->local_relpath));
-
- if (TRUE /* maybe_bind_repos() */)
- {
- SVN_ERR(svn_sqlite__bind_int64(stmt, 3, pibb->repos_id));
- SVN_ERR(svn_sqlite__bind_text(stmt, 4, pibb->repos_relpath));
- }
-
- /* The directory at the WCROOT has a NULL parent_relpath. Otherwise,
- bind the appropriate parent_relpath. */
- if (*pibb->local_relpath != '\0')
- SVN_ERR(svn_sqlite__bind_text(stmt, 5,
- svn_relpath_dirname(pibb->local_relpath,
- scratch_pool)));
-
- SVN_ERR(svn_sqlite__bind_token(stmt, 6, presence_map, pibb->status));
- SVN_ERR(svn_sqlite__bind_token(stmt, 7, kind_map, pibb->kind));
- SVN_ERR(svn_sqlite__bind_int64(stmt, 8, pibb->revision));
+ SVN_ERR(svn_sqlite__bindf(stmt, "isisstti",
+ pibb->wc_id, pibb->local_relpath,
+ pibb->repos_id,
+ pibb->repos_relpath,
+ parent_relpath,
+ presence_map, pibb->status,
+ kind_map, pibb->kind,
+ pibb->revision));
SVN_ERR(svn_sqlite__bind_properties(stmt, 9, pibb->props, scratch_pool));
@@ -679,12 +677,57 @@ insert_base_node(void *baton, svn_sqlite
SVN_ERR(svn_sqlite__insert(NULL, stmt));
+#ifdef SVN_WC__NODE_DATA
+ SVN_ERR(svn_sqlite__get_statement(&stmt_node, sdb, STMT_INSERT_NODE_DATA));
+ SVN_ERR(svn_sqlite__bindf(stmt_node, "isistt",
+ pibb->wc_id, pibb->local_relpath,
+ (apr_int64_t)0, /* op_depth is 0 for base */
+ parent_relpath,
+ presence_map, pibb->status,
+ kind_map, pibb->kind));
+
+ if (SVN_IS_VALID_REVNUM(pibb->changed_rev))
+ SVN_ERR(svn_sqlite__bind_int64(stmt_node, 7, pibb->changed_rev));
+ if (pibb->changed_date)
+ SVN_ERR(svn_sqlite__bind_int64(stmt_node, 8, pibb->changed_date));
+ if (pibb->changed_author)
+ SVN_ERR(svn_sqlite__bind_text(stmt_node, 9, pibb->changed_author));
+
+ if (pibb->kind == svn_wc__db_kind_dir)
+ {
+ SVN_ERR(svn_sqlite__bind_text(stmt_node, 10,
+ svn_depth_to_word(pibb->depth)));
+ }
+ else if (pibb->kind == svn_wc__db_kind_file)
+ {
+ SVN_ERR(svn_sqlite__bind_checksum(stmt_node, 11, pibb->checksum,
+ scratch_pool));
+ }
+ else if (pibb->kind == svn_wc__db_kind_symlink)
+ {
+ /* Note: incomplete nodes may have a NULL target. */
+ if (pibb->target)
+ SVN_ERR(svn_sqlite__bind_text(stmt_node, 12, pibb->target));
+ }
+
+ /* Don't bind original_repos_id, original_repos_path and original_revision */
+
+ SVN_ERR(svn_sqlite__bind_properties(stmt_node, 16, pibb->props,
+ scratch_pool));
+
+ SVN_ERR(svn_sqlite__insert(NULL, stmt_node));
+#endif
+
if (pibb->kind == svn_wc__db_kind_dir && pibb->children)
{
int i;
SVN_ERR(svn_sqlite__get_statement(&stmt, sdb,
STMT_INSERT_BASE_NODE_INCOMPLETE));
+#ifdef SVN_WC__NODE_DATA
+ SVN_ERR(svn_sqlite__get_statement(&stmt_node, sdb,
+ STMT_INSERT_NODE_DATA_INCOMPLETE));
+#endif
for (i = pibb->children->nelts; i--; )
{
@@ -698,6 +741,17 @@ insert_base_node(void *baton, svn_sqlite
pibb->local_relpath,
(apr_int64_t)pibb->revision));
SVN_ERR(svn_sqlite__insert(NULL, stmt));
+
+#ifdef SVN_WC__NODE_DATA
+ SVN_ERR(svn_sqlite__bindf(stmt_node, "isis",
+ pibb->wc_id,
+ svn_relpath_join(pibb->local_relpath,
+ name,
+ scratch_pool),
+ (apr_int64_t)0 /* BASE */,
+ pibb->local_relpath));
+ SVN_ERR(svn_sqlite__insert(NULL, stmt_node));
+#endif
}
}
@@ -726,10 +780,18 @@ insert_incomplete_working_children(svn_s
apr_pool_t *scratch_pool)
{
svn_sqlite__stmt_t *stmt;
+#ifdef SVN_WC__NODE_DATA
+ svn_sqlite__stmt_t *stmt_node;
+#endif
int i;
SVN_ERR(svn_sqlite__get_statement(&stmt, sdb,
STMT_INSERT_WORKING_NODE_INCOMPLETE));
+#ifdef SVN_WC__NODE_DATA
+ SVN_ERR(svn_sqlite__get_statement(&stmt_node, sdb,
+ STMT_INSERT_NODE_DATA_INCOMPLETE));
+#endif
+
for (i = children->nelts; i--; )
{
@@ -741,6 +803,18 @@ insert_incomplete_working_children(svn_s
scratch_pool),
local_relpath));
SVN_ERR(svn_sqlite__insert(NULL, stmt));
+
+#ifdef SVN_WC__NODE_DATA
+ SVN_ERR(svn_sqlite__bindf(stmt_node, "isis",
+ wc_id,
+ svn_relpath_join(local_relpath, name,
+ scratch_pool),
+#ifndef SINGLE_DB
+ (apr_int64_t) 2, /* non-THIS_DIR working */
+#endif
+ local_relpath));
+ SVN_ERR(svn_sqlite__insert(NULL, stmt_node));
+#endif
}
return SVN_NO_ERROR;
@@ -755,6 +829,10 @@ insert_working_node(void *baton,
const insert_working_baton_t *piwb = baton;
const char *parent_relpath;
svn_sqlite__stmt_t *stmt;
+#ifdef SVN_WC__NODE_DATA
+ svn_sqlite__stmt_t *stmt_node;
+ apr_int64_t op_depth;
+#endif
/* We cannot insert a WORKING_NODE row at the wcroot. */
/* ### actually, with per-dir DB, we can... */
@@ -770,8 +848,8 @@ insert_working_node(void *baton,
SVN_ERR(svn_sqlite__bindf(stmt, "isstt",
piwb->wc_id, piwb->local_relpath,
parent_relpath,
- presence_map, piwb->presence,
- kind_map, piwb->kind));
+ presence_map, piwb->presence,
+ kind_map, piwb->kind));
if (piwb->original_repos_relpath != NULL)
{
@@ -821,6 +899,63 @@ insert_working_node(void *baton,
SVN_ERR(svn_sqlite__insert(NULL, stmt));
+
+#ifdef SVN_WC__NODE_DATA
+#ifndef SINGLE_DB
+ op_depth = (parent_relpath == NULL) ? 1 /* THIS_DIR */
+ : 2; /* immediate children */
+#endif
+ SVN_ERR(svn_sqlite__get_statement(&stmt_node, sdb, STMT_INSERT_NODE_DATA));
+ SVN_ERR(svn_sqlite__bindf(stmt_node, "isistt",
+ piwb->wc_id, piwb->local_relpath,
+ op_depth,
+ parent_relpath,
+ presence_map, piwb->presence,
+ kind_map, piwb->kind));
+
+ if (SVN_IS_VALID_REVNUM(piwb->changed_rev))
+ SVN_ERR(svn_sqlite__bind_int64(stmt_node, 7, piwb->changed_rev));
+ if (piwb->changed_date)
+ SVN_ERR(svn_sqlite__bind_int64(stmt_node, 8, piwb->changed_date));
+ if (piwb->changed_author)
+ SVN_ERR(svn_sqlite__bind_text(stmt_node, 9, piwb->changed_author));
+
+ if (piwb->kind == svn_wc__db_kind_dir)
+ {
+ SVN_ERR(svn_sqlite__bind_text(stmt_node, 10,
+ svn_depth_to_word(piwb->depth)));
+ }
+ else if (piwb->kind == svn_wc__db_kind_file)
+ {
+ SVN_ERR(svn_sqlite__bind_checksum(stmt_node, 11, piwb->checksum,
+ scratch_pool));
+ }
+ else if (piwb->kind == svn_wc__db_kind_symlink)
+ {
+ /* Note: incomplete nodes may have a NULL target. */
+ if (piwb->target)
+ SVN_ERR(svn_sqlite__bind_text(stmt_node, 12, piwb->target));
+ }
+
+ if (piwb->original_repos_relpath != NULL)
+ {
+ SVN_ERR(svn_sqlite__bind_int64(stmt_node, 13, piwb->original_repos_id));
+ SVN_ERR(svn_sqlite__bind_text(stmt_node, 14,
+ piwb->original_repos_relpath));
+ SVN_ERR(svn_sqlite__bind_int64(stmt_node, 15, piwb->original_revnum));
+ }
+
+
+ /* Don't bind original_repos_id, original_repos_path and original_revision */
+
+
+ SVN_ERR(svn_sqlite__bind_properties(stmt_node, 16, piwb->props,
+ scratch_pool));
+
+ SVN_ERR(svn_sqlite__insert(NULL, stmt_node));
+#endif
+
+
if (piwb->kind == svn_wc__db_kind_dir && piwb->children)
SVN_ERR(insert_incomplete_working_children(sdb, piwb->wc_id,
piwb->local_relpath,
@@ -1140,6 +1275,7 @@ which_trees_exist(svn_boolean_t *base_ex
we return a WC_ID and verify some additional constraints. */
static svn_error_t *
prop_upgrade_trees(svn_boolean_t *base_exists,
+ svn_wc__db_status_t *base_presence,
svn_boolean_t *working_exists,
svn_wc__db_status_t *work_presence,
apr_int64_t *wc_id,
@@ -1171,6 +1307,7 @@ prop_upgrade_trees(svn_boolean_t *base_e
else
{
*base_exists = TRUE; /* value == 0 */
+ *base_presence = svn_sqlite__column_token(stmt, 1, presence_map);
}
/* Return the WC_ID that was assigned. */
@@ -1187,6 +1324,8 @@ prop_upgrade_trees(svn_boolean_t *base_e
fetch the 'presence' column value. */
if (svn_sqlite__column_int(stmt, 0))
*work_presence = svn_sqlite__column_token(stmt, 1, presence_map);
+ else
+ *base_presence = svn_sqlite__column_token(stmt, 1, presence_map);
/* During an upgrade, there should be just one working copy, so both
rows should refer to the same value. */
@@ -1218,6 +1357,11 @@ create_db(svn_sqlite__db_t **sdb,
/* Create the database's schema. */
SVN_ERR(svn_sqlite__exec_statements(*sdb, STMT_CREATE_SCHEMA));
+#ifdef SVN_WC__NODE_DATA
+ /* Create the NODE_DATA table for the experimental schema */
+ SVN_ERR(svn_sqlite__exec_statements(*sdb, STMT_CREATE_NODE_DATA));
+#endif
+
/* Insert the repository. */
SVN_ERR(create_repos_id(repos_id, repos_root_url, repos_uuid, *sdb,
scratch_pool));
@@ -1746,6 +1890,14 @@ svn_wc__db_base_remove(svn_wc__db_t *db,
SVN_ERR(svn_sqlite__step_done(stmt));
+#ifdef SVN_WC__NODE_DATA
+ SVN_ERR(svn_sqlite__get_statement(&stmt, pdh->wcroot->sdb,
+ STMT_DELETE_NODE_DATA_BASE));
+ SVN_ERR(svn_sqlite__bindf(stmt, "is", pdh->wcroot->wc_id, local_relpath));
+
+ SVN_ERR(svn_sqlite__step_done(stmt));
+#endif
+
flush_entries(pdh);
#ifndef SINGLE_DB
@@ -1765,6 +1917,16 @@ svn_wc__db_base_remove(svn_wc__db_t *db,
SVN_ERR(svn_sqlite__step_done(stmt));
+#ifdef SVN_WC__NODE_DATA
+ SVN_ERR(svn_sqlite__get_statement(&stmt, pdh->wcroot->sdb,
+ STMT_DELETE_NODE_DATA_BASE));
+ SVN_ERR(svn_sqlite__bindf(stmt, "is", pdh->wcroot->wc_id,
+ svn_dirent_basename(local_abspath,
+ scratch_pool)));
+
+ SVN_ERR(svn_sqlite__step_done(stmt));
+#endif
+
flush_entries(pdh);
}
else if (err && err->apr_err == SVN_ERR_WC_NOT_WORKING_COPY)
@@ -3603,6 +3765,11 @@ svn_wc__db_temp_base_set_props(svn_wc__d
const apr_hash_t *props,
apr_pool_t *scratch_pool)
{
+#ifdef SVN_WC__NODE_DATA
+ SVN_ERR(set_properties(db, local_abspath, props,
+ STMT_UPDATE_NODE_DATA_BASE_PROPS, "base node",
+ scratch_pool));
+#endif
return svn_error_return(set_properties(db, local_abspath, props,
STMT_UPDATE_BASE_PROPS,
"base_node",
@@ -3616,6 +3783,11 @@ svn_wc__db_temp_working_set_props(svn_wc
const apr_hash_t *props,
apr_pool_t *scratch_pool)
{
+#ifdef SVN_WC__NODE_DATA
+ SVN_ERR(set_properties(db, local_abspath, props,
+ STMT_UPDATE_NODE_DATA_WORKING_PROPS, "working node",
+ scratch_pool));
+#endif
return svn_error_return(set_properties(db, local_abspath, props,
STMT_UPDATE_WORKING_PROPS,
"working_node",
@@ -4044,11 +4216,18 @@ svn_wc__db_temp_op_remove_entry(svn_wc__
SVN_ERR(svn_sqlite__bindf(stmt, "is", wc_id, local_relpath));
SVN_ERR(svn_sqlite__step_done(stmt));
+#ifdef SVN_WC__NODE_DATA
+ SVN_ERR(svn_sqlite__get_statement(&stmt, sdb, STMT_DELETE_NODE_DATA_LAYERS));
+ SVN_ERR(svn_sqlite__bindf(stmt, "isi", wc_id, local_relpath, (apr_int64_t)0));
+ SVN_ERR(svn_sqlite__step_done(stmt));
+#endif
+
SVN_ERR(svn_sqlite__get_statement(&stmt, sdb, STMT_DELETE_ACTUAL_NODE));
SVN_ERR(svn_sqlite__bindf(stmt, "is", wc_id, local_relpath));
SVN_ERR(svn_sqlite__step_done(stmt));
+#ifndef SINGLE_DB
/* Check if we should also remove it from the parent db */
if (*local_relpath == '\0')
{
@@ -4071,11 +4250,20 @@ svn_wc__db_temp_op_remove_entry(svn_wc__
SVN_ERR(svn_sqlite__bindf(stmt, "is", wc_id, local_relpath));
SVN_ERR(svn_sqlite__step_done(stmt));
+#ifdef SVN_WC__NODE_DATA
+ SVN_ERR(svn_sqlite__get_statement(&stmt, sdb,
+ STMT_DELETE_NODE_DATA_LAYERS));
+ SVN_ERR(svn_sqlite__bindf(stmt, "isi",
+ wc_id, local_relpath, (apr_int64_t)0));
+ SVN_ERR(svn_sqlite__step_done(stmt));
+#endif
+
SVN_ERR(svn_sqlite__get_statement(&stmt, sdb, STMT_DELETE_ACTUAL_NODE));
SVN_ERR(svn_sqlite__bindf(stmt, "is", wc_id, local_relpath));
SVN_ERR(svn_sqlite__step_done(stmt));
}
+#endif
return SVN_NO_ERROR;
}
@@ -4104,6 +4292,14 @@ svn_wc__db_temp_op_remove_working(svn_wc
SVN_ERR(svn_sqlite__bindf(stmt, "is", pdh->wcroot->wc_id, local_relpath));
SVN_ERR(svn_sqlite__step_done(stmt));
+#ifdef SVN_WC__NODE_DATA
+ SVN_ERR(svn_sqlite__get_statement(&stmt, pdh->wcroot->sdb,
+ STMT_DELETE_NODE_DATA_WORKING));
+ SVN_ERR(svn_sqlite__bindf(stmt, "is", pdh->wcroot->wc_id, local_relpath));
+ SVN_ERR(svn_sqlite__step_done(stmt));
+#endif
+
+#ifndef SINGLE_DB
/* Check if we should remove it from the parent db as well. */
if (*local_relpath == '\0')
{
@@ -4119,7 +4315,15 @@ svn_wc__db_temp_op_remove_working(svn_wc
STMT_DELETE_WORKING_NODE));
SVN_ERR(svn_sqlite__bindf(stmt, "is", pdh->wcroot->wc_id, local_relpath));
SVN_ERR(svn_sqlite__step_done(stmt));
+
+#ifdef SVN_WC__NODE_DATA
+ SVN_ERR(svn_sqlite__get_statement(&stmt, pdh->wcroot->sdb,
+ STMT_DELETE_NODE_DATA_WORKING));
+ SVN_ERR(svn_sqlite__bindf(stmt, "is", pdh->wcroot->wc_id, local_relpath));
+ SVN_ERR(svn_sqlite__step_done(stmt));
+#endif
}
+#endif
return SVN_NO_ERROR;
}
@@ -4149,6 +4353,17 @@ update_depth_values(svn_wc__db_pdh_t *pd
SVN_ERR(svn_sqlite__bind_text(stmt, 3, svn_depth_to_word(depth)));
SVN_ERR(svn_sqlite__step_done(stmt));
+#ifdef SVN_WC__NODE_DATA
+ SVN_ERR(svn_sqlite__get_statement(&stmt, pdh->wcroot->sdb,
+ excluded
+ ? STMT_UPDATE_NODE_BASE_EXCLUDED
+ : STMT_UPDATE_NODE_BASE_DEPTH));
+ SVN_ERR(svn_sqlite__bindf(stmt, "is", pdh->wcroot->wc_id, local_relpath));
+ if (!excluded)
+ SVN_ERR(svn_sqlite__bind_text(stmt, 3, svn_depth_to_word(depth)));
+ SVN_ERR(svn_sqlite__step_done(stmt));
+#endif
+
SVN_ERR(svn_sqlite__get_statement(&stmt, pdh->wcroot->sdb,
excluded
? STMT_UPDATE_WORKING_EXCLUDED
@@ -4158,6 +4373,17 @@ update_depth_values(svn_wc__db_pdh_t *pd
SVN_ERR(svn_sqlite__bind_text(stmt, 3, svn_depth_to_word(depth)));
SVN_ERR(svn_sqlite__step_done(stmt));
+#ifdef SVN_WC__NODE_DATA
+ SVN_ERR(svn_sqlite__get_statement(&stmt, pdh->wcroot->sdb,
+ excluded
+ ? STMT_UPDATE_NODE_WORKING_EXCLUDED
+ : STMT_UPDATE_NODE_WORKING_DEPTH));
+ SVN_ERR(svn_sqlite__bindf(stmt, "is", pdh->wcroot->wc_id, local_relpath));
+ if (!excluded)
+ SVN_ERR(svn_sqlite__bind_text(stmt, 3, svn_depth_to_word(depth)));
+ SVN_ERR(svn_sqlite__step_done(stmt));
+#endif
+
return SVN_NO_ERROR;
}
@@ -4184,6 +4410,7 @@ svn_wc__db_temp_op_set_dir_depth(svn_wc_
SVN_ERR(update_depth_values(pdh, local_relpath, depth));
+#ifndef SINGLE_DB
/* If we're in the subdir, then navigate to the parent to set its
depth value. */
if (*local_relpath == '\0')
@@ -4206,6 +4433,7 @@ svn_wc__db_temp_op_set_dir_depth(svn_wc_
local_relpath = svn_dirent_basename(local_abspath, scratch_pool);
SVN_ERR(update_depth_values(pdh, local_relpath, depth));
}
+#endif
return SVN_NO_ERROR;
}
@@ -4234,6 +4462,14 @@ db_working_update_presence(svn_wc__db_st
presence_map, status));
SVN_ERR(svn_sqlite__step_done(stmt));
+#ifdef SVN_WC__NODE_DATA
+ SVN_ERR(svn_sqlite__get_statement(&stmt, pdh->wcroot->sdb,
+ STMT_UPDATE_NODE_WORKING_PRESENCE));
+ SVN_ERR(svn_sqlite__bindf(stmt, "ist", pdh->wcroot->wc_id, local_relpath,
+ presence_map, status));
+ SVN_ERR(svn_sqlite__step_done(stmt));
+#endif
+
flush_entries(pdh);
#ifndef SINGLE_DB
@@ -4251,6 +4487,15 @@ db_working_update_presence(svn_wc__db_st
presence_map, status));
SVN_ERR(svn_sqlite__step_done(stmt));
+#ifdef SVN_WC__NODE_DATA
+ SVN_ERR(svn_sqlite__get_statement(&stmt, pdh->wcroot->sdb,
+ STMT_UPDATE_NODE_WORKING_PRESENCE));
+ SVN_ERR(svn_sqlite__bindf(stmt, "ist", pdh->wcroot->wc_id,
+ svn_dirent_basename(local_abspath, NULL),
+ presence_map, status));
+ SVN_ERR(svn_sqlite__step_done(stmt));
+#endif
+
flush_entries(pdh);
}
#endif
@@ -4280,6 +4525,14 @@ db_working_actual_remove(svn_wc__db_t *d
STMT_DELETE_WORKING_NODE));
SVN_ERR(svn_sqlite__bindf(stmt, "is", pdh->wcroot->wc_id, local_relpath));
SVN_ERR(svn_sqlite__step_done(stmt));
+
+#ifdef SVN_WC__NODE_DATA
+ SVN_ERR(svn_sqlite__get_statement(&stmt, pdh->wcroot->sdb,
+ STMT_DELETE_NODE_DATA_WORKING));
+ SVN_ERR(svn_sqlite__bindf(stmt, "is", pdh->wcroot->wc_id, local_relpath));
+ SVN_ERR(svn_sqlite__step_done(stmt));
+#endif
+
SVN_ERR(svn_sqlite__get_statement(&stmt, pdh->wcroot->sdb,
STMT_DELETE_ACTUAL_NODE));
SVN_ERR(svn_sqlite__bindf(stmt, "is", pdh->wcroot->wc_id, local_relpath));
@@ -4287,6 +4540,7 @@ db_working_actual_remove(svn_wc__db_t *d
flush_entries(pdh);
+#ifndef SINGLE_DB
if (*local_relpath == '\0')
{
/* ### Delete parent stub. Remove when db is centralised. */
@@ -4301,8 +4555,17 @@ db_working_actual_remove(svn_wc__db_t *d
pdh->wcroot->wc_id, local_relpath));
SVN_ERR(svn_sqlite__step_done(stmt));
+#ifdef SVN_WC__NODE_DATA
+ SVN_ERR(svn_sqlite__get_statement(&stmt, pdh->wcroot->sdb,
+ STMT_DELETE_NODE_DATA_WORKING));
+ SVN_ERR(svn_sqlite__bindf(stmt, "is",
+ pdh->wcroot->wc_id, local_relpath));
+ SVN_ERR(svn_sqlite__step_done(stmt));
+#endif
+
flush_entries(pdh);
}
+#endif
return SVN_NO_ERROR;
}
@@ -4333,6 +4596,7 @@ db_working_insert(svn_wc__db_status_t st
flush_entries(pdh);
+#ifndef SINGLE_DB
if (*local_relpath == '\0')
{
/* ### Insert parent stub. Remove when db is centralised. */
@@ -4352,6 +4616,7 @@ db_working_insert(svn_wc__db_status_t st
flush_entries(pdh);
}
+#endif
return SVN_NO_ERROR;
}
@@ -5204,6 +5469,16 @@ relocate_txn(void *baton, svn_sqlite__db
like_arg, new_repos_id));
SVN_ERR(svn_sqlite__step_done(stmt));
+#ifdef SVN_WC__NODE_DATA
+ SVN_ERR(svn_sqlite__get_statement(&stmt, sdb,
+ STMT_UPDATE_NODE_DATA_RECURSIVE_ORIGINAL_REPO));
+ SVN_ERR(svn_sqlite__bindf(stmt, "issii",
+ rb->wc_id, rb->local_relpath,
+ like_arg, rb->old_repos_id,
+ new_repos_id));
+ SVN_ERR(svn_sqlite__step_done(stmt));
+#endif
+
/* Do a bunch of stuff which is conditional on us actually having a
base_node in the first place. */
if (rb->have_base_node)
@@ -5576,6 +5851,14 @@ commit_node(void *baton, svn_sqlite__db_
SVN_ERR(svn_sqlite__bindf(stmt, "is",
cb->pdh->wcroot->wc_id, cb->local_relpath));
SVN_ERR(svn_sqlite__step_done(stmt));
+
+#ifdef SVN_WC__NODE_DATA
+ SVN_ERR(svn_sqlite__get_statement(&stmt, cb->pdh->wcroot->sdb,
+ STMT_DELETE_NODE_DATA_WORKING));
+ SVN_ERR(svn_sqlite__bindf(stmt, "is",
+ cb->pdh->wcroot->wc_id, cb->local_relpath));
+ SVN_ERR(svn_sqlite__step_done(stmt));
+#endif
}
if (have_act)
@@ -5676,6 +5959,7 @@ determine_repos_info(apr_int64_t *repos_
/* The parent MUST have a BASE node (otherwise, THIS node cannot be
processed for a commit). Move up and re-query. */
+#ifndef SVN_WC__SINGLE_DB
if (*local_relpath == '\0')
{
/* There is no entry for "" in the BASE_NODE table, so this directory
@@ -5688,16 +5972,17 @@ determine_repos_info(apr_int64_t *repos_
local_relpath = "";
}
else
+#endif
{
/* This was a child node within this wcroot. We want to look at the
- BASE node of the directory, which is local_relpath == "". */
- local_relpath = "";
+ BASE node of the directory. */
+ local_relpath = svn_relpath_dirname(local_relpath, scratch_pool);
}
/* The REPOS_ID will be the same (### until we support mixed-repos) */
SVN_ERR(scan_upwards_for_repos(repos_id, &repos_parent_relpath,
pdh->wcroot, pdh->local_abspath,
- "" /* local_relpath. see above. */,
+ local_relpath,
scratch_pool, scratch_pool));
*repos_relpath = svn_relpath_join(repos_parent_relpath, name, result_pool);
@@ -6543,6 +6828,7 @@ svn_wc__db_upgrade_apply_dav_cache(svn_s
svn_error_t *
svn_wc__db_upgrade_apply_props(svn_sqlite__db_t *sdb,
+ const char *dir_abspath,
const char *local_relpath,
apr_hash_t *base_props,
apr_hash_t *revert_props,
@@ -6551,6 +6837,7 @@ svn_wc__db_upgrade_apply_props(svn_sqlit
apr_pool_t *scratch_pool)
{
svn_boolean_t have_base;
+ svn_wc__db_status_t base_presence;
svn_boolean_t have_work;
svn_wc__db_status_t work_presence;
apr_int64_t wc_id;
@@ -6585,15 +6872,18 @@ svn_wc__db_upgrade_apply_props(svn_sqlit
*/
/* Collect information about this node. */
- SVN_ERR(prop_upgrade_trees(&have_base, &have_work, &work_presence, &wc_id,
- sdb, local_relpath));
+ SVN_ERR(prop_upgrade_trees(&have_base, &base_presence,
+ &have_work, &work_presence,
+ &wc_id, sdb, local_relpath));
/* Detect the buggy scenario described above. We cannot upgrade this
working copy if we have no idea where BASE_PROPS should go. */
if (original_format > SVN_WC__NO_REVERT_FILES
&& revert_props == NULL
&& have_work
- && work_presence == svn_wc__db_status_normal)
+ && work_presence == svn_wc__db_status_normal
+ && have_base
+ && base_presence != svn_wc__db_status_not_present)
{
/* There should be REVERT_PROPS, so it appears that we just ran into
the described bug. Sigh. */
@@ -6601,10 +6891,14 @@ svn_wc__db_upgrade_apply_props(svn_sqlit
_("The properties of '%s' are in an "
"indeterminate state and cannot be "
"upgraded. See issue #2530."),
- local_relpath);
+ svn_dirent_local_style(
+ svn_dirent_join(dir_abspath, local_relpath,
+ scratch_pool), scratch_pool));
}
- if (have_base)
+ if (have_base
+ && (base_presence == svn_wc__db_status_normal
+ || base_presence == svn_wc__db_status_incomplete))
{
apr_hash_t *props = revert_props ? revert_props : base_props;
@@ -6627,13 +6921,14 @@ svn_wc__db_upgrade_apply_props(svn_sqlit
/* Do we have a replaced node? It has properties: an empty set for
adds, and a non-empty set for copies/moves. */
- if (work_presence == svn_wc__db_status_normal
- && original_format > SVN_WC__NO_REVERT_FILES)
+ if (original_format > SVN_WC__NO_REVERT_FILES
+ && (work_presence == svn_wc__db_status_normal
+ || work_presence == svn_wc__db_status_incomplete))
{
SVN_ERR(svn_sqlite__get_statement(&stmt, sdb,
STMT_UPDATE_WORKING_PROPS));
SVN_ERR(svn_sqlite__bindf(stmt, "is", wc_id, local_relpath));
- SVN_ERR(svn_sqlite__bind_properties(stmt, 3, revert_props,
+ SVN_ERR(svn_sqlite__bind_properties(stmt, 3, base_props,
scratch_pool));
SVN_ERR(svn_sqlite__update(&affected_rows, stmt));
@@ -6645,6 +6940,17 @@ svn_wc__db_upgrade_apply_props(svn_sqlit
}
/* If there are WORKING_PROPS, then they always go into ACTUAL_NODE. */
+ if (working_props != NULL
+ && base_props != NULL)
+ {
+ apr_array_header_t *diffs;
+
+ SVN_ERR(svn_prop_diffs(&diffs, working_props, base_props, scratch_pool));
+
+ if (diffs->nelts == 0)
+ working_props = NULL; /* No differences */
+ }
+
if (working_props != NULL)
{
struct set_props_baton spb = { 0 };
@@ -6864,6 +7170,7 @@ svn_wc__db_temp_get_format(int *format,
pdh = svn_wc__db_pdh_get_or_create(db, local_dir_abspath, FALSE,
scratch_pool);
+#ifndef SINGLE_DB
/* ### for per-dir layouts, the wcroot should be this directory. under
### wc-ng, the wcroot may have become set for this missing subdir. */
if (pdh != NULL && pdh->wcroot != NULL
@@ -6873,6 +7180,7 @@ svn_wc__db_temp_get_format(int *format,
got set, but has since been constructed. */
pdh->wcroot = NULL;
}
+#endif
/* If the PDH isn't present, or have wcroot information, then do a full
upward traversal to find the wcroot. */
@@ -6906,7 +7214,9 @@ svn_wc__db_temp_get_format(int *format,
hanging off a parent though.
Don't clear the wcroot of a parent if we just found a
relative path here or we get multiple wcroot issues. */
+#ifndef SVN_WC__SINGLE_DB
if (err)
+#endif
pdh->wcroot = NULL;
/* Remap the returned error. */
@@ -6920,6 +7230,28 @@ svn_wc__db_temp_get_format(int *format,
SVN_ERR_ASSERT(pdh->wcroot != NULL);
}
+#ifdef SVN_WC__SINGLE_DB
+ {
+ const char *local_relpath = svn_dirent_skip_ancestor(pdh->wcroot->abspath,
+ local_dir_abspath);
+ if (*local_relpath != '\0')
+ {
+ svn_boolean_t base, working;
+
+ SVN_ERR(which_trees_exist(&base, &working, pdh->wcroot->sdb,
+ pdh->wcroot->wc_id, local_relpath));
+ if (!base && !working)
+ {
+ *format = 0;
+ return svn_error_createf(SVN_ERR_WC_MISSING, NULL,
+ _("'%s' is not a working copy"),
+ svn_dirent_local_style(local_dir_abspath,
+ scratch_pool));
+ }
+ }
+ }
+#endif
+
SVN_ERR_ASSERT(pdh->wcroot->format >= 1);
*format = pdh->wcroot->format;
@@ -6989,6 +7321,7 @@ svn_wc__db_temp_forget_directory(svn_wc_
#ifndef SVN_WC__SINGLE_DB
if (pdh->locked)
+#endif
{
err = svn_wc__db_wclock_release(db, pdh->local_abspath,
scratch_pool);
@@ -7002,6 +7335,7 @@ svn_wc__db_temp_forget_directory(svn_wc_
SVN_ERR(err);
}
+#ifndef SVN_WC__SINGLE_DB
SVN_ERR_ASSERT(!pdh->locked);
#endif
@@ -7648,6 +7982,16 @@ wclock_obtain_cb(void *baton,
#ifdef SVN_WC__SINGLE_DB
svn_wc__db_wclock_t lock;
+ svn_boolean_t have_base, have_working;
+
+ SVN_ERR(which_trees_exist(&have_base, &have_working, sdb,
+ bt->pdh->wcroot->wc_id, bt->local_relpath));
+
+ if (!have_base && !have_working)
+ return svn_error_createf(
+ SVN_ERR_WC_PATH_NOT_FOUND, NULL,
+ _("The node '%s' was not found."),
+ svn_dirent_local_style(bt->local_abspath, scratch_pool));
#else
/* ### Can only lock this directory in the per-dir layout. This is
### a temporary restriction until metadata gets centralised.
@@ -7954,7 +8298,34 @@ svn_wc__db_wclock_release(svn_wc__db_t *
/* First check and remove the owns-lock information as failure in
removing the db record implies that we have to steal the lock later. */
#ifndef SVN_WC__SINGLE_DB
- SVN_ERR_ASSERT(*local_relpath == '\0');
+ if (*local_relpath != '\0')
+ {
+ svn_wc__db_status_t status;
+ svn_wc__db_kind_t kind;
+ SVN_ERR(svn_wc__db_read_info(&status, &kind, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL,
+ db, local_abspath,
+ scratch_pool, scratch_pool));
+
+ if (kind == svn_wc__db_kind_dir)
+ switch (status)
+ {
+ case svn_wc__db_status_not_present:
+ case svn_wc__db_status_absent:
+ case svn_wc__db_status_excluded:
+ return SVN_NO_ERROR; /* These directories don't have an
+ administrative area */
+ case svn_wc__db_status_obstructed:
+ case svn_wc__db_status_obstructed_add:
+ case svn_wc__db_status_obstructed_delete:
+ return SVN_NO_ERROR; /* Administrative area missing
+ -> Lock gone */
+ }
+ SVN_ERR_ASSERT(*local_relpath == '\0');
+ }
+
if (!pdh->locked)
return svn_error_createf(SVN_ERR_WC_NOT_LOCKED, NULL,
_("Working copy not locked at '%s'."),
@@ -8074,6 +8445,9 @@ svn_wc__db_temp_op_set_base_incomplete(s
svn_sqlite__stmt_t *stmt;
svn_wc__db_pdh_t *pdh;
int affected_rows;
+#ifdef SVN_WC__NODE_DATA
+ int affected_node_rows;
+#endif
svn_wc__db_status_t base_status;
SVN_ERR(svn_wc__db_base_get_info(&base_status, NULL, NULL, NULL, NULL, NULL,
@@ -8087,10 +8461,17 @@ svn_wc__db_temp_op_set_base_incomplete(s
SVN_ERR(get_statement_for_path(&stmt, db, local_dir_abspath,
STMT_UPDATE_BASE_PRESENCE, scratch_pool));
+ SVN_ERR(svn_sqlite__bind_text(stmt, 3, incomplete ? "incomplete" : "normal"));
+ SVN_ERR(svn_sqlite__update(&affected_rows, stmt));
+#ifdef SVN_WC__NODE_DATA
+ SVN_ERR(get_statement_for_path(&stmt, db, local_dir_abspath,
+ STMT_UPDATE_NODE_BASE_PRESENCE, scratch_pool));
SVN_ERR(svn_sqlite__bind_text(stmt, 3, incomplete ? "incomplete" : "normal"));
+ SVN_ERR(svn_sqlite__update(&affected_node_rows, stmt));
- SVN_ERR(svn_sqlite__update(&affected_rows, stmt));
+ SVN_ERR_ASSERT(affected_rows == affected_node_rows);
+#endif
if (affected_rows > 0)
{
@@ -8318,12 +8699,19 @@ make_copy_txn(void *baton,
/* Remove current WORKING_NODE record */
SVN_ERR(svn_sqlite__get_statement(&stmt, sdb,
STMT_DELETE_WORKING_NODE));
-
SVN_ERR(svn_sqlite__bindf(stmt, "is",
mcb->pdh->wcroot->wc_id,
mcb->local_relpath));
+ SVN_ERR(svn_sqlite__step_done(stmt));
+#ifdef SVN_WC_NODE_DATA
+ SVN_ERR(svn_sqlite__get_statement(&stmt, sdb,
+ STMT_DELETE_NODE_DATA_WORKING));
+ SVN_ERR(svn_sqlite__bindf(stmt, "is",
+ mcb->pdh->wcroot->wc_id,
+ mcb->local_relpath));
SVN_ERR(svn_sqlite__step_done(stmt));
+#endif
}
if (add_working_normal)
@@ -8403,6 +8791,14 @@ make_copy_txn(void *baton,
SVN_ERR(svn_sqlite__bindf(stmt, "is",
pdh->wcroot->wc_id, local_relpath));
SVN_ERR(svn_sqlite__step_done(stmt));
+
+#ifdef SVN_WC__NODE_DATA
+ SVN_ERR(svn_sqlite__get_statement(&stmt, pdh->wcroot->sdb,
+ STMT_DELETE_NODE_DATA_WORKING));
+ SVN_ERR(svn_sqlite__bindf(stmt, "is",
+ pdh->wcroot->wc_id, local_relpath));
+ SVN_ERR(svn_sqlite__step_done(stmt));
+#endif
}
if (add_working_normal)
@@ -8424,6 +8820,14 @@ make_copy_txn(void *baton,
pdh->wcroot->wc_id, local_relpath));
SVN_ERR(svn_sqlite__step_done(stmt));
+#ifdef SVN_WC__NODE_DATA
+ SVN_ERR(svn_sqlite__get_statement(&stmt, pdh->wcroot->sdb,
+ STMT_DELETE_NODE_DATA_WORKING));
+ SVN_ERR(svn_sqlite__bindf(stmt, "is",
+ pdh->wcroot->wc_id, local_relpath));
+ SVN_ERR(svn_sqlite__step_done(stmt));
+#endif
+
/* And insert the right data */
SVN_ERR(svn_sqlite__get_statement(
&stmt, pdh->wcroot->sdb,
@@ -8451,6 +8855,14 @@ make_copy_txn(void *baton,
pdh->wcroot->wc_id, local_relpath));
SVN_ERR(svn_sqlite__step_done(stmt));
+#ifdef SVN_WC__NODE_DATA
+ SVN_ERR(svn_sqlite__get_statement(&stmt, pdh->wcroot->sdb,
+ STMT_DELETE_NODE_DATA_WORKING));
+ SVN_ERR(svn_sqlite__bindf(stmt, "is",
+ pdh->wcroot->wc_id, local_relpath));
+ SVN_ERR(svn_sqlite__step_done(stmt));
+#endif
+
/* And insert the right data */
SVN_ERR(svn_sqlite__get_statement(
&stmt, pdh->wcroot->sdb,
@@ -8470,12 +8882,19 @@ make_copy_txn(void *baton,
SVN_ERR(svn_sqlite__get_statement(&stmt, sdb,
STMT_DELETE_BASE_NODE));
-
SVN_ERR(svn_sqlite__bindf(stmt, "is",
mcb->pdh->wcroot->wc_id,
mcb->local_relpath));
+ SVN_ERR(svn_sqlite__step_done(stmt));
+#ifdef SVN_WC__NODE_DATA
+ SVN_ERR(svn_sqlite__get_statement(&stmt, sdb,
+ STMT_DELETE_NODE_DATA_BASE));
+ SVN_ERR(svn_sqlite__bindf(stmt, "is",
+ mcb->pdh->wcroot->wc_id,
+ mcb->local_relpath));
SVN_ERR(svn_sqlite__step_done(stmt));
+#endif
#ifndef SINGLE_DB
/* Remove BASE_NODE_STUB */
@@ -8492,6 +8911,14 @@ make_copy_txn(void *baton,
SVN_ERR(svn_sqlite__bindf(stmt, "is",
pdh->wcroot->wc_id, local_relpath));
SVN_ERR(svn_sqlite__step_done(stmt));
+
+#ifdef SVN_WC__NODE_DATA
+ SVN_ERR(svn_sqlite__get_statement(&stmt, pdh->wcroot->sdb,
+ STMT_DELETE_NODE_DATA_BASE));
+ SVN_ERR(svn_sqlite__bindf(stmt, "is",
+ pdh->wcroot->wc_id, local_relpath));
+ SVN_ERR(svn_sqlite__step_done(stmt));
+#endif
}
#endif
}
@@ -8749,6 +9176,13 @@ svn_wc__db_temp_remove_subdir_record(svn
SVN_ERR(svn_sqlite__bindf(stmt, "is", pdh->wcroot->wc_id, name));
SVN_ERR(svn_sqlite__step_done(stmt));
+#ifdef SVN_WC__NODE_DATA
+ SVN_ERR(svn_sqlite__get_statement(&stmt, pdh->wcroot->sdb,
+ STMT_DELETE_NODE_DATA_BASE));
+ SVN_ERR(svn_sqlite__bindf(stmt, "is", pdh->wcroot->wc_id, name));
+ SVN_ERR(svn_sqlite__step_done(stmt));
+#endif
+
return SVN_NO_ERROR;
}
@@ -8983,16 +9417,32 @@ svn_wc__db_temp_set_parent_stub_to_norma
SVN_ERR(svn_sqlite__get_statement(&stmt, pdh->wcroot->sdb,
STMT_DELETE_WORKING_NODE));
SVN_ERR(svn_sqlite__bindf(stmt, "is", pdh->wcroot->wc_id, base));
+ SVN_ERR(svn_sqlite__step_done(stmt));
+#ifdef NODE_DATA
+ SVN_ERR(svn_sqlite__get_statement(&stmt, pdh->wcroot->sdb,
+ STMT_DELETE_NODE_DATA_WORKING));
+ SVN_ERR(svn_sqlite__bindf(stmt, "is", pdh->wcroot->wc_id, base));
SVN_ERR(svn_sqlite__step_done(stmt));
+#endif
}
SVN_ERR(svn_sqlite__get_statement(&stmt, pdh->wcroot->sdb,
STMT_UPDATE_BASE_PRESENCE_KIND));
-
SVN_ERR(svn_sqlite__bindf(stmt, "istt", pdh->wcroot->wc_id, base,
presence_map, svn_wc__db_status_normal,
kind_map, svn_wc__db_kind_subdir));
+#ifdef NODE_DATA
+ /* When activating this bit, I get test failures;
+ working copies seem to get disconnected from their parents...
+ Need to investigate */
+ SVN_ERR(svn_sqlite__get_statement(&stmt, pdh->wcroot->sdb,
+ STMT_UPDATE_NODE_BASE_PRESENCE_KIND));
+ SVN_ERR(svn_sqlite__bindf(stmt, "istt", pdh->wcroot->wc_id, base,
+ presence_map, svn_wc__db_status_normal,
+ kind_map, svn_wc__db_kind_subdir));
+#endif
+
SVN_ERR(svn_sqlite__update(&affected_rows, stmt));
@@ -9155,20 +9605,26 @@ set_new_dir_to_incomplete_baton_txn(void
/* Delete the working node */
SVN_ERR(svn_sqlite__get_statement(&stmt, dtb->pdh->wcroot->sdb,
STMT_DELETE_WORKING_NODE));
-
SVN_ERR(svn_sqlite__bindf(stmt, "is", dtb->pdh->wcroot->wc_id,
dtb->local_relpath));
-
SVN_ERR(svn_sqlite__step_done(stmt));
/* Delete the base node if there is a not present one */
SVN_ERR(svn_sqlite__get_statement(&stmt, dtb->pdh->wcroot->sdb,
STMT_DELETE_BASE_NODE));
-
SVN_ERR(svn_sqlite__bindf(stmt, "is", dtb->pdh->wcroot->wc_id,
dtb->local_relpath));
+ SVN_ERR(svn_sqlite__step_done(stmt));
+#ifdef SVN_WC__NODE_DATA
+ /* Delete the base and working node data */
+ SVN_ERR(svn_sqlite__get_statement(&stmt, dtb->pdh->wcroot->sdb,
+ STMT_DELETE_NODE_DATA_LAYERS));
+ SVN_ERR(svn_sqlite__bindf(stmt, "isi", dtb->pdh->wcroot->wc_id,
+ dtb->local_relpath,
+ (apr_int64_t)0));
SVN_ERR(svn_sqlite__step_done(stmt));
+#endif
/* Insert the incomplete base node */
Modified: subversion/branches/atomic-revprop/subversion/libsvn_wc/wc_db.h
URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/libsvn_wc/wc_db.h?rev=967221&r1=967220&r2=967221&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/subversion/libsvn_wc/wc_db.h (original)
+++ subversion/branches/atomic-revprop/subversion/libsvn_wc/wc_db.h Fri Jul 23 19:37:19 2010
@@ -2099,6 +2099,7 @@ svn_wc__db_upgrade_apply_dav_cache(svn_s
*/
svn_error_t *
svn_wc__db_upgrade_apply_props(svn_sqlite__db_t *sdb,
+ const char *dir_abspath,
const char *local_relpath,
apr_hash_t *base_props,
apr_hash_t *revert_props,
Modified: subversion/branches/atomic-revprop/subversion/libsvn_wc/workqueue.c
URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/libsvn_wc/workqueue.c?rev=967221&r1=967220&r2=967221&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/subversion/libsvn_wc/workqueue.c (original)
+++ subversion/branches/atomic-revprop/subversion/libsvn_wc/workqueue.c Fri Jul 23 19:37:19 2010
@@ -59,6 +59,8 @@
#define OP_DELETE "delete"
#define OP_FILE_INSTALL "file-install"
#define OP_FILE_REMOVE "file-remove"
+#define OP_FILE_MOVE "file-move"
+#define OP_FILE_COPY_TRANSLATED "file-translate"
#define OP_SYNC_FILE_FLAGS "sync-file-flags"
#define OP_PREJ_INSTALL "prej-install"
#define OP_WRITE_OLD_PROPS "write-old-props"
@@ -75,6 +77,7 @@ struct work_item_dispatch {
const char *name;
svn_error_t *(*func)(svn_wc__db_t *db,
const svn_skel_t *work_item,
+ const char *wri_abspath,
svn_cancel_func_t cancel_func,
void *cancel_baton,
apr_pool_t *scratch_pool);
@@ -204,6 +207,7 @@ maybe_remove_conflict(const char *parent
static svn_error_t *
run_revert(svn_wc__db_t *db,
const svn_skel_t *work_item,
+ const char *wri_abspath,
svn_cancel_func_t cancel_func,
void *cancel_baton,
apr_pool_t *scratch_pool)
@@ -578,6 +582,7 @@ svn_wc__wq_add_revert(svn_boolean_t *wil
static svn_error_t *
run_prepare_revert_files(svn_wc__db_t *db,
const svn_skel_t *work_item,
+ const char *wri_abspath,
svn_cancel_func_t cancel_func,
void *cancel_baton,
apr_pool_t *scratch_pool)
@@ -664,6 +669,7 @@ svn_wc__wq_prepare_revert_files(svn_wc__
static svn_error_t *
run_killme(svn_wc__db_t *db,
const svn_skel_t *work_item,
+ const char *wri_abspath,
svn_cancel_func_t cancel_func,
void *cancel_baton,
apr_pool_t *scratch_pool)
@@ -789,6 +795,7 @@ svn_wc__wq_add_killme(svn_wc__db_t *db,
static svn_error_t *
run_loggy(svn_wc__db_t *db,
const svn_skel_t *work_item,
+ const char *wri_abspath,
svn_cancel_func_t cancel_func,
void *cancel_baton,
apr_pool_t *scratch_pool)
@@ -841,6 +848,7 @@ svn_wc__wq_build_loggy(svn_skel_t **work
static svn_error_t *
run_deletion_postcommit(svn_wc__db_t *db,
const svn_skel_t *work_item,
+ const char *wri_abspath,
svn_cancel_func_t cancel_func,
void *cancel_baton,
apr_pool_t *scratch_pool)
@@ -1059,7 +1067,11 @@ install_committed_file(svn_boolean_t *ov
* it has the right executable and read_write attributes set.
*/
- SVN_ERR(svn_wc__get_special(&special, db, file_abspath, scratch_pool));
+ SVN_ERR(svn_wc__get_translate_info(NULL, NULL,
+ NULL,
+ &special,
+ db, file_abspath,
+ scratch_pool, scratch_pool));
if (! special && tmp != tmp_wfile)
SVN_ERR(svn_io_files_contents_same_p(&same, tmp_wfile,
file_abspath, scratch_pool));
@@ -1419,6 +1431,7 @@ log_do_committed(svn_wc__db_t *db,
static svn_error_t *
run_postcommit(svn_wc__db_t *db,
const svn_skel_t *work_item,
+ const char *wri_abspath,
svn_cancel_func_t cancel_func,
void *cancel_baton,
apr_pool_t *scratch_pool)
@@ -1561,6 +1574,7 @@ svn_wc__wq_add_postcommit(svn_wc__db_t *
static svn_error_t *
run_install_properties(svn_wc__db_t *db,
const svn_skel_t *work_item,
+ const char *wri_abspath,
svn_cancel_func_t cancel_func,
void *cancel_baton,
apr_pool_t *scratch_pool)
@@ -1670,6 +1684,7 @@ svn_wc__wq_add_install_properties(svn_wc
static svn_error_t *
run_delete(svn_wc__db_t *db,
const svn_skel_t *work_item,
+ const char *wri_abspath,
svn_cancel_func_t cancel_func,
void *cancel_baton,
apr_pool_t *scratch_pool)
@@ -1754,6 +1769,7 @@ svn_wc__wq_add_delete(svn_wc__db_t *db,
static svn_error_t *
run_file_install(svn_wc__db_t *db,
const svn_skel_t *work_item,
+ const char *wri_abspath,
svn_cancel_func_t cancel_func,
void *cancel_baton,
apr_pool_t *scratch_pool)
@@ -1793,7 +1809,11 @@ run_file_install(svn_wc__db_t *db,
scratch_pool, scratch_pool));
}
- SVN_ERR(svn_wc__get_special(&special, db, local_abspath, scratch_pool));
+ /* Fetch all the translation bits. */
+ SVN_ERR(svn_wc__get_translate_info(&style, &eol,
+ &keywords,
+ &special, db, local_abspath,
+ scratch_pool, scratch_pool));
if (special)
{
/* When this stream is closed, the resulting special file will
@@ -1811,12 +1831,6 @@ run_file_install(svn_wc__db_t *db,
return SVN_NO_ERROR;
}
- /* Fetch all the translation bits. */
- SVN_ERR(svn_wc__get_eol_style(&style, &eol, db, local_abspath,
- scratch_pool, scratch_pool));
- SVN_ERR(svn_wc__get_keywords(&keywords, db, local_abspath, NULL,
- scratch_pool, scratch_pool));
-
if (svn_subst_translation_required(style, eol, keywords,
FALSE /* special */,
TRUE /* force_eol_check */))
@@ -1932,6 +1946,7 @@ svn_wc__wq_build_file_install(svn_skel_t
static svn_error_t *
run_file_remove(svn_wc__db_t *db,
const svn_skel_t *work_item,
+ const char *wri_abspath,
svn_cancel_func_t cancel_func,
void *cancel_baton,
apr_pool_t *scratch_pool)
@@ -1963,6 +1978,165 @@ svn_wc__wq_build_file_remove(svn_skel_t
return SVN_NO_ERROR;
}
+/* ------------------------------------------------------------------------ */
+
+/* OP_FILE_MOVE */
+
+/* Process the OP_FILE_MOVE work item WORK_ITEM.
+ * See svn_wc__wq_build_file_move() which generates this work item.
+ * Implements (struct work_item_dispatch).func. */
+static svn_error_t *
+run_file_move(svn_wc__db_t *db,
+ const svn_skel_t *work_item,
+ const char *wri_abspath,
+ svn_cancel_func_t cancel_func,
+ void *cancel_baton,
+ apr_pool_t *scratch_pool)
+{
+ const svn_skel_t *arg1 = work_item->children->next;
+ const char *src_abspath, *dst_abspath;
+ svn_error_t *err;
+
+ src_abspath = apr_pstrmemdup(scratch_pool, arg1->data, arg1->len);
+ dst_abspath = apr_pstrmemdup(scratch_pool, arg1->next->data,
+ arg1->next->len);
+
+ /* Use svn_io_file_move() instead of svn_io_file_rename() to allow cross
+ device copies. We should not fail in the workqueue. */
+
+ err = svn_io_file_move(src_abspath, dst_abspath, scratch_pool);
+
+ /* If the source is not found, we assume the wq op is already handled */
+ if (err && (APR_STATUS_IS_ENOENT(err->apr_err)
+ || APR_STATUS_IS_ENODIR(err->apr_err)))
+ svn_error_clear(err);
+ else
+ SVN_ERR(err);
+
+ return SVN_NO_ERROR;
+}
+
+
+svn_error_t *
+svn_wc__wq_build_file_move(svn_skel_t **work_item,
+ svn_wc__db_t *db,
+ const char *src_abspath,
+ const char *dst_abspath,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
+{
+ svn_node_kind_t kind;
+ *work_item = svn_skel__make_empty_list(result_pool);
+
+ SVN_ERR_ASSERT(svn_dirent_is_absolute(src_abspath));
+ SVN_ERR_ASSERT(svn_dirent_is_absolute(dst_abspath));
+
+ /* File must exist */
+ SVN_ERR(svn_io_check_path(src_abspath, &kind, result_pool));
+
+ if (kind == svn_node_none)
+ return svn_error_createf(SVN_ERR_WC_PATH_NOT_FOUND, NULL,
+ _("'%s' not found"),
+ svn_dirent_local_style(src_abspath,
+ scratch_pool));
+
+ /* ### Once we move to a central DB we should try making
+ ### src_abspath and dst_abspath relative from the WCROOT. */
+
+ svn_skel__prepend_str(apr_pstrdup(result_pool, dst_abspath),
+ *work_item, result_pool);
+ svn_skel__prepend_str(apr_pstrdup(result_pool, src_abspath),
+ *work_item, result_pool);
+ svn_skel__prepend_str(OP_FILE_MOVE, *work_item, result_pool);
+
+ return SVN_NO_ERROR;
+}
+
+/* ------------------------------------------------------------------------ */
+
+/* OP_FILE_COPY_TRANSLATED */
+
+/* Process the OP_FILE_COPY_TRANSLATED work item WORK_ITEM.
+ * See run_file_copy_translated() which generates this work item.
+ * Implements (struct work_item_dispatch).func. */
+static svn_error_t *
+run_file_copy_translated(svn_wc__db_t *db,
+ const svn_skel_t *work_item,
+ const char *wri_abspath,
+ svn_cancel_func_t cancel_func,
+ void *cancel_baton,
+ apr_pool_t *scratch_pool)
+{
+ const svn_skel_t *arg1 = work_item->children->next;
+ const char *local_abspath, *src_abspath, *dst_abspath;
+ svn_subst_eol_style_t style;
+ const char *eol;
+ apr_hash_t *keywords;
+ svn_boolean_t special;
+
+ local_abspath = apr_pstrmemdup(scratch_pool, arg1->data, arg1->len);
+ src_abspath = apr_pstrmemdup(scratch_pool, arg1->next->data,
+ arg1->next->len);
+ dst_abspath = apr_pstrmemdup(scratch_pool, arg1->next->next->data,
+ arg1->next->next->len);
+
+ SVN_ERR(svn_wc__get_translate_info(&style, &eol,
+ &keywords,
+ &special,
+ db, local_abspath,
+ scratch_pool, scratch_pool));
+
+ SVN_ERR(svn_subst_copy_and_translate4(src_abspath, dst_abspath,
+ eol, TRUE /* repair */,
+ keywords, TRUE /* expand */,
+ special,
+ cancel_func, cancel_baton,
+ scratch_pool));
+
+ return SVN_NO_ERROR;
+}
+
+
+svn_error_t *
+svn_wc__wq_build_file_copy_translated(svn_skel_t **work_item,
+ svn_wc__db_t *db,
+ const char *local_abspath,
+ const char *src_abspath,
+ const char *dst_abspath,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
+{
+ svn_node_kind_t kind;
+ *work_item = svn_skel__make_empty_list(result_pool);
+
+ SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
+ SVN_ERR_ASSERT(svn_dirent_is_absolute(src_abspath));
+ SVN_ERR_ASSERT(svn_dirent_is_absolute(dst_abspath));
+
+ /* File must exist */
+ SVN_ERR(svn_io_check_path(src_abspath, &kind, result_pool));
+
+ if (kind == svn_node_none)
+ return svn_error_createf(SVN_ERR_WC_PATH_NOT_FOUND, NULL,
+ _("'%s' not found"),
+ svn_dirent_local_style(src_abspath,
+ scratch_pool));
+
+ /* ### Once we move to a central DB we should try making
+ ### src_abspath, dst_abspath and info_abspath relative from
+ ### the WCROOT of info_abspath. */
+
+ svn_skel__prepend_str(apr_pstrdup(result_pool, dst_abspath),
+ *work_item, result_pool);
+ svn_skel__prepend_str(apr_pstrdup(result_pool, src_abspath),
+ *work_item, result_pool);
+ svn_skel__prepend_str(apr_pstrdup(result_pool, local_abspath),
+ *work_item, result_pool);
+ svn_skel__prepend_str(OP_FILE_COPY_TRANSLATED, *work_item, result_pool);
+
+ return SVN_NO_ERROR;
+}
+
/* ------------------------------------------------------------------------ */
@@ -1974,6 +2148,7 @@ svn_wc__wq_build_file_remove(svn_skel_t
static svn_error_t *
run_sync_file_flags(svn_wc__db_t *db,
const svn_skel_t *work_item,
+ const char *wri_abspath,
svn_cancel_func_t cancel_func,
void *cancel_baton,
apr_pool_t *scratch_pool)
@@ -2011,6 +2186,7 @@ svn_wc__wq_build_sync_file_flags(svn_ske
static svn_error_t *
run_prej_install(svn_wc__db_t *db,
const svn_skel_t *work_item,
+ const char *wri_abspath,
svn_cancel_func_t cancel_func,
void *cancel_baton,
apr_pool_t *scratch_pool)
@@ -2079,6 +2255,7 @@ svn_wc__wq_build_prej_install(svn_skel_t
static svn_error_t *
run_write_old_props(svn_wc__db_t *db,
const svn_skel_t *work_item,
+ const char *wri_abspath,
svn_cancel_func_t cancel_func,
void *cancel_baton,
apr_pool_t *scratch_pool)
@@ -2157,15 +2334,40 @@ svn_wc__wq_build_write_old_props(svn_ske
static svn_error_t *
run_record_fileinfo(svn_wc__db_t *db,
const svn_skel_t *work_item,
+ const char *wri_abspath,
svn_cancel_func_t cancel_func,
void *cancel_baton,
apr_pool_t *scratch_pool)
{
const svn_skel_t *arg1 = work_item->children->next;
const char *local_abspath;
+ apr_time_t set_time = 0;
local_abspath = apr_pstrmemdup(scratch_pool, arg1->data, arg1->len);
+ if (arg1->next)
+ set_time = svn_skel__parse_int(arg1->next, scratch_pool);
+
+ if (set_time != 0)
+ {
+ svn_node_kind_t kind;
+ svn_boolean_t is_special;
+
+ /* Do not set the timestamp on special files. */
+ SVN_ERR(svn_io_check_special_path(local_abspath, &kind, &is_special,
+ scratch_pool));
+
+ /* Don't set affected time when local_abspath does not exist or is
+ a special file */
+ if (kind == svn_node_file && !is_special)
+ SVN_ERR(svn_io_set_file_affected_time(set_time, local_abspath,
+ scratch_pool));
+
+ /* Note that we can't use the value we get here for recording as the
+ filesystem might have a different timestamp granularity */
+ }
+
+
return svn_error_return(get_and_record_fileinfo(db, local_abspath,
TRUE /* ignore_enoent */,
scratch_pool));
@@ -2175,12 +2377,16 @@ run_record_fileinfo(svn_wc__db_t *db,
svn_error_t *
svn_wc__wq_build_record_fileinfo(svn_skel_t **work_item,
const char *local_abspath,
+ apr_time_t set_time,
apr_pool_t *result_pool)
{
*work_item = svn_skel__make_empty_list(result_pool);
SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
+ if (set_time)
+ svn_skel__prepend_int(set_time, *work_item, result_pool);
+
svn_skel__prepend_str(apr_pstrdup(result_pool, local_abspath),
*work_item, result_pool);
svn_skel__prepend_str(OP_RECORD_FILEINFO, *work_item, result_pool);
@@ -2196,6 +2402,7 @@ svn_wc__wq_build_record_fileinfo(svn_ske
static svn_error_t *
run_set_text_conflict_markers(svn_wc__db_t *db,
const svn_skel_t *work_item,
+ const char *wri_abspath,
svn_cancel_func_t cancel_func,
void *cancel_baton,
apr_pool_t *scratch_pool)
@@ -2268,6 +2475,7 @@ svn_wc__wq_tmp_build_set_text_conflict_m
static svn_error_t *
run_set_property_conflict_marker(svn_wc__db_t *db,
const svn_skel_t *work_item,
+ const char *wri_abspath,
svn_cancel_func_t cancel_func,
void *cancel_baton,
apr_pool_t *scratch_pool)
@@ -2346,6 +2554,7 @@ pristine_get_translated(svn_wc__db_t *db
static svn_error_t *
run_pristine_get_translated(svn_wc__db_t *db,
const svn_skel_t *work_item,
+ const char *wri_abspath,
svn_cancel_func_t cancel_func,
void *cancel_baton,
apr_pool_t *scratch_pool)
@@ -2409,6 +2618,8 @@ static const struct work_item_dispatch d
{ OP_DELETE, run_delete },
{ OP_FILE_INSTALL, run_file_install },
{ OP_FILE_REMOVE, run_file_remove },
+ { OP_FILE_MOVE, run_file_move },
+ { OP_FILE_COPY_TRANSLATED, run_file_copy_translated },
{ OP_SYNC_FILE_FLAGS, run_sync_file_flags },
{ OP_PREJ_INSTALL, run_prej_install },
{ OP_WRITE_OLD_PROPS, run_write_old_props },
@@ -2446,7 +2657,7 @@ dispatch_work_item(svn_wc__db_t *db,
#ifdef DEBUG_WORK_QUEUE
SVN_DBG(("dispatch: operation='%s'\n", scan->name));
#endif
- SVN_ERR((*scan->func)(db, work_item,
+ SVN_ERR((*scan->func)(db, work_item, wri_abspath,
cancel_func, cancel_baton,
scratch_pool));
break;
Modified: subversion/branches/atomic-revprop/subversion/libsvn_wc/workqueue.h
URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/libsvn_wc/workqueue.h?rev=967221&r1=967220&r2=967221&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/subversion/libsvn_wc/workqueue.h (original)
+++ subversion/branches/atomic-revprop/subversion/libsvn_wc/workqueue.h Fri Jul 23 19:37:19 2010
@@ -122,6 +122,33 @@ svn_wc__wq_build_file_remove(svn_skel_t
apr_pool_t *result_pool,
apr_pool_t *scratch_pool);
+/* Set *WORK_ITEM to a new work item that describes a moves of
+ a file or directory from SRC_ABSPATH to DST_ABSPATH, ready for
+ storing in the working copy managing DST_ABSPATH.
+
+ Perform temporary allocations in SCRATCH_POOL and *WORK_ITEM in
+ RESULT_POOL.
+*/
+svn_error_t *
+svn_wc__wq_build_file_move(svn_skel_t **work_item,
+ svn_wc__db_t *db,
+ const char *src_abspath,
+ const char *dst_abspath,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool);
+
+/* Set *WORK_ITEM to a new work item that describes a copy from
+ SRC_ABSPATH to DST_ABSPATH, while translating the stream using
+ the information from LOCAL_ABSPATH. */
+svn_error_t *
+svn_wc__wq_build_file_copy_translated(svn_skel_t **work_item,
+ svn_wc__db_t *db,
+ const char *local_abspath,
+ const char *src_abspath,
+ const char *dst_abspath,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool);
+
/* Set *WORK_ITEM to a new work item that will synchronize the
target node's readonly and executable flags with the values defined
@@ -162,10 +189,14 @@ svn_wc__wq_build_write_old_props(svn_ske
LOCAL_ABSPATH into the TRANSLATED_SIZE and LAST_MOD_TIME of the node via
the svn_wc__db_global_record_fileinfo() function.
+ If SET_TIME is not 0, set LOCAL_ABSPATH's last modified time to this
+ time and after that record the actual file time.
+
### it is unclear whether this should survive. */
svn_error_t *
svn_wc__wq_build_record_fileinfo(svn_skel_t **work_item,
const char *local_abspath,
+ apr_time_t set_time,
apr_pool_t *result_pool);
Modified: subversion/branches/atomic-revprop/subversion/svn/add-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/svn/add-cmd.c?rev=967221&r1=967220&r2=967221&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/subversion/svn/add-cmd.c (original)
+++ subversion/branches/atomic-revprop/subversion/svn/add-cmd.c Fri Jul 23 19:37:19 2010
@@ -29,11 +29,13 @@
#define APR_WANT_STDIO
#include <apr_want.h>
+#include "svn_path.h"
#include "svn_client.h"
#include "svn_error.h"
#include "svn_pools.h"
#include "cl.h"
+#include "svn_private_config.h"
/*** Code. ***/
@@ -48,7 +50,7 @@ svn_cl__add(apr_getopt_t *os,
svn_client_ctx_t *ctx = ((svn_cl__cmd_baton_t *) baton)->ctx;
apr_array_header_t *targets;
int i;
- apr_pool_t *subpool;
+ apr_pool_t *iterpool;
SVN_ERR(svn_cl__args_to_target_array_print_reserved(&targets, os,
opt_state->targets,
@@ -57,33 +59,42 @@ svn_cl__add(apr_getopt_t *os,
if (! targets->nelts)
return svn_error_create(SVN_ERR_CL_INSUFFICIENT_ARGS, 0, NULL);
- if (! opt_state->quiet)
- SVN_ERR(svn_cl__get_notifier(&ctx->notify_func2, &ctx->notify_baton2,
- FALSE, pool));
-
if (opt_state->depth == svn_depth_unknown)
opt_state->depth = svn_depth_infinity;
SVN_ERR(svn_cl__eat_peg_revisions(&targets, targets, pool));
- subpool = svn_pool_create(pool);
+ /* Don't even attempt to modify the working copy if any of the
+ * targets look like URLs. URLs are invalid input. */
+ for (i = 0; i < targets->nelts; i++)
+ {
+ const char *target = APR_ARRAY_IDX(targets, i, const char *);
+
+ if (svn_path_is_url(target))
+ return svn_error_return(svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR,
+ NULL,
+ _("'%s' is not a local path"),
+ target));
+ }
+
+ iterpool = svn_pool_create(pool);
for (i = 0; i < targets->nelts; i++)
{
const char *target = APR_ARRAY_IDX(targets, i, const char *);
- svn_pool_clear(subpool);
+ svn_pool_clear(iterpool);
SVN_ERR(svn_cl__check_cancel(ctx->cancel_baton));
SVN_ERR(svn_cl__try
(svn_client_add4(target,
opt_state->depth,
opt_state->force, opt_state->no_ignore,
- opt_state->parents, ctx, subpool),
+ opt_state->parents, ctx, iterpool),
NULL, opt_state->quiet,
SVN_ERR_ENTRY_EXISTS,
SVN_ERR_WC_PATH_NOT_FOUND,
SVN_NO_ERROR));
}
- svn_pool_destroy(subpool);
+ svn_pool_destroy(iterpool);
return SVN_NO_ERROR;
}
Modified: subversion/branches/atomic-revprop/subversion/svn/changelist-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/svn/changelist-cmd.c?rev=967221&r1=967220&r2=967221&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/subversion/svn/changelist-cmd.c (original)
+++ subversion/branches/atomic-revprop/subversion/svn/changelist-cmd.c Fri Jul 23 19:37:19 2010
@@ -24,6 +24,7 @@
#include "svn_client.h"
#include "svn_error_codes.h"
#include "svn_error.h"
+#include "svn_path.h"
#include "svn_utf.h"
#include "cl.h"
@@ -44,6 +45,7 @@ svn_cl__changelist(apr_getopt_t *os,
svn_client_ctx_t *ctx = ((svn_cl__cmd_baton_t *) baton)->ctx;
apr_array_header_t *targets;
svn_depth_t depth = opt_state->depth;
+ int i;
/* If we're not removing changelists, then our first argument should
be the name of a changelist. */
@@ -70,10 +72,20 @@ svn_cl__changelist(apr_getopt_t *os,
if (! targets->nelts)
return svn_error_create(SVN_ERR_CL_INSUFFICIENT_ARGS, 0, NULL);
- if (! opt_state->quiet)
- SVN_ERR(svn_cl__get_notifier(&ctx->notify_func2, &ctx->notify_baton2,
- FALSE, pool));
- else
+ /* Don't even attempt to modify the working copy if any of the
+ * targets look like URLs. URLs are invalid input. */
+ for (i = 0; i < targets->nelts; i++)
+ {
+ const char *target = APR_ARRAY_IDX(targets, i, const char *);
+
+ if (svn_path_is_url(target))
+ return svn_error_return(svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR,
+ NULL,
+ _("'%s' is not a local path"),
+ target));
+ }
+
+ if (opt_state->quiet)
/* FIXME: This is required because svn_client_create_context()
always initializes ctx->notify_func2 to a wrapper function
which calls ctx->notify_func() if it isn't NULL. In other
Modified: subversion/branches/atomic-revprop/subversion/svn/checkout-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/svn/checkout-cmd.c?rev=967221&r1=967220&r2=967221&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/subversion/svn/checkout-cmd.c (original)
+++ subversion/branches/atomic-revprop/subversion/svn/checkout-cmd.c Fri Jul 23 19:37:19 2010
@@ -113,11 +113,7 @@ svn_cl__checkout(apr_getopt_t *os,
}
if (! opt_state->quiet)
- {
- SVN_ERR(svn_cl__get_notifier(&ctx->notify_func2, &ctx->notify_baton2,
- FALSE, pool));
- SVN_ERR(svn_cl__notifier_mark_checkout(ctx->notify_baton2));
- }
+ SVN_ERR(svn_cl__notifier_mark_checkout(ctx->notify_baton2));
subpool = svn_pool_create(pool);
for (i = 0; i < targets->nelts - 1; ++i)
Modified: subversion/branches/atomic-revprop/subversion/svn/cl.h
URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/svn/cl.h?rev=967221&r1=967220&r2=967221&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/subversion/svn/cl.h (original)
+++ subversion/branches/atomic-revprop/subversion/svn/cl.h Fri Jul 23 19:37:19 2010
@@ -357,9 +357,13 @@ svn_cl__conflict_handler(svn_wc_conflict
/* Print out commit information found in COMMIT_INFO to the console.
* POOL is used for temporay allocations.
* COMMIT_INFO should not be NULL.
+ *
+ * This function implements svn_commit_callback2_t.
*/
svn_error_t *
-svn_cl__print_commit_info(svn_commit_info_t *commit_info, apr_pool_t *pool);
+svn_cl__print_commit_info(const svn_commit_info_t *commit_info,
+ void *baton,
+ apr_pool_t *pool);
/* Convert the date in DATA to a human-readable UTF-8-encoded string
Modified: subversion/branches/atomic-revprop/subversion/svn/cleanup-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/svn/cleanup-cmd.c?rev=967221&r1=967220&r2=967221&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/subversion/svn/cleanup-cmd.c (original)
+++ subversion/branches/atomic-revprop/subversion/svn/cleanup-cmd.c Fri Jul 23 19:37:19 2010
@@ -28,10 +28,12 @@
/*** Includes. ***/
#include "svn_client.h"
+#include "svn_path.h"
#include "svn_pools.h"
#include "svn_error.h"
#include "cl.h"
+#include "svn_private_config.h"
/*** Code. ***/
@@ -55,6 +57,19 @@ svn_cl__cleanup(apr_getopt_t *os,
/* Add "." if user passed 0 arguments */
svn_opt_push_implicit_dot_target(targets, pool);
+ /* Don't even attempt to modify the working copy if any of the
+ * targets look like URLs. URLs are invalid input. */
+ for (i = 0; i < targets->nelts; i++)
+ {
+ const char *target = APR_ARRAY_IDX(targets, i, const char *);
+
+ if (svn_path_is_url(target))
+ return svn_error_return(svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR,
+ NULL,
+ _("'%s' is not a local path"),
+ target));
+ }
+
SVN_ERR(svn_cl__eat_peg_revisions(&targets, targets, pool));
subpool = svn_pool_create(pool);
Modified: subversion/branches/atomic-revprop/subversion/svn/commit-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/svn/commit-cmd.c?rev=967221&r1=967220&r2=967221&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/subversion/svn/commit-cmd.c (original)
+++ subversion/branches/atomic-revprop/subversion/svn/commit-cmd.c Fri Jul 23 19:37:19 2010
@@ -38,6 +38,7 @@
#include "svn_config.h"
#include "cl.h"
+#include "svn_private_config.h"
/* This implements the `svn_opt_subcommand_t' interface. */
@@ -54,7 +55,6 @@ svn_cl__commit(apr_getopt_t *os,
const char *base_dir;
svn_config_t *cfg;
svn_boolean_t no_unlock = FALSE;
- svn_commit_info_t *commit_info = NULL;
int i;
SVN_ERR(svn_cl__args_to_target_array_print_reserved(&targets, os,
@@ -66,9 +66,10 @@ svn_cl__commit(apr_getopt_t *os,
{
const char *target = APR_ARRAY_IDX(targets, i, const char *);
if (svn_path_is_url(target))
- return svn_error_create(SVN_ERR_WC_BAD_PATH, NULL,
- "Must give local path (not URL) as the "
- "target of a commit");
+ return svn_error_return(
+ svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
+ _("'%s' is a URL, but URLs cannot be "
+ "commit targets"), target));
}
/* Add "." if user passed 0 arguments. */
@@ -93,10 +94,6 @@ svn_cl__commit(apr_getopt_t *os,
base_dir = apr_pstrdup(pool, parent_dir);
}
- if (! opt_state->quiet)
- SVN_ERR(svn_cl__get_notifier(&ctx->notify_func2, &ctx->notify_baton2,
- FALSE, pool));
-
if (opt_state->depth == svn_depth_unknown)
opt_state->depth = svn_depth_infinity;
@@ -116,8 +113,7 @@ svn_cl__commit(apr_getopt_t *os,
ctx->config, pool));
/* Commit. */
- err = svn_client_commit4(&commit_info,
- targets,
+ err = svn_client_commit5(targets,
opt_state->depth,
no_unlock,
opt_state->keep_changelists,
@@ -140,8 +136,6 @@ svn_cl__commit(apr_getopt_t *os,
}
}
SVN_ERR(svn_cl__cleanup_log_msg(ctx->log_msg_baton3, err, pool));
- if (! err && ! opt_state->quiet)
- SVN_ERR(svn_cl__print_commit_info(commit_info, pool));
return SVN_NO_ERROR;
}
Modified: subversion/branches/atomic-revprop/subversion/svn/copy-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/svn/copy-cmd.c?rev=967221&r1=967220&r2=967221&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/subversion/svn/copy-cmd.c (original)
+++ subversion/branches/atomic-revprop/subversion/svn/copy-cmd.c Fri Jul 23 19:37:19 2010
@@ -48,7 +48,6 @@ svn_cl__copy(apr_getopt_t *os,
apr_array_header_t *targets, *sources;
const char *src_path, *dst_path;
svn_boolean_t srcs_are_urls, dst_is_url;
- svn_commit_info_t *commit_info = NULL;
svn_error_t *err;
int i;
@@ -90,9 +89,6 @@ svn_cl__copy(apr_getopt_t *os,
if ((! srcs_are_urls) && (! dst_is_url))
{
/* WC->WC */
- if (! opt_state->quiet)
- SVN_ERR(svn_cl__get_notifier(&ctx->notify_func2, &ctx->notify_baton2,
- FALSE, pool));
}
else if ((! srcs_are_urls) && (dst_is_url))
{
@@ -114,18 +110,18 @@ svn_cl__copy(apr_getopt_t *os,
display like: "Adding dir1/foo-copy.c", which could be a
bogus path.
*/
+ ctx->notify_func2 = NULL;
}
else if ((srcs_are_urls) && (! dst_is_url))
{
/* URL->WC : Use checkout-style notification. */
- if (! opt_state->quiet)
- {
- SVN_ERR(svn_cl__get_notifier(&ctx->notify_func2, &ctx->notify_baton2,
- FALSE, pool));
- SVN_ERR(svn_cl__notifier_mark_checkout(ctx->notify_baton2));
- }
+ SVN_ERR(svn_cl__notifier_mark_checkout(ctx->notify_baton2));
+ }
+ else
+ {
+ /* URL -> URL, meaning that no notification is needed. */
+ ctx->notify_func2 = NULL;
}
- /* else URL -> URL, meaning that no notification is needed. */
if (! dst_is_url)
{
@@ -141,7 +137,7 @@ svn_cl__copy(apr_getopt_t *os,
SVN_ERR(svn_cl__make_log_msg_baton(&(ctx->log_msg_baton3), opt_state,
NULL, ctx->config, pool));
- err = svn_client_copy5(&commit_info, sources, dst_path, TRUE,
+ err = svn_client_copy6(sources, dst_path, TRUE,
opt_state->parents, opt_state->ignore_externals,
opt_state->revprop_table, ctx, pool);
@@ -150,8 +146,5 @@ svn_cl__copy(apr_getopt_t *os,
else if (err)
return svn_error_return(err);
- if (commit_info && ! opt_state->quiet)
- SVN_ERR(svn_cl__print_commit_info(commit_info, pool));
-
return SVN_NO_ERROR;
}
Modified: subversion/branches/atomic-revprop/subversion/svn/delete-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/svn/delete-cmd.c?rev=967221&r1=967220&r2=967221&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/subversion/svn/delete-cmd.c (original)
+++ subversion/branches/atomic-revprop/subversion/svn/delete-cmd.c Fri Jul 23 19:37:19 2010
@@ -46,7 +46,6 @@ svn_cl__delete(apr_getopt_t *os,
svn_cl__opt_state_t *opt_state = ((svn_cl__cmd_baton_t *) baton)->opt_state;
svn_client_ctx_t *ctx = ((svn_cl__cmd_baton_t *) baton)->ctx;
apr_array_header_t *targets;
- svn_commit_info_t *commit_info = NULL;
svn_error_t *err;
SVN_ERR(svn_cl__args_to_target_array_print_reserved(&targets, os,
@@ -56,10 +55,6 @@ svn_cl__delete(apr_getopt_t *os,
if (! targets->nelts)
return svn_error_create(SVN_ERR_CL_INSUFFICIENT_ARGS, 0, NULL);
- if (! opt_state->quiet)
- SVN_ERR(svn_cl__get_notifier(&ctx->notify_func2, &ctx->notify_baton2,
- FALSE, pool));
-
if (! svn_path_is_url(APR_ARRAY_IDX(targets, 0, const char *)))
{
ctx->log_msg_func3 = NULL;
@@ -79,9 +74,8 @@ svn_cl__delete(apr_getopt_t *os,
SVN_ERR(svn_cl__eat_peg_revisions(&targets, targets, pool));
- err = svn_client_delete3(&commit_info, targets, opt_state->force,
- opt_state->keep_local, opt_state->revprop_table,
- ctx, pool);
+ err = svn_client_delete4(targets, opt_state->force, opt_state->keep_local,
+ opt_state->revprop_table, ctx, pool);
if (err)
err = svn_cl__may_need_force(err);
@@ -90,8 +84,5 @@ svn_cl__delete(apr_getopt_t *os,
else if (err)
return svn_error_return(err);
- if (commit_info && ! opt_state->quiet)
- SVN_ERR(svn_cl__print_commit_info(commit_info, pool));
-
return SVN_NO_ERROR;
}
Modified: subversion/branches/atomic-revprop/subversion/svn/export-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/svn/export-cmd.c?rev=967221&r1=967220&r2=967221&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/subversion/svn/export-cmd.c (original)
+++ subversion/branches/atomic-revprop/subversion/svn/export-cmd.c Fri Jul 23 19:37:19 2010
@@ -34,6 +34,7 @@
#include "cl.h"
#include "svn_private_config.h"
+#include "private/svn_opt_private.h"
/*** Code. ***/
@@ -81,14 +82,13 @@ svn_cl__export(apr_getopt_t *os,
/* If given the cwd, pretend we weren't given anything. */
if (strcmp("", to) == 0)
to = svn_path_uri_decode(svn_uri_basename(truefrom, pool), pool);
+ else
+ /* svn_cl__eat_peg_revisions() but only on one target */
+ SVN_ERR(svn_opt__split_arg_at_peg_revision(&to, NULL, to, pool));
}
if (! opt_state->quiet)
- {
- SVN_ERR(svn_cl__get_notifier(&ctx->notify_func2, &ctx->notify_baton2,
- FALSE, pool));
- SVN_ERR(svn_cl__notifier_mark_export(ctx->notify_baton2));
- }
+ SVN_ERR(svn_cl__notifier_mark_export(ctx->notify_baton2));
if (opt_state->depth == svn_depth_unknown)
opt_state->depth = svn_depth_infinity;
Modified: subversion/branches/atomic-revprop/subversion/svn/import-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/svn/import-cmd.c?rev=967221&r1=967220&r2=967221&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/subversion/svn/import-cmd.c (original)
+++ subversion/branches/atomic-revprop/subversion/svn/import-cmd.c Fri Jul 23 19:37:19 2010
@@ -48,7 +48,6 @@ svn_cl__import(apr_getopt_t *os,
apr_array_header_t *targets;
const char *path;
const char *url;
- svn_commit_info_t *commit_info = NULL;
/* Import takes two arguments, for example
*
@@ -106,10 +105,6 @@ svn_cl__import(apr_getopt_t *os,
(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
_("Invalid URL '%s'"), url);
- if (! opt_state->quiet)
- SVN_ERR(svn_cl__get_notifier(&ctx->notify_func2, &ctx->notify_baton2,
- FALSE, pool));
-
if (opt_state->depth == svn_depth_unknown)
opt_state->depth = svn_depth_infinity;
@@ -118,8 +113,7 @@ svn_cl__import(apr_getopt_t *os,
SVN_ERR(svn_cl__cleanup_log_msg
(ctx->log_msg_baton3,
- svn_client_import3(&commit_info,
- path,
+ svn_client_import4(path,
url,
opt_state->depth,
opt_state->no_ignore,
@@ -128,8 +122,5 @@ svn_cl__import(apr_getopt_t *os,
ctx,
pool), pool));
- if (commit_info && ! opt_state->quiet)
- SVN_ERR(svn_cl__print_commit_info(commit_info, pool));
-
return SVN_NO_ERROR;
}
Modified: subversion/branches/atomic-revprop/subversion/svn/lock-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/svn/lock-cmd.c?rev=967221&r1=967220&r2=967221&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/subversion/svn/lock-cmd.c (original)
+++ subversion/branches/atomic-revprop/subversion/svn/lock-cmd.c Fri Jul 23 19:37:19 2010
@@ -101,9 +101,6 @@ svn_cl__lock(apr_getopt_t *os,
/* Get comment. */
SVN_ERR(get_comment(&comment, ctx, opt_state, pool));
- SVN_ERR(svn_cl__get_notifier(&ctx->notify_func2, &ctx->notify_baton2, FALSE,
- pool));
-
SVN_ERR(svn_cl__eat_peg_revisions(&targets, targets, pool));
return svn_client_lock(targets, comment, opt_state->force, ctx, pool);
Modified: subversion/branches/atomic-revprop/subversion/svn/log-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/svn/log-cmd.c?rev=967221&r1=967220&r2=967221&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/subversion/svn/log-cmd.c (original)
+++ subversion/branches/atomic-revprop/subversion/svn/log-cmd.c Fri Jul 23 19:37:19 2010
@@ -637,7 +637,7 @@ svn_cl__log(apr_getopt_t *os,
}
}
- /* Strip peg revision if targets contains an URI. */
+ /* Strip peg revision. */
SVN_ERR(svn_opt_parse_path(&peg_revision, &true_path, target, pool));
APR_ARRAY_IDX(targets, 0, const char *) = true_path;
@@ -663,10 +663,6 @@ svn_cl__log(apr_getopt_t *os,
lb.merge_stack = apr_array_make(pool, 0, sizeof(svn_revnum_t));
lb.pool = pool;
- if (! opt_state->quiet)
- SVN_ERR(svn_cl__get_notifier(&ctx->notify_func2, &ctx->notify_baton2,
- FALSE, pool));
-
if (opt_state->xml)
{
/* If output is not incremental, output the XML header and wrap
Modified: subversion/branches/atomic-revprop/subversion/svn/main.c
URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/svn/main.c?rev=967221&r1=967220&r2=967221&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/subversion/svn/main.c (original)
+++ subversion/branches/atomic-revprop/subversion/svn/main.c Fri Jul 23 19:37:19 2010
@@ -463,8 +463,8 @@ const svn_opt_subcommand_desc2_t svn_cl_
{ "changelist", svn_cl__changelist, {"cl"}, N_
("Associate (or dissociate) changelist CLNAME with the named files.\n"
- "usage: 1. changelist CLNAME TARGET...\n"
- " 2. changelist --remove TARGET...\n"),
+ "usage: 1. changelist CLNAME PATH...\n"
+ " 2. changelist --remove PATH...\n"),
{ 'q', 'R', opt_depth, opt_remove, opt_targets, opt_changelist} },
{ "checkout", svn_cl__checkout, {"co"}, N_
@@ -497,7 +497,7 @@ const svn_opt_subcommand_desc2_t svn_cl_
{ "cleanup", svn_cl__cleanup, {0}, N_
("Recursively clean up the working copy, removing locks, resuming\n"
"unfinished operations, etc.\n"
- "usage: cleanup [PATH...]\n"),
+ "usage: cleanup [WCPATH...]\n"),
{opt_merge_cmd} },
{ "commit", svn_cl__commit, {"ci"},
@@ -662,15 +662,18 @@ const svn_opt_subcommand_desc2_t svn_cl_
{opt_force_log, N_("force validity of lock comment source")}} },
{ "log", svn_cl__log, {0}, N_
- ("Show the log messages for a set of revision(s) and/or file(s).\n"
- "usage: 1. log [PATH]\n"
+ ("Show the log messages for a set of revision(s) and/or path(s).\n"
+ "usage: 1. log [PATH][@REV]\n"
" 2. log URL[@REV] [PATH...]\n"
"\n"
- " 1. Print the log messages for a local PATH (default: '.').\n"
- " The default revision range is BASE:1.\n"
+ " 1. Print the log messages for the URL corresponding to PATH\n"
+ " (default: '.'). If specified, REV is the revision in which the\n"
+ " URL is first looked up, and the default revision range is REV:1.\n"
+ " If REV is not specified, the default revision range is BASE:1,\n"
+ " since the URL might not exist in the HEAD revision.\n"
"\n"
" 2. Print the log messages for the PATHs (default: '.') under URL.\n"
- " If specified, REV determines in which revision the URL is first\n"
+ " If specified, REV is the revision in which the URL is first\n"
" looked up, and the default revision range is REV:1; otherwise,\n"
" the URL is looked up in HEAD, and the default revision range is\n"
" HEAD:1.\n"
@@ -691,8 +694,10 @@ const svn_opt_subcommand_desc2_t svn_cl_
" Examples:\n"
" svn log\n"
" svn log foo.c\n"
+ " svn log bar.c@42\n"
" svn log http://www.example.com/repo/project/foo.c\n"
- " svn log http://www.example.com/repo/project foo.c bar.c\n"),
+ " svn log http://www.example.com/repo/project foo.c bar.c\n"
+ " svn log http://www.example.com/repo/project@50 foo.c bar.c\n"),
{'r', 'q', 'v', 'g', 'c', opt_targets, opt_stop_on_copy, opt_incremental,
opt_xml, 'l', opt_with_all_revprops, opt_with_no_revprops, opt_with_revprop,
opt_show_diff, opt_diff_cmd, opt_internal_diff, 'x'},
@@ -1184,7 +1189,7 @@ const svn_opt_subcommand_desc2_t svn_cl_
{ "upgrade", svn_cl__upgrade, {0}, N_
("Upgrade the metadata storage format for a working copy.\n"
- "usage: upgrade TARGET...\n"),
+ "usage: upgrade WCPATH...\n"),
{0} },
{ NULL, NULL, {0}, NULL, {0} }
@@ -2213,6 +2218,20 @@ main(int argc, const char *argv[])
subcommands will populate the ctx->log_msg_baton3. */
ctx->log_msg_func3 = svn_cl__get_log_message;
+ /* Set up the notifier. */
+ if (((subcommand->cmd_func != svn_cl__status) && !opt_state.quiet)
+ || ((subcommand->cmd_func == svn_cl__status) && !opt_state.xml))
+ {
+ err = svn_cl__get_notifier(&ctx->notify_func2, &ctx->notify_baton2,
+ FALSE, pool);
+ if (err)
+ return svn_cmdline_handle_exit_error(err, pool, "svn: ");
+ }
+
+ /* Set up our commit callback. We leave the callback NULL. */
+ if (!opt_state.quiet)
+ ctx->commit_callback2 = svn_cl__print_commit_info;
+
/* Set up our cancellation support. */
ctx->cancel_func = svn_cl__check_cancel;
apr_signal(SIGINT, signal_handler);
Modified: subversion/branches/atomic-revprop/subversion/svn/merge-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/svn/merge-cmd.c?rev=967221&r1=967220&r2=967221&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/subversion/svn/merge-cmd.c (original)
+++ subversion/branches/atomic-revprop/subversion/svn/merge-cmd.c Fri Jul 23 19:37:19 2010
@@ -271,10 +271,6 @@ svn_cl__merge(apr_getopt_t *os,
}
}
- if (! opt_state->quiet)
- SVN_ERR(svn_cl__get_notifier(&ctx->notify_func2, &ctx->notify_baton2,
- FALSE, pool));
-
if (opt_state->extensions)
options = svn_cstring_split(opt_state->extensions, " \t\n\r", TRUE, pool);
else