Checkout Tools
  • last updated 8 hours ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
Update wiki links to point to the new(ish) Confluence Wiki.
  1. … 4 more files in changeset.
Fix issue #4822, "svn diff --changelist ARG" broken in subdirectories.

A follow-up to r1835234.

* subversion/libsvn_wc/diff_local.c

(svn_wc__diff7): Pass the correct anchor dir to the changelist filter.

* subversion/tests/cmdline/changelist_tests.py

(diff_with_changelists_subdir): New test.

(test_list): Run it.

  1. … 1 more file in changeset.
Fix memory lifetime problem in a libsvn_wc error code path.

* subversion/libsvn_wc/wc_db_update_move.c

(suitable_for_move): Calling svn_sqlite__column_text() with a NULL result

pool twice means the result of the first call becomes invalid. Store the

child_relpath variable in a pool. It is passed to path_for_error_message()

later, after another call to svn_sqlite__column_text() with a NULL result

pool has already occurred.

Crash observed on OpenBSD:

#0 strlen () at /usr/src/lib/libc/arch/amd64/string/strlen.S:125

#1 0x00000c38d5de6db7 in svn_dirent_join (

base=0xc38dfe1ef00 "/home/stsp/svn/svn-1.12.0/subversion/tests/libsvn_wc/svn-test-work/working-copies/move_update_subtree",

component=0xc390ca94fc8 '\337' <repeats 55 times>, <incomplete sequence \337><error: Cannot access memory at address 0xc390ca95000>, pool=0xc38eeceff00)

at subversion/libsvn_subr/dirent_uri.c:1007

#2 0x00000c38f686a815 in path_for_error_message (wcroot=0xc387ee3d300,

local_relpath=0xc390ca94fc8 '\337' <repeats 55 times>, <incomplete sequence \337><error: Cannot access memory at address 0xc390ca95000>,

result_pool=0xc38eeceff00) at subversion/libsvn_wc/wc_db_update_move.c:167

#3 0x00000c38f686ad1f in suitable_for_move (wcroot=0xc387ee3d300,

local_relpath=0xc387efe4ce0 "A/B", scratch_pool=0xc38eeceff00)

at subversion/libsvn_wc/wc_db_update_move.c:2192

Change the shelf storage directory name from 'v2' to 'v3'.

Also remove the knowledge of the existence of a shelves directory from the

WC API, and instead just have knowledge of the 'experimental' features dir

at this level.

* subversion/include/private/svn_wc_private.h,

subversion/libsvn_wc/wcroot_anchor.c

(svn_wc__get_experimental_dir): Replacement for 'svn_wc__get_shelves_dir'.

* subversion/libsvn_client/shelf.c

(get_shelves_dir): New.

(shelf_construct,

svn_client__shelf_list): Use it.

  1. … 2 more files in changeset.
Add resolver support for moved-file vs moved-file upon update.

The resolver now supports move vs move tree conflicts for files after

an update operation.

Two new resolution operations are available:

(m) - override incoming move and merge incoming changes from 'alpha-moved'

to 'alpha-also-moved'

(M) - accept incoming move and merge local changes from 'alpha-also-moved'

to 'alpha-moved'

Where the file was originally called 'alpha', was renamed to 'alpha-moved'

in the repository, and renamed to 'alpha-also-moved' in the working copy.

Because the local move is broken during the update operation when the

delete-half of the move is updated, the resolver only has the copied half

move available in the working copy. To find the local move destination the

resolver queries the working copy database for nodes which are copies of

the conflict victim's repository path. This can of course lead to ambiguous

results in case a node is first copied and then moved, in which case the

resolver offers the user a choice of local move targets in the usual way.

* subversion/include/private/svn_wc_private.h

(svn_wc__find_copies_of_repos_path): Declare.

* subversion/libsvn_client/conflicts.c

(conflict_tree_update_local_moved_away_details): New conflict details struct.

(resolve_both_moved_file_update_keep_local_move,

resolve_both_moved_file_update_keep_incoming_move): New resolution handlers.

(conflict_tree_get_details_update_local_moved_away): New details fetcher

which locates copied nodes corresponding to the local move.

