* subversion/tests/libsvn_wc/op-depth-test.c
  (movedhere_extract_retract): In preparation for the fix, fix expected result.


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1538928 13f79535-47bb-0310-9956-ffa450edef68
Following up on r1538702, really restrict the moves to what is moved
at a specific op-depth by using an existing query.

* subversion/libsvn_wc/wc-queries.sql
  (STMT_SELECT_MOVED_PAIRS_DEPTH): Remove now unused query.

* subversion/libsvn_wc/wc_db_update_move.c
  (break_moved_away_children_internal): Use more restricted query.


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1538936 13f79535-47bb-0310-9956-ffa450edef68
When a node is removed during update, also remove the move information
referring to this node to avoid creating an inconsistent nodes table.

* subversion/libsvn_wc/wc_db.c
  (svn_wc__db_retract_parent_delete): Remove moved_to state when the node no
    longer shadows something that is moved.

* subversion/tests/libsvn_wc/op-depth-test.c
  (test_funcs): Remove XFail marker from movedhere_extract_retract.


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1538939 13f79535-47bb-0310-9956-ffa450edef68
When turning a move into a delete as part of reverting the moved-to tree
properly handle depth instead of simply assuming that the moved-from node
is its own op-root.

* subversion/libsvn_wc/wc_db.c
  (clear_moved_to): Order arguments in standard order. Implement strict depth
    behavior instead of assuming that the interesting node is always
    an op-root. Return an error when the node is not found.
  (op_revert_txn,
   op_revert_recursive_txn): Update caller.


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1538948 13f79535-47bb-0310-9956-ffa450edef68
Add a working copy query test to automatically find queries with an idential
query plan as not having duplicates reduces maintenance and helps avoiding
query planner costs.

* subversion/libsvn_wc/upgrade.c
  (migrate_single_tree_conflict_data): Use existing instead of specialized
    queries.

* subversion/libsvn_wc/wc-queries.sql
  (STMT_DELETE_MOVED_BACK): Remove duplicate.
  (STMT_UPDATE_ACTUAL_CONFLICT_DATA,
   STMT_INSERT_ACTUAL_CONFLICT_DATA): Remove duplicates.

* subversion/libsvn_wc/wc_db.c
  (handle_move_back): Update query user.

* subversion/tests/libsvn_wc/wc-queries-test.c
  (includes): Add svn_hash.h.
  (test_query_duplicates): New function.
  (test_funcs): Add test_query_duplicates.


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1538962 13f79535-47bb-0310-9956-ffa450edef68
Apply more strict op_depth fixes to move handling to properly handle
shadowed moves.

* subversion/libsvn_wc/wc-queries.sql
  (STMT_SELECT_OP_DEPTH_MOVED_TO): Match the requested node with its direct
    shadowing move by a join.
  (STMT_SELECT_MOVED_HERE): Remove unused query.

* subversion/libsvn_wc/wc_db.c
  (clear_moved_here): Use the moved_to relative path, as that is unique,
    because the moved_from relpath doesn't have to be. This also allows
    removing a now unused query. Return error when the target is not found.
  (db_base_remove): Update caller. Use different column of existing query.

  (follow_moved_to): Simplify code, based on the new query. Don't hide moves
    that don't specify the same revision or repos_relpath. While they are
    out of sync they are still moves, that need to be tracked... or the
    conflict handling isn't able to resolve the problem.


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1539007 13f79535-47bb-0310-9956-ffa450edef68
Extend the op-depth test framework with some helper code to verify which
conflicts are installed in a specific part of the working copy.

* subversion/tests/libsvn_wc/op-depth-test.c
  (includes): Add svn_hash.h.
  (conflict_info_t): New struct.
  (print_conflict,
   compare_conflict_info,
   check_db_conflicts): New functions.

  (update_prop_mod_into_moved,
   nested_move_update): Extend test with conflict verification.


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1539032 13f79535-47bb-0310-9956-ffa450edef68
When bumping an updated tree don't assume the origin is always BASE, as this
same function should also used for recursive move updates.

* subversion/libsvn_wc/wc-queries.sql
  (STMT_SELECT_HAS_NON_FILE_CHILDREN,
   STMT_SELECT_HAS_GRANDCHILDREN): Make op_depth an argument. Limit results to help Sqlite.

* subversion/libsvn_wc/wc_db_update_move.c
  (depth_sufficient_to_bump): Order arguments properly. Add op_depth argument.
  (bump_moved_away): Update documentation for this and expected followup.


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1539041 13f79535-47bb-0310-9956-ffa450edef68
* subversion/libsvn_client/merge.c
  (do_mergeinfo_aware_dir_merge): Tweak a comment.

