svn commit: r1152436 - in /subversion/trunk/subversion: libsvn_wc/entries.c libsvn_wc/info.c libsvn_wc/node.c libsvn_wc/wc-queries.sql libsvn_wc/wc_db.c libsvn_wc/wc_db.h tests/libsvn_wc/db-test.c

2011-07-30 Thread stsp
Author: stsp
Date: Sat Jul 30 09:22:14 2011
New Revision: 1152436

URL: http://svn.apache.org/viewvc?rev=1152436view=rev
Log:
Fixed version of the change originally committed in r1152345 and
reverted again in r1152348:

Extend svn_wc__db_scan_deletion() to return the moved-to path of
of a moved node, if requested, in MOVED_TO_ABSPATH.

This function previously returned the op-root of the copied-half of the
move as MOVED_TO_ABSPATH, but (luckily) none of the callers requested it.
Return the op-root in a new output parameter COPY_OP_ROOT_ABSPATH instead.

* subversion/libsvn_wc/wc_db.c
  (scan_deletion_baton_t): Add COPY_OP_ROOT_RELPATH.
  (scan_deletion_txn): If the node has been moved-away, compute
   and return the moved-to relpath as well as the the op-root of
   the copied-half of the move.
   Also, do not assert that every node being moved has a BASE.
   This isn't true for sequences like: mv A B; mv B/f B/e;
   In the second move, B/f has no BASE because it is part of the
   copied-half B of the first move.
  (scan_deletion): Add new output parameter COPY_OP_ROOT_RELPATH and
   pass it into the scan_deletion baton.
  (get_info_for_copy, read_url_txn, svn_wc__db_global_relocate): Update
   scan_deletion() callers, passing NULL for COPY_OP_ROOT_RELPATH.
  (svn_wc__db_scan_deletion): Add new output parameter COPY_OP_ROOT_ABSPATH.
   Convert relative paths in moved-to information provided by scan_deletion()
   into absolute paths, and return them.

* subversion/libsvn_wc/wc_db.h
  (svn_wc__db_scan_deletion): Add COPY_OP_ROOT_ABSPATH parameter and update
   the docstring.

* subversion/libsvn_wc/wc-queries.sql
  (STMT_SELECT_DELETION_INFO): Get moved-to information from the BASE since
   it is stored there as of r1152410.

* subversion/libsvn_wc/node.c
  (svn_wc__internal_get_repos_info, svn_wc__node_get_deleted_ancestor,
   svn_wc__internal_get_commit_base_rev, svn_wc__internal_node_get_schedule):
Update callers, passing NULL for COPY_OP_ROOT_ABSPATH.

* subversion/libsvn_wc/entries.c
  (get_info_for_deleted, read_one_entry): Update callers, passing NULL
   for COPY_OP_ROOT_ABSPATH.

* subversion/libsvn_wc/info.c
  (build_info_for_node): Update caller, passing NULL for COPY_OP_ROOT_ABSPATH.

* subversion/tests/libsvn_wc/db-test.c
  (TESTING_DATA): Put moved-to data into BASE layer. Add some missing
   move-target nodes that are needed by scan_deletion() to properly resolve
   moved-to information.
  (test_scan_deletion): Update callers, verify COPY_OP_ROOT_ABSPATH where
   a move is being resolved, else pass NULL for COPY_OP_ROOT_ABSPATH.

Modified:
subversion/trunk/subversion/libsvn_wc/entries.c
subversion/trunk/subversion/libsvn_wc/info.c
subversion/trunk/subversion/libsvn_wc/node.c
subversion/trunk/subversion/libsvn_wc/wc-queries.sql
subversion/trunk/subversion/libsvn_wc/wc_db.c
subversion/trunk/subversion/libsvn_wc/wc_db.h
subversion/trunk/subversion/tests/libsvn_wc/db-test.c