(get_both_moved_file_paths): New helper function.

(conflict_tree_get_description_update_both_moved_file_merge,

conflict_tree_get_description_update_both_moved_file_move_merge): New

functions which describe incoming move vs local move conflicts flagged

during updates of files.

(configure_option_both_moved_file_merge): Hook up the new options.

(svn_client_conflict_option_get_moved_to_abspath_candidates2,

svn_client_conflict_option_set_moved_to_abspath2,

conflict_type_specific_setup): Support the newly added conflict options.

* subversion/libsvn_wc/node.c

(svn_wc__find_copies_of_repos_path): New.

* subversion/libsvn_wc/wc-queries.sql

(STMT_SELECT_COPIES_OF_REPOS_RELPATH): New query which locates copies of a

particular repository relpath with a particular node kind in working copy.

* subversion/libsvn_wc/wc_db.c

(svn_wc__db_find_copies_of_repos_path): New wc_db API to execute above query.

* subversion/libsvn_wc/wc_db.h

(svn_wc__db_find_copies_of_repos_path): Declare.

* subversion/tests/libsvn_client/conflicts-test.c

(create_file_move_vs_file_move_update_conflict): New helper function.

(test_update_file_move_vs_file_move,

test_update_file_move_vs_file_move_accept_move, test_funcs): New tests

which exercise both of the newly added conflict resolution options.

  1. … 3 more files in changeset.
Make 'svn update' not record a tree conflict when deleting an unmodified

directory which happens to contain unversioned items. Instead, just leave

the unversioned items behind on disk when deleting the unmodified directory,

which matches the behaviour of Subversion 1.8.

Prompted by a question on users@:

https://svn.haxx.se/users/archive-2019-01/0060.shtml

* subversion/libsvn_wc/update_editor.c

(check_tree_conflict): Ignore unversioned items during check for local mods.

This prevents a tree conflict from being recorded.

* subversion/tests/cmdline/switch_tests.py

(tolerate_local_mods): Don't expect an unversioned item to cause a tree

conflict. Add the item to version control instead to meet this test's

expectations.

* subversion/tests/cmdline/update_tests.py

(update_keeps_unversioned_items_in_deleted_dir, test_list): New test

which ensures that update will leave unversioned items on disk when

deleting an unmodified directory.

  1. … 2 more files in changeset.
* subversion/libsvn_wc/revert.c

Update the top-of-file comment to mention removing/keeping

local files, for issue #4798.

Add resolver support for incoming move vs local move of files during merges.

Add two new resolution options for move vs move conflicts with files

after a merge operation:

(m) - apply changes to 'file-target' and revert addition of 'file-source'

(M) - move 'file-target' to 'file-source' and merge

where 'file-branch' is the path the file has on the merge target branch,

and 'file-source' is the path the file has on the merge source branch.

The 'm' option applies textual changes only and leaves the tree structure

of the merge target as it is. The 'M' option changes the file's location in

the merge target to match that of the merge source before merging changes.

I have not written related tests yet, but some manual testing was done.

Proper tests will follow as soon.

* subversion/include/svn_client.h

(svn_client_conflict_option_both_moved_file_merge,

svn_client_conflict_option_both_moved_file_move_merge): Declare new options.

* subversion/libsvn_client/conflicts.c

(follow_move_chains): Check for local candidates along all moves in the

chain, not just for the final move in the chain.

(resolve_incoming_move_file_text_merge): Implement support for the

svn_client_conflict_option_both_moved_file_move_merge option. This case

is similar enough to make sharing code written for other cases possible.

(resolve_both_moved_file_text_merge): New resolution handler for the

svn_client_conflict_option_both_moved_file_merge option.

(configure_option_incoming_delete_ignore): Don't match move-vs-move cases.

This causes the 'ignore deletion' option to show up in actual delete vs.

delete conflict cases as a side-effect.

(configure_option_incoming_delete_accept): Don't match move-vs-move cases.

(describe_incoming_move_merge_conflict_option): Change 'details' parameter

to a move target path, so this function can also be used for the new

svn_client_conflict_option_both_moved_file_move_merge option.

(configure_option_incoming_move_file_merge,

configure_option_incoming_dir_merge): Update callers.

