When doing "svn up", lock the anchor with write lock, and the traget
with treelock. but if anchor is working copy root or the target is
missing, lock the anchor with treelock.
The checking could be simplified if the accumulative locking API is
implemented.
* lisvn_client/update.c
(svn_client__update): narrow down the scope of tree lock if possible.
Index: subversion/libsvn_client/update.c
===================================================================
--- subversion/libsvn_client/update.c (revision 6432)
+++ subversion/libsvn_client/update.c (working copy)
@@ -55,17 +55,23 @@
svn_error_t *err;
svn_revnum_t revnum;
svn_wc_traversal_info_t *traversal_info = svn_wc_init_traversal_info (pool);
- svn_wc_adm_access_t *adm_access;
+ svn_wc_adm_access_t *adm_access, *target_access;
svn_boolean_t sleep_here = FALSE;
svn_boolean_t *use_sleep = timestamp_sleep ? timestamp_sleep : &sleep_here;
const char *diff3_cmd;
+ svn_node_kind_t kind;
/* Sanity check. Without this, the update is meaningless. */
assert (path);
/* Use PATH to get the update's anchor and targets and get a write lock */
SVN_ERR (svn_wc_get_actual_target (path, &anchor, &target, pool));
- SVN_ERR (svn_wc_adm_open (&adm_access, NULL, anchor, TRUE, TRUE, pool));
+ SVN_ERR (svn_io_check_path (path, &kind, pool));
+ SVN_ERR (svn_wc_adm_open (&adm_access, NULL, anchor, TRUE,
+ target && (kind != svn_node_none) ? FALSE : TRUE,
+ pool));
+ SVN_ERR (svn_wc_adm_probe_try (&target_access, adm_access, path,
+ TRUE, TRUE, pool));
/* Get full URL from the ANCHOR. */
SVN_ERR (svn_wc_entry (&entry, anchor, adm_access, FALSE, pool));
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Jul 11 20:42:30 2003