git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1539079 13f79535-47bb-0310-9956-ffa450edef68
Introduce a new-style JNI wrapper to the JavaHL native implementaiton.
The old-style, rather messy code will eventually be ported to this.

* build.conf
  (private-includes): Add JavaHL *.hpp and jniwrapper headers.
  (libsvnjavahl): Add jniwrapper sources.

* subversion/bindings/javahl/native/JNIUtil.cpp
  (g_jvm, JNI_OnLoad, JNI_OnUnload): Removed; replaced by equivalent
   functionality in jniwrapper.
  (JNIUtil::getEnv): Reimplement using jniwrapper's Java::Env class.

* subversion/bindings/javahl/native/jniwrapper: New directory.
* subversion/bindings/javahl/native/jniwrapper/jni_array.hpp,
  subversion/bindings/javahl/native/jniwrapper/jni_base.cpp,
  subversion/bindings/javahl/native/jniwrapper/jni_class_cache.cpp,
  subversion/bindings/javahl/native/jniwrapper/jni_env.hpp,
  subversion/bindings/javahl/native/jniwrapper/jni_exception.hpp,
  subversion/bindings/javahl/native/jniwrapper/jni_globalref.hpp,
  subversion/bindings/javahl/native/jniwrapper/jni_javahl_exception.hpp,
  subversion/bindings/javahl/native/jniwrapper/jni_list.cpp,
  subversion/bindings/javahl/native/jniwrapper/jni_list.hpp,
  subversion/bindings/javahl/native/jniwrapper/jni_object.hpp,
  subversion/bindings/javahl/native/jniwrapper/jni_stack.hpp: New files.


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1539114 13f79535-47bb-0310-9956-ffa450edef68
Add a new-style, cached wrapper for the SubversionException class to JavaHL.'

* subversion/bindings/javahl/native/SubversionException.hpp,
  subversion/bindings/javahl/native/SubversionException.cpp: New files.

* subversion/bindings/javahl/native/jniwrapper/jni_class_cache.cpp
  (Java::ClassCache::ClassCache): Add initializer for the
   SubversionException generator class.


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1539116 13f79535-47bb-0310-9956-ffa450edef68
Add a missing include to JavaHL's jniwrapper.

* subversion/bindings/javahl/native/jniwrapper/jni_array.hpp:
   Include <cstring>.
  (Java::ByteArray::ByteArray): Qualify strlen in the ::std namespace.

* subversion/bindings/javahl/native/jniwrapper/jni_object.hpp:
   Include <cstring>.
  (Java::String::String): Qualify strlen in the ::std namespace.
  (Java::String::set_value): Likewise.


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1539121 13f79535-47bb-0310-9956-ffa450edef68
* subversion/bindings/javahl/native/jniwrapper/jni_object.hpp
  (Java::String::String): Perform typosuction on docstring.


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1539122 13f79535-47bb-0310-9956-ffa450edef68
Detect shadowed nodes when applying update move edit operations to avoid
accidentally trying to change unrelated nodes.

* subversion/libsvn_wc/wc_db_update_move.c
  (check_node_shadowed): New function.
  (tc_editor_alter_directory,
   tc_editor_alter_file,
   tc_editor_delete): Check for shadowed first and use that to avoid
       checking for preconditions that depend on non shadowed nodes.

* subversion/tests/cmdline/move_tests.py
  (move_many_update_add): Remove XFail marker and update expected results to
    match a successfull update + resolve.

* subversion/tests/libsvn_wc/op-depth-test.c
  (nested_move_update): Add no conflict check.
  (check_tree_conflict_repos_path): Don't segfault on no repository location.


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1539125 13f79535-47bb-0310-9956-ffa450edef68
Add a utility API to parse and unparse svn:externals definitions to JavaHL.

[in subversion/bindings/javahl/src/org/apache/subversion/javahl]
* SVNUtil.java (SVNUtil.parseExternals): New static method.
  (SVNUtil.unparseExternals): Likewise.
  (SVNUtil.unparseExternalsForAncientUnsupportedClients): Likewise.
* types/ExternalItem.java (ExternalItem): New class.
* types/Revision.java (Revision.DateSpec.DateSpec): New private constructor.
   Creates a dated revision from a timestamp in milliseconds.
 * util/PropLib.java
   (PropLib.parseExternals, PropLib.unparseExternals): Declare native methods.

