You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ph...@apache.org on 2009/11/25 17:27:42 UTC
svn commit: r884179 - in /subversion/trunk/subversion/libsvn_wc:
update_editor.c wc_db.c
Author: philip
Date: Wed Nov 25 16:27:42 2009
New Revision: 884179
URL: http://svn.apache.org/viewvc?rev=884179&view=rev
Log:
Remove a use of svn_wc__entry_modify2.
* subversion/libsvn_wc/update_editor.c
(absent_file_or_dir): Use svn_wc__db_base_add_absent_node.
* subversion/libsvn_wc/wc_db.c
(svn_wc__db_base_add_absent_node): Flush entries.
Modified:
subversion/trunk/subversion/libsvn_wc/update_editor.c
subversion/trunk/subversion/libsvn_wc/wc_db.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=884179&r1=884178&r2=884179&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/update_editor.c (original)
+++ subversion/trunk/subversion/libsvn_wc/update_editor.c Wed Nov 25 16:27:42 2009
@@ -3196,15 +3196,17 @@
const char *local_abspath;
struct dir_baton *pb = parent_baton;
struct edit_baton *eb = pb->edit_baton;
- svn_wc_entry_t tmp_entry;
- svn_boolean_t in_parent = (kind == svn_node_dir);
+ const char *repos_relpath;
+ const char *repos_root_url;
+ const char *repos_uuid;
local_abspath = svn_dirent_join(pb->local_abspath, name, pool);
+
/* Extra check: an item by this name may not exist, but there may
still be one scheduled for addition. That's a genuine
tree-conflict. */
-
{
+ svn_boolean_t in_parent = (kind == svn_node_dir);
const svn_wc_entry_t *entry;
svn_boolean_t hidden;
SVN_ERR(svn_wc__get_entry(&entry, eb->db, local_abspath, TRUE, kind,
@@ -3222,31 +3224,18 @@
svn_dirent_local_style(path, pool));
}
- /* Immediately create an entry for the new item in the parent. Note
- that the parent must already be either added or opened, and thus
- it's in an 'incomplete' state just like the new item. */
- tmp_entry.kind = kind;
-
- /* Note that there may already exist a 'ghost' entry in the parent
- with the same name, in a 'deleted' state. If so, it's fine to
- overwrite it... but we need to make sure we get rid of the
- 'deleted' flag when doing so: */
- tmp_entry.deleted = FALSE;
+ SVN_ERR(svn_wc__db_scan_base_repos(&repos_relpath, &repos_root_url,
+ &repos_uuid, eb->db, pb->local_abspath,
+ pool, pool));
+ repos_relpath = svn_dirent_join(repos_relpath, name, pool);
+
+ SVN_ERR(svn_wc__db_base_add_absent_node
+ (eb->db, local_abspath,
+ repos_relpath, repos_root_url, repos_uuid, *(eb->target_revision),
+ kind == svn_node_dir ? svn_wc__db_kind_dir : svn_wc__db_kind_file,
+ svn_wc__db_status_absent, pool));
- /* Post-update processing knows to leave this entry if its revision
- is equal to the target revision of the overall update. */
- tmp_entry.revision = *(eb->target_revision);
-
- /* And, of course, marking as absent is the whole point. */
- tmp_entry.absent = TRUE;
-
- return svn_wc__entry_modify2(eb->db, local_abspath, kind, in_parent,
- &tmp_entry,
- (SVN_WC__ENTRY_MODIFY_KIND |
- SVN_WC__ENTRY_MODIFY_REVISION |
- SVN_WC__ENTRY_MODIFY_DELETED |
- SVN_WC__ENTRY_MODIFY_ABSENT),
- pool);
+ return SVN_NO_ERROR;
}
Modified: subversion/trunk/subversion/libsvn_wc/wc_db.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.c?rev=884179&r1=884178&r2=884179&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.c Wed Nov 25 16:27:42 2009
@@ -1845,7 +1845,10 @@
### or maybe let caller deal with that, if there is a possibility
### of a node kind change (rather than eat an extra lookup here). */
- return insert_base_node(&ibb, pdh->wcroot->sdb, scratch_pool);
+ SVN_ERR(insert_base_node(&ibb, pdh->wcroot->sdb, scratch_pool));
+ flush_entries(pdh);
+
+ return SVN_NO_ERROR;
}
Re: svn commit: r884179 - in /subversion/trunk/subversion/libsvn_wc: update_editor.c wc_db.c
Posted by "Hyrum K. Wright" <hy...@mail.utexas.edu>.
On Nov 25, 2009, at 10:27 AM, philip@apache.org wrote:
> Author: philip
> Date: Wed Nov 25 16:27:42 2009
> New Revision: 884179
>
> URL: http://svn.apache.org/viewvc?rev=884179&view=rev
> Log:
> Remove a use of svn_wc__entry_modify2.
>
> * subversion/libsvn_wc/update_editor.c
> (absent_file_or_dir): Use svn_wc__db_base_add_absent_node.
>
> * subversion/libsvn_wc/wc_db.c
> (svn_wc__db_base_add_absent_node): Flush entries.
>
> Modified:
> subversion/trunk/subversion/libsvn_wc/update_editor.c
> subversion/trunk/subversion/libsvn_wc/wc_db.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=884179&r1=884178&r2=884179&view=diff
> ==============================================================================
> --- subversion/trunk/subversion/libsvn_wc/update_editor.c (original)
> +++ subversion/trunk/subversion/libsvn_wc/update_editor.c Wed Nov 25 16:27:42 2009
> @@ -3196,15 +3196,17 @@
> const char *local_abspath;
> struct dir_baton *pb = parent_baton;
> struct edit_baton *eb = pb->edit_baton;
> - svn_wc_entry_t tmp_entry;
> - svn_boolean_t in_parent = (kind == svn_node_dir);
> + const char *repos_relpath;
> + const char *repos_root_url;
> + const char *repos_uuid;
>
> local_abspath = svn_dirent_join(pb->local_abspath, name, pool);
> +
> /* Extra check: an item by this name may not exist, but there may
> still be one scheduled for addition. That's a genuine
> tree-conflict. */
> -
> {
> + svn_boolean_t in_parent = (kind == svn_node_dir);
> const svn_wc_entry_t *entry;
> svn_boolean_t hidden;
> SVN_ERR(svn_wc__get_entry(&entry, eb->db, local_abspath, TRUE, kind,
> @@ -3222,31 +3224,18 @@
> svn_dirent_local_style(path, pool));
> }
>
> - /* Immediately create an entry for the new item in the parent. Note
> - that the parent must already be either added or opened, and thus
> - it's in an 'incomplete' state just like the new item. */
> - tmp_entry.kind = kind;
> -
> - /* Note that there may already exist a 'ghost' entry in the parent
> - with the same name, in a 'deleted' state. If so, it's fine to
> - overwrite it... but we need to make sure we get rid of the
> - 'deleted' flag when doing so: */
> - tmp_entry.deleted = FALSE;
> + SVN_ERR(svn_wc__db_scan_base_repos(&repos_relpath, &repos_root_url,
> + &repos_uuid, eb->db, pb->local_abspath,
> + pool, pool));
> + repos_relpath = svn_dirent_join(repos_relpath, name, pool);
> +
> + SVN_ERR(svn_wc__db_base_add_absent_node
Style nit: we use no-space-before-paren these days. :)
> + (eb->db, local_abspath,
> + repos_relpath, repos_root_url, repos_uuid, *(eb->target_revision),
> + kind == svn_node_dir ? svn_wc__db_kind_dir : svn_wc__db_kind_file,
> + svn_wc__db_status_absent, pool));
>
> - /* Post-update processing knows to leave this entry if its revision
> - is equal to the target revision of the overall update. */
> - tmp_entry.revision = *(eb->target_revision);
> -
> - /* And, of course, marking as absent is the whole point. */
> - tmp_entry.absent = TRUE;
> -
> - return svn_wc__entry_modify2(eb->db, local_abspath, kind, in_parent,
> - &tmp_entry,
> - (SVN_WC__ENTRY_MODIFY_KIND |
> - SVN_WC__ENTRY_MODIFY_REVISION |
> - SVN_WC__ENTRY_MODIFY_DELETED |
> - SVN_WC__ENTRY_MODIFY_ABSENT),
> - pool);
> + return SVN_NO_ERROR;
> }
>
>
>
> Modified: subversion/trunk/subversion/libsvn_wc/wc_db.c
> URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.c?rev=884179&r1=884178&r2=884179&view=diff
> ==============================================================================
> --- subversion/trunk/subversion/libsvn_wc/wc_db.c (original)
> +++ subversion/trunk/subversion/libsvn_wc/wc_db.c Wed Nov 25 16:27:42 2009
> @@ -1845,7 +1845,10 @@
> ### or maybe let caller deal with that, if there is a possibility
> ### of a node kind change (rather than eat an extra lookup here). */
>
> - return insert_base_node(&ibb, pdh->wcroot->sdb, scratch_pool);
> + SVN_ERR(insert_base_node(&ibb, pdh->wcroot->sdb, scratch_pool));
> + flush_entries(pdh);
> +
> + return SVN_NO_ERROR;
> }
>
>
>
>