Modified: subversion/trunk/subversion/libsvn_wc/entries.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/entries.c?rev=1152436r1=1152435r2=1152436view=diff
==
--- subversion/trunk/subversion/libsvn_wc/entries.c (original)
+++ subversion/trunk/subversion/libsvn_wc/entries.c Sat Jul 30 09:22:14 2011
@@ -272,7 +272,7 @@ get_info_for_deleted(svn_wc_entry_t *ent
 
  SVN_ERR(svn_wc__db_scan_deletion(NULL,
   NULL,
-  work_del_abspath,
+  work_del_abspath, NULL,
   db, entry_abspath,
   scratch_pool, scratch_pool));
 
@@ -525,7 +525,7 @@ read_one_entry(const svn_wc_entry_t **ne
 {
   const char *work_del_abspath;
   SVN_ERR(svn_wc__db_scan_deletion(NULL, NULL,
-   work_del_abspath,
+   work_del_abspath, NULL,
db, entry_abspath,
scratch_pool, scratch_pool));
 

Modified: subversion/trunk/subversion/libsvn_wc/info.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/info.c?rev=1152436r1=1152435r2=1152436view=diff
==
--- subversion/trunk/subversion/libsvn_wc/info.c (original)
+++ subversion/trunk/subversion/libsvn_wc/info.c Sat Jul 30 09:22:14 2011
@@ -200,7 +200,7 @@ build_info_for_node(svn_wc__info2_t **in
 
   /* And now fetch the url and revision of what will be deleted */
   SVN_ERR(svn_wc__db_scan_deletion(NULL, NULL,
-   work_del_abspath,
+   work_del_abspath, NULL,
db, local_abspath,
 

svn propchange: r1152345 - svn:log

2011-07-30 Thread stsp
Author: stsp
Revision: 1152345
Modified property: svn:log

Modified: svn:log at Sat Jul 30 09:24:16 2011
--
--- svn:log (original)
+++ svn:log Sat Jul 30 09:24:16 2011
@@ -1,3 +1,6 @@
+[ Note from the future: This change wasn't actually ready for commit yet.
+  It was reverted in r1152348, and a fixed version was committed in r1152436. ]
+
 Extend svn_wc__db_scan_deletion() to return the moved-to path of
 of a moved node, if requested, in MOVED_TO_ABSPATH.
 



svn commit: r1152447 - in /subversion/trunk/subversion: include/private/svn_wc_private.h libsvn_wc/node.c

2011-07-30 Thread stsp
Author: stsp
Date: Sat Jul 30 10:47:39 2011
New Revision: 1152447

URL: http://svn.apache.org/viewvc?rev=1152447view=rev
Log:
Add a new libsvn_wc API function: svn_wc__node_was_moved_away().

* subversion/include/private/svn_wc_private.h
   (svn_wc__node_was_moved_away): Declare.

* subversion/libsvn_wc/node.c
   (svn_wc__node_was_moved_away): New. Provides the MOVED_TO_ABSPATH of
a node that was moved-away, as well the COPY_OP_ROOT_ABSPATH of the
copy-half of the move.

Modified:
subversion/trunk/subversion/include/private/svn_wc_private.h
subversion/trunk/subversion/libsvn_wc/node.c

Modified: subversion/trunk/subversion/include/private/svn_wc_private.h
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/include/private/svn_wc_private.h?rev=1152447r1=1152446r2=1152447view=diff
==
--- subversion/trunk/subversion/include/private/svn_wc_private.h (original)
+++ subversion/trunk/subversion/include/private/svn_wc_private.h Sat Jul 30 
10:47:39 2011
@@ -1127,6 +1127,24 @@ svn_wc__delete_internal(svn_wc_context_t
 void *notify_baton,
 apr_pool_t *scratch_pool);
 
+/* If the node at LOCAL_ABSPATH was moved away set *MOVED_TO_ABSPATH to
+ * the absolute path of the copied move-target node, and *COPY_OP_ROOT_ABSPATH
+ * to the absolute path of the root node of the copy operation.
+ *
+ * If the node was not moved, set *MOVED_TO_ABSPATH and *COPY_OP_ROOT_ABSPATH
+ * to NULL.
+ *
+ * Either MOVED_TO_ABSPATH or OP_ROOT_ABSPATH may be NULL to indicate
+ * that the caller is not interested in the result.
+ */
+svn_error_t *
+svn_wc__node_was_moved_away(const char **moved_to_abspath,
+const char **copy_op_root_abspath,
+svn_wc_context_t *wc_ctx,
+const char *local_abspath,
+apr_pool_t *result_pool,
+apr_pool_t *scratch_pool);
+
 /* If the node at LOCAL_ABSPATH was moved here set *MOVED_FROM_ABSPATH to
  * the absolute path of the deleted move-source node, and set
  * *DELETE_OP_ROOT_ABSPATH to the absolute path of the root node of the

Modified: subversion/trunk/subversion/libsvn_wc/node.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/node.c?rev=1152447r1=1152446r2=1152447view=diff
==
--- subversion/trunk/subversion/libsvn_wc/node.c (original)
+++ subversion/trunk/subversion/libsvn_wc/node.c Sat Jul 30 10:47:39 2011
@@ -1795,6 +1795,33 @@ svn_wc__check_for_obstructions(svn_wc_no
 
 
 svn_error_t *
+svn_wc__node_was_moved_away(const char **moved_to_abspath,
+const char **op_root_abspath,
+svn_wc_context_t *wc_ctx,
+const char *local_abspath,
+apr_pool_t *result_pool,
+apr_pool_t *scratch_pool)
+{
+  svn_boolean_t is_deleted;
+
+  if (moved_to_abspath)
+*moved_to_abspath = NULL;
+  if (op_root_abspath)
+*op_root_abspath = NULL;
+
+  SVN_ERR(svn_wc__node_is_status_deleted(is_deleted, wc_ctx, local_abspath,
+ scratch_pool));
+  if (is_deleted)
+SVN_ERR(svn_wc__db_scan_deletion(NULL, moved_to_abspath, NULL,
+ op_root_abspath, wc_ctx-db,
+ local_abspath,
+ result_pool, scratch_pool));
+
+  return SVN_NO_ERROR;
+}
+
+
+svn_error_t *
 svn_wc__node_was_moved_here(const char **moved_from_abspath,
 const char **delete_op_root_abspath,
 svn_wc_context_t *wc_ctx,




svn commit: r1152449 - in /subversion/trunk/subversion: libsvn_client/commit.c tests/cmdline/copy_tests.py

2011-07-30 Thread stsp
Author: stsp
Date: Sat Jul 30 10:52:20 2011
New Revision: 1152449

URL: http://svn.apache.org/viewvc?rev=1152449view=rev
Log:
Make commit refuse to commit the delete-half of a move separately from
the copied-half.

* subversion/libsvn_client/commit.c
  (svn_client_commit5): If a deleted commit target was moved-away
   refuse to perform the commit unless the copied-half of the move
   is among the commit targets.

* subversion/tests/cmdline/copy_tests.py
  (commit_deleted_half_of_move): Remove XFail marker.

Modified:
subversion/trunk/subversion/libsvn_client/commit.c
subversion/trunk/subversion/tests/cmdline/copy_tests.py

Modified: subversion/trunk/subversion/libsvn_client/commit.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/commit.c?rev=1152449r1=1152448r2=1152449view=diff
==
--- subversion/trunk/subversion/libsvn_client/commit.c (original)
+++ subversion/trunk/subversion/libsvn_client/commit.c Sat Jul 30 10:52:20 2011
@@ -1447,7 +1447,35 @@ svn_client_commit5(const apr_array_heade
 }
 }
 }
-  /* ### TODO: check the delete-half, too */
+  else if (item-state_flags  SVN_CLIENT_COMMIT_ITEM_DELETE)
+{
+  const char *moved_to_abspath;
+  const char *copy_op_root_abspath;
+
+  cmt_err = svn_error_trace(svn_wc__node_was_moved_away(
+  moved_to_abspath,
+  copy_op_root_abspath,
+  ctx-wc_ctx, item-path,
+  iterpool, iterpool));
+  if (cmt_err)
+goto cleanup;
+
+  if (moved_to_abspath  copy_op_root_abspath 
+  strcmp(moved_to_abspath, copy_op_root_abspath) == 0 
+  apr_hash_get(committables-by_path, copy_op_root_abspath,
+   APR_HASH_KEY_STRING) == NULL)
+{
+  cmt_err = svn_error_createf(
+  SVN_ERR_ILLEGAL_TARGET, NULL,
+ _(Cannot commit '%s' because it was moved to '%s' 
+   which is not part of the commit; both sides of 
+   the move must be committed together),
+ svn_dirent_local_style(item-path, iterpool),
+ svn_dirent_local_style(copy_op_root_abspath,
+iterpool));
+  goto cleanup;
+}
+}
 }
 
   /* Go get a log message.  If an error occurs, or no log message is

Modified: subversion/trunk/subversion/tests/cmdline/copy_tests.py
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/copy_tests.py?rev=1152449r1=1152448r2=1152449view=diff
==
--- subversion/trunk/subversion/tests/cmdline/copy_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/copy_tests.py Sat Jul 30 10:52:20 
2011
@@ -5526,7 +5526,6 @@ def commit_copied_half_of_nested_move(sb
 
 
 @Issue(3631)
-@XFail()
 def commit_deleted_half_of_move(sbox):
   attempt to commit the deleted part of move
   sbox.build(read_only = True)