[in subversion/bindings/javahl/native]
* Revision.h (Revision::makeJRevision): New overload.
* ExternalItem.hpp, ExternalItem.cpp: New-style object wrappers for
   types.ExternalItem.
* ExternalItem.cpp (Revision::makeJRevision): New-style implementation
   of the new overload. Located here until the old-style Revision
   implementation can be ported to jniwrapper.

* org_apache_subversion_javahl_util_PropLib.cpp: Include the required
   new-style headers for the new method implementations.
  (FormatRevision): Helper object for formating revisions to std::ostream.
  (operator<<): Stream insertion operator for FormatRevision.
  (Java_org_apache_subversion_javahl_util_PropLib_parseExternals):
   Boilerplate native implementation of PropLib.parseExternals.
  (Java_org_apache_subversion_javahl_util_PropLib_unparseExternals):
   Native implementation of PropLib.unparseExternals.

[in subversion/bindings/javahl/tests/org/apache/subversion/javahl]
* UtilTests.java
  (UtilTests.externals, UtilTests.old_externals): New private members.
  (UtilTests.testUnparseExternals,
  (UtilTests.testUnparseExternalsOldstyle): New test cases.


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1539130 13f79535-47bb-0310-9956-ffa450edef68
In an attempt to make things easier to understand and maintain remove the
generic editor abstraction layer from the update move handling.

This layer makes it very hard to see which code calls which. And as this
code needs to be extended with yet another layer of tree conflict detection
before it really works for the generic case, this will avoid a full layer
of new batons.

The implementation already required a depth first drive, that the editor
explicitly doesn't want to promis.

* subversion/libsvn_wc/wc_db_update_move.c
  (includes): Remove private/svn_editor.h.
  (tc_editor_copy,
   tc_editor_move,
   tc_editor_complete,
   tc_editor_abort,
   editor_ops): Remove unused functions and variables.

  (update_moved_away_node): Update argument to baton. Directly call tc
    functions.
  (update_moved_away_conflict_victim): Simplify initialization.


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1539131 13f79535-47bb-0310-9956-ffa450edef68
In general the revisions stored in the NODES table are more relyable than
those stored in tree conflicts (as the NODES table might change during
resolving). Therefore drop a lot of unnecessary comparisions that raises
assertions when things get out of sync and just trust the nodes information.

* subversion/libsvn_wc/wc_db_update_move.c
  (tc_editor_add_directory,
   tc_editor_add_file,
   tc_editor_alter_directory,
   tc_editor_alter_file,
   tc_editor_delete,
   update_moved_away_node): Remove revision handling that was just used
     to verify if the editor driver was a generic driver.

* subversion/tests/libsvn_wc/op-depth-test.c
  (move4_update_delself_AAA): Tweak test to continue until the next problem.
  (test_funcs): Remove XFail marker from move4_update_delete_AAA. This XFail
    was caused by out of date tree conflict information.


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1539135 13f79535-47bb-0310-9956-ffa450edef68
In the move-update handling: pass the baton as the right type.

* subversion/libsvn_wc/wc_db_update_move.c
  (tc_editor_baton): Rename to...
  (update_move_baton_t): ... this.

  (check_node_shadowed,
   check_tree_conflict,
   tc_editor_add_directory,
   tc_editor_add_file,
   tc_editor_alter_directory,
   tc_editor_alter_file,
   tc_editor_delete,
   update_moved_away_node,
   drive_tree_conflict_editor): Update baton variables. Remove unneeded casts.


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1539143 13f79535-47bb-0310-9956-ffa450edef68
Remove more unneeded code from the update move handling: don't open
pristine files and remove unused arguments.

* subversion/libsvn_wc/wc_db_update_move.c
  (tc_editor_add_directory): Remove children argument.
  (tc_editor_add_file): Remove contents argument.
  (tc_editor_alter_directory): Remove children argument.
  (tc_editor_alter_file): Remove new contents argument.

  (update_moved_away_node): Update caller.
  (suitable_for_move): Tweak code to avoid warning.


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1539148 13f79535-47bb-0310-9956-ffa450edef68
Split the move-update handling for deletes in two parts: one for nodes that
are really in the working copy (=not shadowed) and one for all deletes.

* subversion/libsvn_wc/wc_db_update_move.c
  (tc_editor_delete): Extract the code for shadowed nodes into...
  (delete_move_leaf): ... this new function which is now called from the
    caller. This matches how the alter functions are implemented.

  (update_moved_away_node): Update caller.


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1539163 13f79535-47bb-0310-9956-ffa450edef68