(configure_option_both_moved_file_merge): Configure new options.

(svn_client_conflict_option_get_moved_to_repos_relpaths,

svn_client_conflict_option_set_moved_to_repos_relpaths

svn_client_conflict_option_get_moved_to_abspath_candidates,

svn_client_conflict_option_set_moved_to_abspath2): Accept new options and

update calls to describe_incoming_move_merge_conflict_option().

(svn_client_conflict_tree_get_resolution_options): Enable new options.

* subversion/libsvn_wc/conflicts.c

(svn_wc__guess_incoming_move_target_nodes): Handle the case where the

conflict victim is a 'local missing' victim. Needed for new options.

* subversion/svn/conflict-callbacks.c

(builtin_resolver_options): Set menu key bindings for new options.

  1. … 3 more files in changeset.
* subversion/libsvn_wc/README: Document 1.10's .svn/shelves/ directory.
Rename the new subdir '.svn/x' to '.svn/experimental'.

* subversion/libsvn_wc/wc.h

(SVN_WC__ADM_EXPERIMENTAL): Rename the subdir.

* subversion/libsvn_wc/README

(Structure of the Working Copy): Update the doc.

Define and use a constant for the '.svn/x' subdir name.

* subversion/libsvn_wc/wc.h

(SVN_WC__ADM_EXPERIMENTAL): New.

* subversion/libsvn_wc/wcroot_anchor.c

(svn_wc__get_shelves_dir): Use that and another defined constant.

* subversion/libsvn_wc/README

(Structure of the Working Copy): Document the 'x' subdirectory.

* subversion/libsvn_wc/README

(Structure of the Working Copy): Document the 'entries' and 'format' files.

Shelving: fix SVN-4774 "presence of old 1.10 shelves breaks shelf-list".

Change the shelves storage dir to be (1) different from the one used by

shelving-v1 in svn 1.10; (2) under an "x" prefix to designate "experimental";

(3) using a shelving format version number so we can cleanly create

further experimental versions.

* subversion/libbsvn_wc/wcroot_anchor.c

(svn_wc__get_shelves_dir): Use ".svn/x/shelves/v2" instead of ".svn/shelves".

* subversion/libsvn_wc/wc_db.c

(svn_wc__db_find_working_nodes_with_basename): Remove unused variable.

Fix issue #4694 "cherry-pick edit after file was moved on source branch"

Add conflict resolver support for cherry-picking changes from files which

have been moved on the merge source branch. Support multiple merge target

candidates, and run a file merge by default if only one candidate exists.

This implementation extends the existing "local move file text merge"

resolution option with support for 'move siblings' as merge targets.

I am still considering whether this case conceptually deserves a dedicated

resolution option. However, it would be nice to backport this feature to

SVN 1.10. The only API change required by this implementation is allowing

another 'option' parameter value for the existing API functions

svn_client_conflict_option_get_moved_to_abspath_candidates()

and svn_client_conflict_option_set_moved_to_abspath(). This change is

ABI compatible, with the only caveat that a new 'svn' binary running

on top of an older libsvn_client could trigger an input assertion.

Because we require 'svn' to be kept in sync with the libraries this

should not be a problem in practice.

We can still improve the API for >= 1.11 later.

* subversion/include/private/svn_wc_private.h

(svn_wc__find_working_nodes_with_basename): Declare.

* subversion/include/svn_client.h

(svn_client_conflict_option_get_moved_to_abspath_candidates,

svn_client_conflict_option_set_moved_to_abspath): Document that

svn_client_conflict_option_local_move_file_text_merge is now

a valid option parameter for these functions.

* subversion/libsvn_client/conflicts.c

(conflict_tree_local_missing_details): Add and document wc_siblings

and preferred_sibling_idx fields.

(collect_sibling_move_candidates): New helper function.

(conflict_tree_get_details_local_missing): Try to find the 'local missing'

node which corresponds to the conflict victim in the working copy.

Technically, this would require scanning the log for every item in the WC.

However, assuming a cherry-pick from a moved file to a non-moved file, we

can use a short-cut: The basename of the non-moved file is already known

