Checkout Tools
  • last updated 1 hour ago
Constraints: committers
Constraints: files
Constraints: dates
Complete the upgrade of array insert/delete functions.

For issue #4840 "Merge assertion failure in svn_sort__array_insert".

This changes all remaining callers, in other areas of Subversion, to use the

new array insert/delete functions that return standard Subversion errors if

inputs are out of bounds, and removes the old versions of those functions.

These are private functions so the public API is not affected.

* subversion/include/private/svn_sorts_private.h

* subversion/libsvn_subr/sorts.c


svn_sort__array_delete): Remove.


svn_sort__array_delete2): Rewrite as the only version, instead of calling

the old version. No functional change.

Elsewhere: update all callers.

  1. … 18 more files in changeset.
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



do_mkbranch): Update caller: pass null.


do_topbranch): Use 'open_branch' instead of 'branch' method.

  1. … 6 more files in changeset.
In 'svnmover', consolidate some branching methods. Basically, delete the

two '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_new_branch): Delete.

* subversion/include/private/svn_branch_impl.h


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_new_branch): Delete.


branch_txn_branch): Don't use svn_branch__txn_add_new_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_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_new_branch): Delete.

(svn_branch__nested_txn_create): Update the vtable.

* tools/dev/svnmover/svnmover.c

(do_mkbranch): Add a comment.

  1. … 5 more files in changeset.
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 that

points to the previous version of the same branch. Upon branching, the new

branch gets one parent that points to the chosen version of the source

branch. Upon merging, in the usual case of a complete merge from a source

branch into a target branch, the target branch gets two parents: its own

previous version, and the merge source.

* subversion/include/private/svn_branch.h


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_dup): New.

(svn_branch__state_get_history): Rename from


(svn_branch__state_set_history): Rename from


* 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/

(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



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


(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).

  1. … 7 more files in changeset.
Revert a tweak commited accidentally in r1717957.

* subversion/libsvn_delta/branch.c

(svn_branch__txn_get_branch_by_id): Remove the extra 'return'.

A small step towards making 'svnmover merge' operate into a new temporary

txn first.

* subversion/trunk/subversion/libsvn_delta/branch.c

(svn_branch__txn_get_branch_by_id): Tweak to allow setting a breakpoint on

a null return. (Committed accidentally.)

* tools/dev/svnmover/svnmover.h

(svnmover_branch_merge): Take the branch to be edited as a parameter,

instead of making edits in the 'target' branch.

* tools/dev/svnmover/merge3.c



svnmover_branch_merge): Same.

* tools/dev/svnmover/svnmover.c


do_merge): Update callers: for now, just pass the target branch as the

branch to be edited.

(execute): Enforce that the specified target of a merge must be the

working copy, not a revision.

  1. … 3 more files in changeset.
In 'svnmover', tweak the 'branch state' API to slightly simplify both the

implementation 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_delete_one_t): Delete.

(svn_branch__state_vtable_t): Replace 'alter_one' and 'delete_one' with


* subversion/include/private/svn_element.h,


(svn_element__tree_set): Constify the input.

* subversion/libsvn_delta/branch.c

(branch_map_set): Constify the input.


branch_state_alter): Delete.


svn_branch__state_set_element): New.


svn_branch__state_delete_one): Change implementations to forward to


(branch_state_create): Update the vtable.


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


update_wc_base_r): Use the new method.

  1. … 7 more files in changeset.
Add a missing copy-constructor: svn_branch__el_rev_id_dup().

* subversion/include/private/svn_branch.h,


(svn_branch__el_rev_id_dup): New.

  1. … 1 more file in changeset.
In 'svnmover', start tracking complete merges.

Track the source-branch end point of each merge. Add an 'automerge' command

that uses this as the ancestor for the next merge from the same source.

This is a very primitive initial implementation. It only enables each branch

to track complete merges from a single source branch. Complete merges here

refers to completeness in revisions (all revisions up to N, no cherry

picking) and also to the complete tree (no subtree tracking). It overwrites

the previous merge history regardless whether the new merge is from the same

source branch, and regardless whether it is in fact a complete merge.

* subversion/include/private/svn_branch.h

(svn_branch__rev_bid_equal): New.


svn_branch__state_set_merge_ancestor): New.

* subversion/include/private/svn_branch_impl.h


svn_branch__state_v_set_merge_ancestor_t): New.

(svn_branch__state_vtable_t): Add the new methods to the vtable.

* subversion/libsvn_delta/branch.c

(svn_branch__state_priv_t): Add storage for a merge ancestor (just one, so


(svn_branch__rev_bid_equal): New.


branch_state_set_merge_ancestor): New.


svn_branch__state_set_merge_ancestor): New.

(branch_state_create): Add the new methods to the vtable.

(svn_branch__get_default_r0_metadata): Update.

(merge_history_parse): New.

(parse_element_line): Take and use a result pool for the results, in order

to avoid surprises in future.

(svn_branch__state_parse): Parse the merge history.

(merge_history_serialize): New.

(svn_branch__state_serialize): Serialize the merge history.

* subversion/tests/cmdline/

(reported_mg_diff): New.

(...everywhere...): Expect a merge-history diff whenever there is a merge.

* subversion/tests/cmdline/svntest/

(_re_parse_eid_merge_history): New.

(State.from_eids): Parse and ignore merge history lines.

* tools/dev/svnmover/merge3.c

(merge_subbranch): Correct a comment.

* tools/dev/svnmover/svnmover.c


merge_history_diff): New.

(txn_is_changed): Also check for any change in merge history.

(svn_branch__replay): Also replay any change in merge history.


action_defn): Define a new 'automerge' command. Rename a constant.

(do_merge): Also record the merge history.

(do_auto_merge): New.

(branch_diff_r): Also diff the merge history.

(execute): Expand the 'info-wc' command to show merge history status.

Implement the 'automerge' command. Track the rename.

  1. … 6 more files in changeset.
Merge the 'svnmover' prototype from the 'move-tracking-2' branch to trunk.

See the dev@ email thread "Merge 'svnmover' demo tool to trunk" started on

2015-11-10, archived at e.g. <>.

This is a reintegration (performed as an automatic merge) followed by

reverting the unwanted parts. As such, those unwanted parts (such as shim

insertions in several libraries) will be treated as 'record-only merged' and

will 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.


Adjust compiler warning flags to not warn about passing or returning a

structure, because some of the code does so.


Add the licence text for the embedded 'linenoise' library.

* notes/move-tracking/README

New file, describing this work.

* subversion/include/private/svn_branch.h,






New files.

* subversion/libsvn_delta/branch.c,






New files.

* subversion/include/private/svn_cmdline_private.h




svn_cmdline__stderr_is_a_terminal): New.

* subversion/tests/cmdline/

New file.

* subversion/tests/cmdline/svntest/


run_and_verify_svnmover2): New.

* subversion/tests/cmdline/svntest/


run_svnmover): New.

(execute_tests): Initialize 'svnmover_binary'.

* subversion/tests/cmdline/svntest/

(State): Add 'rename' and 'from_eids' methods.

(StateItem): Add an 'eid' attribute.

* tools/dev/svnmover

New tool.

  1. … 25 more files in changeset.