Author: rhuijben
Date: Mon Apr 18 14:27:30 2011
New Revision: 1094589
URL: http://svn.apache.org/viewvc?rev=1094589&view=rev
Log:
In the update editor: Move the sticky depth update from where we complete the
directory to where we close the directory. This makes the code cleaner and
atomic and avoids two transactions for this case.
Reviewers: This code was not, and is not evaluated for an anchor directory
above the update target.
* subversion/libsvn_wc/update_editor.c
(complete_directory): Move depth update code from here to ...
(close_directory): ... here, where we update the database anyway.
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=1094589&r1=1094588&r2=1094589&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/update_editor.c (original)
+++ subversion/trunk/subversion/libsvn_wc/update_editor.c Mon Apr 18 14:27:30
2011
@@ -709,41 +709,6 @@ complete_directory(struct edit_baton *eb
/* Mark THIS_DIR complete. */
SVN_ERR(svn_wc__db_temp_op_end_directory_update(eb->db, local_abspath,
scratch_pool));
-
- if (eb->depth_is_sticky)
- {
- svn_depth_t depth;
-
- /* ### obsolete comment?
- ### We should specifically check BASE_NODE here and then only remove
- the BASE_NODE if there is a WORKING_NODE. */
-
- SVN_ERR(svn_wc__db_base_get_info(NULL, NULL, NULL,
- NULL, NULL, NULL,
- NULL, NULL, NULL,
- &depth, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL,
- eb->db, local_abspath,
- scratch_pool, scratch_pool));
-
- if (depth != eb->requested_depth)
- {
- /* After a depth upgrade the entry must reflect the new depth.
- Upgrading to infinity changes the depth of *all* directories,
- upgrading to something else only changes the target. */
-
- if (eb->requested_depth == svn_depth_infinity
- || (strcmp(local_abspath, eb->target_abspath) == 0
- && eb->requested_depth > depth))
- {
- SVN_ERR(svn_wc__db_temp_op_set_dir_depth(eb->db,
- local_abspath,
- eb->requested_depth,
- scratch_pool));
- }
- }
- }
-
return SVN_NO_ERROR;
}
@@ -2635,6 +2600,21 @@ close_directory(void *dir_baton,
if (depth == svn_depth_unknown)
depth = svn_depth_infinity;
+ if (eb->depth_is_sticky
+ && depth != eb->requested_depth)
+ {
+ /* After a depth upgrade the entry must reflect the new depth.
+ Upgrading to infinity changes the depth of *all* directories,
+ upgrading to something else only changes the target. */
+
+ if (eb->requested_depth == svn_depth_infinity
+ || (strcmp(db->local_abspath, eb->target_abspath) == 0
+ && eb->requested_depth > depth))
+ {
+ depth = eb->requested_depth;
+ }
+ }
+
/* Do we have new properties to install? Or shall we simply retain
the prior set of properties? If we're installing new properties,
then we also want to write them to an old-style props file. */