because it must match one of the locations which the moved file was moved

from. So we can restrict tracing of log history to nodes with a basename

which occurs in the chain of file moves on the merge source branch.

(resolve_local_move_file_merge, configure_option_local_move_file_merge):

Add support for merging to WC siblings of conflict victims which are

'locally missing'.

(svn_client_conflict_option_get_moved_to_abspath_candidates,

svn_client_conflict_option_set_moved_to_abspath): Add support for the

svn_client_conflict_option_local_move_file_text_merge resolution option.

* subversion/libsvn_wc/node.c

(svn_wc__find_working_nodes_with_basename): New private API function which

simply forwards to wc_db.

* subversion/libsvn_wc/wc-queries.sql

(STMT_SELECT_PRESENT_HIGHEST_WORKING_NODES_BY_BASENAME_AND_KIND): New query.

* subversion/libsvn_wc/wc_db.c

(svn_wc__db_find_working_nodes_with_basename): New wc_db API function which

finds present working nodes with a given basename.

* subversion/libsvn_wc/wc_db.h

(svn_wc__db_find_working_nodes_with_basename): Declare.

* subversion/svn/conflict-callbacks.c

(build_tree_conflict_options, handle_tree_conflict): Support multiple merge target

candidates with the svn_client_conflict_option_local_move_file_text_merge option.

* subversion/tests/libsvn_client/conflicts-test.c

(test_funcs): Mark test_cherry_pick_post_move_edit as PASS.

  1. … 5 more files in changeset.
Remove an unused parameter.

* subversion/include/private/svn_diff_tree.h,

subversion/libsvn_diff/diff_tree.c

(reverse_*,

svn_diff__tree_processor_reverse_create): Remove 'prefix'.

* subversion/libsvn_client/conflicts.c,

subversion/libsvn_client/diff.c,

subversion/libsvn_wc/deprecated.c: Update callers.

  1. … 4 more files in changeset.
Reduce coupling between diff drivers and diff writers.

Let diff drivers anchor the diff-processor at the requested target paths,

rather than sometimes there and sometimes at the parent of one of them, in

summarize mode. The quirky anchoring still persists in non-summarize mode.

* subversion/libsvn_client/diff.c

(diff_driver_info_t): Expand comments.

(diff_wc_wc,

diff_repos_repos,

diff_repos_wc): Remove 'root_relpath' and 'root_is_dir' outputs; instead

anchor the diff processor at the requested targets if no 'ddi' coupling

parameter is given.

(do_diff,

svn_client_diff7,

svn_client_diff_peg7,

svn_client_diff_summarize2,

svn_client_diff_summarize_peg2): Update the calls accordingly.

* subversion/libsvn_client/diff_local.c,

subversion/libsvn_client/client.h

(svn_client__arbitrary_nodes_diff): Remove 'root_relpath' and 'root_is_dir'

outputs. Take an 'anchor_at_given_paths' mode flag and obey it.

* subversion/libsvn_client/diff_summarize.c,

subversion/libsvn_client/client.h

(summarize_baton_t,

send_summary): Remove path adjustment.

(svn_client__get_diff_summarize_callbacks): Remove path adjustment and

an unused parameter.

* subversion/libsvn_wc/diff_local.c,

subversion/include/private/svn_wc_private.h

(svn_wc__diff7): Remove 'root_relpath' and 'root_is_dir' outputs. Take an

'anchor_at_given_paths' mode flag and obey it.

(svn_wc_diff6): Update the call to svn_wc__diff7() accordingly.

  1. … 5 more files in changeset.
* subversion/libsvn_wc/wc_db_wcroot.c

(svn_wc__db_wcroot_parse_local_abspath): Extend use of iterpool, and

destroy it, following r1834812.

* subversion/libsvn_wc/wc_deb_wcroot.c

(svn_wc__db_wcroot_parse_local_abspath) Use an iterpool while trying to find

the abspath of the wcroot

Rename svn_wc__find_repos_node_in_wc() to svn_wc__db_find_repos_node_in_wc().

This namespace is more appropriate for wc_db code, and we might eventually

want to expose a similar libsvn_wc inteface which libsvn_client can use.

