In 'svnmover', consolidate some branching methods: merge the 'branch' and'open_branch' methods into one.* subversion/include/private/svn_branch.h (svn_branch__txn_open_branch): Add a 'tree_ref' parameter. (svn_branch__txn_branch): Delete.* subversion/include/private/svn_branch_impl.h (svn_branch__txn_v_open_branch_t): Add a 'tree_ref' parameter. (svn_branch__txn_v_branch_t): Delete. (svn_branch__txn_vtable_t): Remove that method from the vtable.* subversion/libsvn_delta/branch.c (branch_txn_open_branch): Add a 'tree_ref' parameter, and apply it like the 'branch' method used to do. (branch_txn_branch): Delete. (svn_branch__txn_open_branch): Add a 'tree_ref' parameter. (svn_branch__txn_branch): Delete. (branch_txn_create): Remove that method from the vtable.* subversion/libsvn_delta/branch_compat.c (compat_branch_txn_open_branch): Add a 'tree_ref' parameter. (compat_branch_txn_branch): Delete. (svn_branch__compat_txn_from_delta_for_commit): Remove that method from the vtable.* subversion/libsvn_delta/branch_nested.c (svn_branch__instantiate_elements_r): Update caller: pass null. (nested_branch_txn_open_branch): Add a 'tree_ref' parameter, and apply recursion to it like nested_branch_txn_branch() used to do. (nested_branch_txn_branch): Delete. (svn_branch__nested_txn_create): Remove that method from the vtable.* tools/dev/svnmover/merge3.c (merge_subbranch): Use 'open_branch' instead of 'branch' method.* tools/dev/svnmover/svnmover.c (svn_branch__replay, update_wc_base_r, do_mkbranch): Update caller: pass null. (do_branch, do_topbranch): Use 'open_branch' instead of 'branch' method.
In 'svnmover', consolidate some branching methods. Basically, delete thetwo 'add branch' methods because 'open branch' can do the same job.* subversion/include/private/svn_branch.h (svn_branch__txn_get_branches): Add comments. (svn_branch__txn_open_branch): Add comments. Rename a parameter. (svn_branch__state_t): Add comments. (svn_branch__txn_add_branch, svn_branch__txn_add_new_branch): Delete.* subversion/include/private/svn_branch_impl.h (svn_branch__txn_v_add_branch_t, svn_branch__txn_v_add_new_branch_t): Delete. (svn_branch__txn_vtable_t): Delete those entries from the vtable.* subversion/libsvn_delta/branch.c (branch_txn_add_branch, branch_txn_add_new_branch): Delete. (branch_txn_open_branch, branch_txn_branch): Don't use svn_branch__txn_add_new_branch(). (svn_branch__txn_add_branch, svn_branch__txn_add_new_branch): Delete. (svn_branch__txn_open_branch): Rename a parameter. (branch_txn_create): Update the vtable. (svn_branch__txn_parse): Don't use svn_branch__txn_add_branch().* subversion/libsvn_delta/branch_compat.c (compat_branch_txn_add_branch, compat_branch_txn_add_new_branch): Delete. (svn_branch__compat_txn_from_delta_for_commit): Update the vtable.* subversion/libsvn_delta/branch_nested.c (svn_branch__instantiate_elements_r): Use svn_branch__txn_open_branch() instead of ...add_new_branch. (nested_branch_txn_add_branch, nested_branch_txn_add_new_branch): Delete. (svn_branch__nested_txn_create): Update the vtable.* tools/dev/svnmover/svnmover.c (do_mkbranch): Add a comment.
In 'svnmover', track history better.For each version of each branch, store pointers to previous branch-versions,called "parents" like in Git. Usually, a branch version has one parent thatpoints to the previous version of the same branch. Upon branching, the newbranch gets one parent that points to the chosen version of the sourcebranch. Upon merging, in the usual case of a complete merge from a sourcebranch into a target branch, the target branch gets two parents: its ownprevious version, and the merge source.* subversion/include/private/svn_branch.h (svn_branch__txn_open_branch, svn_branch__txn_add_new_branch): Don't take a 'predecessor' parameter. (svn_branch__state_t): Don't track a 'predecessor' as a public field here. (svn_branch__history_t, svn_branch__history_create_empty, svn_branch__history_create, svn_branch__history_dup): New. (svn_branch__state_get_history): Rename from 'svn_branch__state_get_merge_ancestor'. (svn_branch__state_set_history): Rename from 'svn_branch__state_add_merge_ancestor'.* subversion/include/private/svn_branch_impl.h Track the changes in svn_branch.h.* subversion/libsvn_delta/branch.c Implement the changes in svn_branch.h.* subversion/libsvn_delta/branch_compat.c Track the changes in svn_branch.h.* subversion/libsvn_delta/branch_nested.c Track the changes in svn_branch.h.* subversion/tests/cmdline/svnmover_tests.py (reported_mg_diff): No longer expect any diff output describing a merge history difference, as we don't print that in a diff any more.* tools/dev/svnmover/ra.c (branch_get_mutable_state): Initialize each branch's parent to point to the same branch in the base revision.* tools/dev/svnmover/svnmover.c (list_parents, history_str, svn_branch__history_add_parent): New. (history_diff): Rename from 'merge_history_diff'. (txn_is_changed): Don't compare history, but leave some place-holder code in case we want to do so later. (get_union_of_subbranches): Make robust against either or both inputs being null. (svn_branch__replay): Update the replaying of a change of history. (update_wc_base_r): Update the copying of history for a new branch. (do_merge): Update the recording of history. (do_auto_merge): Dummy implementation: does nothing. (show_history_r): New. (branch_diff_r): Don't show history differences. (find_branch_main_parent): New. (svn_branch__find_predecessor_el_rev): Update the finding of the main parent. (do_log): Also show the history before the diff of each revision. (do_mkbranch): Track the API changes. (do_branch): Initialize the history (parent) of the new branch. (show_branch_history): New. (execute): In the 'info-wc' subcommand, show the history of the working branch (and not of the base branch).
In 'svnmover', allow a couple of nested-branching functions to operate on anon-flat branch hierarchy without raising an assertion failure.The specific case this enables is where a branch-root element points to anested branch that doesn't currently exist. No test currently requires this,but it makes the functions more widely applicable for future use.* subversion/libsvn_delta/branch_nested.c (svn_branch__get_immediate_subbranch_eids): New, extracted... (svn_branch__get_immediate_subbranches): ... from here. (svn_branch__get_subtree, svn_branch__find_nested_branch_element_by_relpath): Use it, and ignore any subbranch-root element that points to a nonexistent nested branch instead of raising an assertion failure.
In 'svnmover', tweak the 'branch state' API to slightly simplify both theimplementation and some callers.* subversion/include/private/svn_branch.h (svn_branch__state_set_element): New.* subversion/include/private/svn_branch_impl.h (svn_branch__state_v_set_element_t): New. (svn_branch__state_v_alter_one_t, svn_branch__state_v_delete_one_t): Delete. (svn_branch__state_vtable_t): Replace 'alter_one' and 'delete_one' with 'set_element'.* subversion/include/private/svn_element.h, subversion/libsvn_delta/element.c (svn_element__tree_set): Constify the input.* subversion/libsvn_delta/branch.c (branch_map_set): Constify the input. (branch_state_delete_one, branch_state_alter): Delete. (branch_state_set_element, svn_branch__state_set_element): New. (svn_branch__state_alter_one, svn_branch__state_delete_one): Change implementations to forward to svn_branch__state_set_element. (branch_state_create): Update the vtable. (svn_branch__map_add_subtree, svn_branch__state_parse): Update callers.* subversion/libsvn_delta/branch_nested.c (branch_instantiate_elements): Use the new method. Add a missing SVN_ERR().* tools/dev/svnmover/merge3.c (branch_merge_subtree_r): Use the new method.* tools/dev/svnmover/svnmover.c (branch_elements_replay, update_wc_base_r): Use the new method.
Merge the 'svnmover' prototype from the 'move-tracking-2' branch to trunk.See the dev@ email thread "Merge 'svnmover' demo tool to trunk" started on2015-11-10, archived at e.g. <http://mail-archives.apache.org/mod_mbox/subversion-dev/201511.mbox/%3CCAEcU=1YE5Ci02j_4aAeB_roS1X0H2QWPP3juu0exjVJ-FGCLyg@mail.gmail.com%3E>.This is a reintegration (performed as an automatic merge) followed byreverting the unwanted parts. As such, those unwanted parts (such as shiminsertions in several libraries) will be treated as 'record-only merged' andwill not be picked up by any subsequent automatic merge to trunk.A brief description of the changes follows.* build.conf Adjust to build the new files.* configure.ac Adjust compiler warning flags to not warn about passing or returning a structure, because some of the code does so.* LICENSE Add the licence text for the embedded 'linenoise' library.* notes/move-tracking/README New file, describing this work.* subversion/include/private/svn_branch.h, subversion/include/private/svn_branch_compat.h, subversion/include/private/svn_branch_impl.h, subversion/include/private/svn_branch_nested.h, subversion/include/private/svn_branch_repos.h, subversion/include/private/svn_element.h New files.* subversion/libsvn_delta/branch.c, subversion/libsvn_delta/branch_compat.c, subversion/libsvn_delta/branch_migrate.c, subversion/libsvn_delta/branch_nested.c, subversion/libsvn_delta/branch_repos.c, subversion/libsvn_delta/element.c New files.* subversion/include/private/svn_cmdline_private.h subversion/libsvn_subr/cmdline.c (svn_cmdline__stdin_is_a_terminal, svn_cmdline__stdout_is_a_terminal, svn_cmdline__stderr_is_a_terminal): New.* subversion/tests/cmdline/svnmover_tests.py New file.* subversion/tests/cmdline/svntest/actions.py (run_and_verify_svnmover, run_and_verify_svnmover2): New.* subversion/tests/cmdline/svntest/main.py (svnmover_binary, run_svnmover): New. (execute_tests): Initialize 'svnmover_binary'.* subversion/tests/cmdline/svntest/wc.py (State): Add 'rename' and 'from_eids' methods. (StateItem): Add an 'eid' attribute.* tools/dev/svnmover New tool.