You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2011/08/24 13:24:15 UTC
svn commit: r1161051 - /subversion/trunk/subversion/libsvn_wc/update_editor.c
Author: stsp
Date: Wed Aug 24 11:24:15 2011
New Revision: 1161051
URL: http://svn.apache.org/viewvc?rev=1161051&view=rev
Log:
Follow-up to r1161046:
* subversion/libsvn_wc/update_editor.c
(make_file_baton): Do not run read_info() and scan_deletion() here.
The extra read_info() call is a performance concern.
This means that callers will have to initialise the file baton's
MOVED_TO_ABSPATH member.
(open_file): This code already runs read_info(), so query the existing
status value and initialise the file baton's MOVED_TO_ABSPATH if needed.
Suggested by: rhuijben
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=1161051&r1=1161050&r2=1161051&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/update_editor.c (original)
+++ subversion/trunk/subversion/libsvn_wc/update_editor.c Wed Aug 24 11:24:15 2011
@@ -780,8 +780,6 @@ make_file_baton(struct file_baton **f_p,
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));
- svn_wc__db_status_t status;
- svn_error_t *err;
SVN_ERR_ASSERT(path);
@@ -791,25 +789,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));
- /* If the file has moved locally remember the new location. */
- err = svn_wc__db_read_info(&status, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- pb->edit_baton->db,
- f->local_abspath, scratch_pool, scratch_pool);
- if (err)
- {
- if (err->apr_err == SVN_ERR_WC_PATH_NOT_FOUND)
- svn_error_clear(err);
- else
- return svn_error_trace(err);
- }
- else if (status == svn_wc__db_status_deleted)
- SVN_ERR(svn_wc__db_scan_deletion(NULL, &f->moved_to_abspath, NULL, NULL,
- pb->edit_baton->db, f->local_abspath,
- file_pool, scratch_pool));
-
/* Figure out the new URL for this file. */
if (eb->switch_relpath)
{
@@ -3355,6 +3334,12 @@ open_file(const char *path,
eb->db, fb->local_abspath,
fb->pool, scratch_pool));
+ /* If the file has moved locally look up its new location. */
+ if (status == svn_wc__db_status_deleted)
+ SVN_ERR(svn_wc__db_scan_deletion(NULL, &fb->moved_to_abspath, NULL, NULL,
+ eb->db, fb->local_abspath,
+ fb->pool, scratch_pool));
+
/* Is this path a conflict victim? */
if (conflicted)
SVN_ERR(node_already_conflicted(&conflicted, eb->db,