No functional change.

* subversion/libsvn_wc/conflicts.c

(svn_wc__guess_incoming_move_target_nodes): Update caller.

* subversion/libsvn_wc/wc_db.c,

subversion/libsvn_wc/wc_db.h

(svn_wc__find_repos_node_in_wc): Rename to ...

(svn_wc__db_find_repos_node_in_wc): ... this.

Use gettext plurals for better messages.

* subversion/libsvn_client/conflicts.c

(describe_incoming_edit_list_modified_revs): Message plural.

* subversion/libsvn_client/patch.c

(strip_path): Likewise.

* subversion/libsvn_wc/props.c

(svn_wc_canonicalize_svn_prop): Likewise.

Approved by: julianfoad

  1. … 2 more files in changeset.
Record the move target path in a moved-away tree conflict skel.

Updates can modify the NODES table in ways which discard local move

information about tree conflict victims. One example is:

echo foo >> epsilon/foo.txt

svn mv epsilon alpha

svn ci # create r2

svn up -r1

svn mv epsilon beta

svn up -r2

When 'epsilon' is updated to r2, a tree conflict is raised and the move

'epsilon' -> 'beta' is deleted from the NODES table. 'beta' remains a copy.

$ svn status

A + beta

! C epsilon

> local dir moved away, incoming dir delete or move upon update

$

The conflict skel for the tree conflict on 'epsilon' now contains:

(tree () moved-away deleted epsilon)

This leaves the resolver with insufficient information about the local

move 'epsilon' -> 'beta' which existed before the update. To resolve this

conflict we must be able to identify the copy 'beta' as one potential move

target. The fact that copyfrom on 'beta' points to 'epsilon' is insufficient

because, in the general case, this copy could have occurred independently

of the tree conflict.

As of this commit, the tree conflict skel also records a move destination

path, 'beta' in our example:

(tree () moved-away deleted epsilon beta)

Apart from recording the path in the skel, this commit introduces no other

visible change in behaviour. In the future, the conflict resolver will be

able to make use of this new information to correlate the copy 'beta' with

the conflict victim 'epsilon' in the above example.

Note that old clients will simply ignore the new extra element at the end

of the conflict skel.

* subversion/libsvn_wc/conflicts.c

(svn_wc__conflict_skel_add_tree_conflict): Add move_dst_op_root_abspath

parameter and append it to the skel if it is non-NULL.

(svn_wc__conflict_read_tree_conflict): Return the move_dst_op_root_abspath

if present in the conflict skel.

(read_tree_conflict_desc, resolve_tree_conflict_on_node,

svn_wc__conflict_tree_update_break_moved_away,

svn_wc__conflict_tree_update_incoming_move,

svn_wc__conflict_tree_update_local_add): Update callers.

* subversion/libsvn_wc/conflicts.h

(svn_wc__conflict_skel_add_tree_conflict,

svn_wc__conflict_read_tree_conflict): Update declaration and docstring.

* subversion/libsvn_wc/questions.c

(internal_conflicted_p): Update caller.

* subversion/libsvn_wc/tree_conflicts.c

(svn_wc__add_tree_conflict): Update caller.

* subversion/libsvn_wc/update_editor.c

(open_root, check_tree_conflict, add_directory, open_directory,

add_file, open_file, change_file_prop): Update callers.

* subversion/libsvn_wc/upgrade.c

(svn_wc__upgrade_conflict_skel_from_raw): Update caller.

* subversion/libsvn_wc/wc_db.c

(revert_maybe_raise_moved_away): Update caller.

* subversion/libsvn_wc/wc_db_update_move.c

(create_tree_conflict, fetch_conflict_details): Update callers.

* subversion/tests/libsvn_wc/conflict-data-test.c

(test_serialize_tree_conflict): Update test expectations.

* subversion/tests/libsvn_wc/op-depth-test.c

(check_db_conflicts): Update caller.

  1. … 2 more files in changeset.
Add an option to the 'revert' APIs to choose whether to delete or keep a

schedule-add file or directory.

Previously reverting a copied (add-with-history) file or directory would

delete it, while reverting a plain add would keep it on disk.

* subversion/include/svn_client.h,

