Author: rhuijben
Date: Sun Dec 15 00:22:03 2013
New Revision: 1550986
URL: http://svn.apache.org/r1550986
Log:
Following up on r1550985, move the call of calculate_new relpath
to the function that creates the baton.
* subversion/libsvn_wc/update_editor.c
(make_dir_baton): Remove call.
(make_file_baton): Remove call and unused variable.
(open_root): Always obtain base information if shadowed *before*
calling calculate_new_relpath.
(add_directory): Call calculate_new_relpath after make_dir_baton.
(open_directory): Call calculate_new_relpath after reading info.
(add_file): Call calculate_new_relpath after make_file_baton.
(open_file): Call calculate_new_relpath after reading info.
Modified:
subversion/trunk/subversion/libsvn_wc/update_editor.c
Modified: subversion/trunk/subversion/libsvn_wc/update_editor.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/update_editor.c?rev=1550986&r1=1550985&r2=1550986&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/update_editor.c (original)
+++ subversion/trunk/subversion/libsvn_wc/update_editor.c Sun Dec 15 00:22:03
2013
@@ -608,9 +608,6 @@ make_dir_baton(struct dir_baton **d_p,
d->local_abspath = eb->anchor_abspath;
}
- SVN_ERR(calculate_new_relpath(&d->new_relpath, eb->db, d->local_abspath,
adding,
- eb, pb, dir_pool, scratch_pool));
-
d->edit_baton = eb;
d->parent_baton = pb;
d->pool = dir_pool;
@@ -790,7 +787,6 @@ make_file_baton(struct file_baton **f_p,
svn_boolean_t adding,
apr_pool_t *scratch_pool)
{
- struct edit_baton *eb = pb->edit_baton;
apr_pool_t *file_pool = svn_pool_create(pb->pool);
struct file_baton *f = apr_pcalloc(file_pool, sizeof(*f));
@@ -802,9 +798,6 @@ make_file_baton(struct file_baton **f_p,
SVN_ERR(path_join_under_root(&f->local_abspath,
pb->local_abspath, f->name, file_pool));
- SVN_ERR(calculate_new_relpath(&f->new_relpath, eb->db, f->local_abspath,
adding,
- eb, pb, file_pool, scratch_pool));
-
f->pool = file_pool;
f->edit_baton = pb->edit_baton;
f->propchanges = apr_array_make(file_pool, 1, sizeof(svn_prop_t));
@@ -1231,21 +1224,29 @@ open_root(void *edit_baton,
}
else if (have_work)
{
+ SVN_ERR(svn_wc__db_base_get_info(&base_status, NULL,
+ &db->old_revision,
+ &db->old_repos_relpath, NULL, NULL,
+ &db->changed_rev, &db->changed_date,
+ &db->changed_author,
+ &db->ambient_depth,
+ NULL, NULL, NULL, NULL, NULL, NULL,
+ eb->db, db->local_abspath,
+ db->pool, pool));
+ }
+ else
+ base_status = status;
+
+ SVN_ERR(calculate_new_relpath(&db->new_relpath, eb->db, db->local_abspath,
+ FALSE, eb, NULL, db->pool, pool));
+
+ if (have_work)
+ {
const char *move_src_root_abspath;
SVN_ERR(svn_wc__db_base_moved_to(NULL, NULL, &move_src_root_abspath,
NULL, eb->db, db->local_abspath,
pool, pool));
- if (move_src_root_abspath || *eb->target_basename == '\0')
- SVN_ERR(svn_wc__db_base_get_info(&base_status, NULL,
- &db->old_revision,
- &db->old_repos_relpath, NULL, NULL,
- &db->changed_rev, &db->changed_date,
- &db->changed_author,
- &db->ambient_depth,
- NULL, NULL, NULL, NULL, NULL, NULL,
- eb->db, db->local_abspath,
- db->pool, pool));
if (move_src_root_abspath)
{
@@ -1285,8 +1286,6 @@ open_root(void *edit_baton,
db->shadowed = TRUE; /* Needed for the close_directory() on the root, to
make sure it doesn't use the ACTUAL tree */
}
- else
- base_status = status;
if (*eb->target_basename == '\0')
{
@@ -1998,6 +1997,8 @@ add_directory(const char *path,
SVN_ERR_ASSERT(! (copyfrom_path || SVN_IS_VALID_REVNUM(copyfrom_rev)));
SVN_ERR(make_dir_baton(&db, path, eb, pb, TRUE, pool));
+ SVN_ERR(calculate_new_relpath(&db->new_relpath, eb->db, db->local_abspath,
+ TRUE, eb, pb, db->pool, pool));
*child_baton = db;
if (db->skip_this)
@@ -2412,6 +2413,9 @@ open_directory(const char *path,
db->was_incomplete = (base_status == svn_wc__db_status_incomplete);
+ SVN_ERR(calculate_new_relpath(&db->new_relpath, eb->db, db->local_abspath,
+ FALSE, eb, pb, db->pool, pool));
+
/* Is this path a conflict victim? */
if (db->shadowed)
conflicted = FALSE; /* Conflict applies to WORKING */
@@ -3154,6 +3158,8 @@ add_file(const char *path,
SVN_ERR_ASSERT(! (copyfrom_path || SVN_IS_VALID_REVNUM(copyfrom_rev)));
SVN_ERR(make_file_baton(&fb, pb, path, TRUE, pool));
+ SVN_ERR(calculate_new_relpath(&fb->new_relpath, eb->db, fb->local_abspath,
+ TRUE, eb, pb, fb->pool, pool));
*file_baton = fb;
if (fb->skip_this)
@@ -3536,6 +3542,9 @@ open_file(const char *path,
eb->db, fb->local_abspath,
fb->pool, scratch_pool));
+ SVN_ERR(calculate_new_relpath(&fb->new_relpath, eb->db, fb->local_abspath,
+ FALSE, eb, pb, fb->pool, scratch_pool));
+
/* Is this path a conflict victim? */
if (fb->shadowed)
conflicted = FALSE; /* Conflict applies to WORKING */