subversion/libsvn_client/deprecated.c,

subversion/libsvn_client/revert.c

(svn_client_revert4): New, revved with a new option 'added_keep_local'.

(svn_client_revert3): Deprecated.

(revert_with_write_lock_baton,

revert): Pass the new option along.

* subversion/include/svn_wc.h,

subversion/libsvn_wc/deprecated.c,

subversion/libsvn_wc/revert.c

(svn_wc_revert6): New, revved with a new option 'added_keep_local'.

(svn_wc_revert5): Deprecated.

(revert_restore):

(revert_wc_data): Allow deleting an on-disk item even in cases (such as a

plain add) where its new metadata status is 'not present'.

(revert,

revert_changelist,

revert_partial): Pass the new option along.

  1. … 4 more files in changeset.
Document the WC format used by Subversion 1.10.x. No functional change.

* subversion/libsvn_wc/wc.h: Update comment.

Don't ignore error returns.

c: [skip]

Found by: danielsh

using tools/dev/warn-unused-result.sh

  1. … 7 more files in changeset.
Merge the 'shelve' branch to trunk (dropping BRANCH-README).
  1. … 11 more files in changeset.
In the conflict resolver, fix the locating of move targets in the

working copy during merges. The previous implementation only worked

for update/switch, because it assumed that a move target's revision

would always match the incoming-new revision of the conflict victim.

This was a design mistake, since this condition won't hold for merges.

Found by: brane

* subversion/include/private/svn_wc_private.h

(svn_wc__guess_incoming_move_target_nodes): Remove 'rev' parameter.

* subversion/libsvn_client/conflicts.c

(follow_move_chains): Move target candidates from libsvn_wc are now

identified only by URL. So check ancestry between the conflict victim

and each move target candiate in case their revisions do not match.

Add 'victim_repos_relpath' parameter.

(init_wc_move_targets, configure_option_local_move_file_merg): Pass the

victim's repos relpath to follow_move_chains().

* subversion/libsvn_wc/conflicts.c

(svn_wc__guess_incoming_move_target_nodes): Remove 'rev' parameter.

* subversion/libsvn_wc/wc-queries.sql

(STMT_FIND_REPOS_PATH_IN_WC): Ignore the revision column.

* subversion/libsvn_wc/wc_db.c

(svn_wc__find_repos_node_in_wc): Remove 'rev' parameter.

* subversion/libsvn_wc/wc_db.h

(svn_wc__find_repos_node_in_wc): Remove 'rev' parameter.

  1. … 2 more files in changeset.
Following up on r1807584, remove unnecessary SQL statements from

the WC schema definition and simplify a step in the upgrade process.

* subversion/libsvn_wc/wc-metadata.sql

(STMT_CREATE_NODES): Remove and include into STMT_CREATE_SCHEMA.

(STMT_CREATE_NODES_TRIGGERS): Likewise.

(STMT_CREATE_EXTERNALS): Likewise.

(STMT_UPGRADE_TO_31_ALTER_TABLE, STMT_UPGRADE_TO_31_FINALIZE):

Combine these statements into a single ...

(STMT_UPGRADE_TO_31): ... which is new.

(STMT_UPGRADE_TO_32): Remove as unused.

(-- format: YYY): Remove as unused, it converted to a comment anyway.

* subversion/libsvn_wc/wc_db.c

(init_db): Remove use of deleted SQL statements.

* subversion/libsvn_wc/upgrade.c

(bump_to_31): Remove the manual check for the existence of the

NODES.inherited_props column since we no longer support the

unreleased formats prior to format 20 that did not have

a NODES table.

* subversion/tests/libsvn_wc/utils.c

(svn_test__create_fake_wc): Remove use of deleted SQL statements.

* subversion/tests/libsvn_wc/wc-queries-test.c

(schema_statements): Remove use of deleted SQL statements.

  1. … 2 more files in changeset.
Following up on r1807584 remove more dead code, which should fix the build

breakage caused by that previous patch.

* subversion/libsvn_wc/upgrade.c

(read_tree_conflicts,

migrate_single_tree_conflict_data,

migrate_tree_conflict_data): Remove functions.