subversion

Checkout Tools
  • last updated 1 hour ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates

Changeset 1357719 is being indexed.

Make the upgrade from entries capable of upgrading to conflict skels.

This resolves the last 2 test failures when running with conflict skels.

* subversion/libsvn_wc/entries.c

(includes): Add conflicts.h.

(insert_actual_node): Add db and wri_abspath arguments to allow using the

conflict api. Check all columns like in other places.

Add conflict skel implementation.

(write_entry,

write_actual_only_entries,

svn_wc__write_upgraded_entries): Update caller.

Detect actual only nodes by checking if the node has only an actual record,

instead of detecting if the node is tree conflicted.

The result is only used for notifications if there is no other reason to tell

that the node used to be modified.

* subversion/libsvn_wc/wc-queries.sql

(STMT_CREATE_REVERT_LIST): Use subquery to determine if a node is actual

only twice.

* subversion/libsvn_wc/wc_db.c

(revert_list_read): Remove now unneeded check.

* subversion/libsvn_wc/conflicts.c

(svn_wc__conflict_invoke_resolver): Run the workqueue after resolving a text

conflict.

* tools/dev/benchmarks/suite1/run: disable debug flag.

* tools/dev/benchmarks/suite1/run.bat: Mark outdated.

Following up on the recent interactive conflict handling changes in svn, stop

abusing svn_client_ctx_t's resolver as a temporary variable by storing some

state in the option state.

This allows reverting some changes in libsvn_client that changed the library

behavior. And this then should fix the javahl tests.

* subversion/libsvn_client/merge.c

(merge_dir_props_changed): Restore old behavior. Provide left and right

locations for recording the conflict.

(merge_file_changed): Restore old behavior.

* subversion/svn/cl.h

(svn_cl__opt_state_t): Store interactive resolver in this.

(svn_cl__resolve_conflicts): Add opt_state argument.

* subversion/svn/conflict-callbacks.c

(svn_cl__resolve_conflicts): Just enable the interactive handling from

this specific point and restore old values.

* subversion/svn/main.c

(main): Set conflict handler in opt_state instead of ctx.

* subversion/svn/merge-cmd.c

(svn_cl__merge): Remove ctx changes. Call interactive resolver on opt_state.

* subversion/svn/resolve-cmd.c

(svn_cl__resolve): Verify the right variable. Set and restore interactive

handler.

* subversion/svn/switch-cmd.c

(svn_cl__switch): Remove ctx changes. Call interactive resolver on opt_state.

* subversion/svn/update-cmd.c

(svn_cl__update): Remove ctx changes. Call interactive resolver on opt_state.

* subversion/svn/export-cmd.c

(svn_cl__export): Don't leak 'err' if an externals error occurred and

'err' is not SVN_ERR_WC_OBSTRUCTED_UPDATE.

Don't lose the "Failure occurred processing one or more externals definitions"

error message if an unrelated error occurs. For instance, errors returned

from the conflict resolver would mask the "externals error" message.

* subversion/svn/switch-cmd.c

(svn_cl__switch): Don't return the "externals processing" error directly,

but merge it with any other potential errors from later function calls.

* subversion/svn/update-cmd.c

(svn_cl__update): As previous.

Follow-up to r1357363:

* subversion/svn/merge-cmd.c

(svn_cl__merge): Handle errors returned from reintegrate merges.

Fixes test failures due to abort() because of leaked errors.

Revamp benchmarks/suite1, as promised on the hackathon. A slight code bomb.

Use an SQLite db to record all timings ever measured. Add capability to

generate charts from recorded data. Commandline interface has changed,

featuring a way to indicate slices of recorded timings to show/compare/chart.

* tools/dev/benchmarks/suite1/benchmark.py: Revamp.

* tools/dev/benchmarks/suite1/run:

Adjust so that it does roughly the same, except, since all timings are now

recorded, only run the 1.7.0 tag once instead of N times every week.

Todo: Actually ask benchmark.py for charts and show them to the dev list.

Transform the base-remove workqueue operation into an atomic wc_db operation

that dynamically creates multiple workqueue operations that transform the

local working copy later.

This removes the last place in the workqueue that may change the NODE

presence/status during its operations. (Except for legacy and upgrade).

This patch removes several ugly corner cases around actual only nodes in

the original implementation of the db function.

* subversion/libsvn_wc/externals.c

(svn_wc__external_remove): Update caller. Run workqueue instead of manually

removing a file.

* subversion/libsvn_wc/update_editor.c

(delete_entry): Handle all changes via a single call to

svn_wc__db_base_remove, instead of applying multiple small operations.

* subversion/libsvn_wc/wc-queries.sql

(STMT_SELECT_BASE_PRESENT,

STMT_DELETE_ACTUAL_FOR_BASE_RECURSIVE,

STMT_DELETE_WORKING_BASE_DELETE,

STMT_DELETE_WORKING_RECURSIVE,

STMT_DELETE_BASE_RECURSIVE): New queries.

* subversion/libsvn_wc/wc_db.c

(base_get_info): Add prototype.

(base_remove_baton): Add new arguments.

(db_base_remove): Implement as recursive operation via several new Sqlite

statements.

(svn_wc__db_base_remove): Pass arguments via baton.

(svn_wc__db_base_remove): Update caller.

* subversion/libsvn_wc/wc_db.h

(svn_wc__db_base_remove): Update prototype and documentation.

* subversion/libsvn_wc/workqueue.c

(names): Add OP_DIRECTORY_REMOVE. Sort legacy items at the bottom.

(remove_base_node): Remove function.

(run_base_remove): Just call svn_wc__db_base_remove.

(svn_wc__wq_build_base_remove): Remove function.

(run_dir_remove,

svn_wc__wq_build_dir_remove): New function.

(dispatch_table): Add OP_DIRECTORY_REMOVE. Sort legacy items at the bottom.

* subversion/libsvn_wc/workqueue.h

(svn_wc__wq_build_dir_remove): New function.

(svn_wc__wq_build_base_remove): Remove function.

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

(includes): Add workqueue.h.

(base_dir_insert_remove): Run workqueue to avoid an error on closing

the db.

* subversion/svn/merge-cmd.c

(svn_cl__merge): Resolve possible error leak.

* subversion/libsvn_wc/wc-queries.sql

(STMT_DROP_REVERT_LIST): Following up on r1357376, revert this specific

query as the revert error handling also executes this query if the table

hasn't been added.

* subversion/libsvn_wc/wc_db.c

(get_conflict_marker_files): Fix column index to really retrieve the skel

instead of NULL. Don't perform unneeded copy to scratch_pool.

Make the base_remove wc_db api code that determines if an actual only node

should be left explicitly retrieve the conflict in preparation for moving to

the common conflict skel.

* subversion/libsvn_wc/wc-queries.sql

(STMT_DELETE_ACTUAL_NODE_WITHOUT_CONFLICT): Remove unused query.

* subversion/libsvn_wc/wc_db.c

(base_remove_baton): New struct.

(db_base_remove): Check if there is an actual node row without a tree

conflict and if there is, remove it.

(db_op_mark_resolved): Interpret output of svn_wc__conflict_skel_resolve

correctly.

(bump_node_revision): Update caller.

(bump_revisions_baton_t): Add db variable.

(bump_revisions_post_update,

svn_wc__db_op_bump_revisions_post_update): Pass db variable.

* subversion/libsvn_wc/wc-queries.sql

(STMT_SELECT_ACTUAL_TREE_CONFLICT,

STMT_SELECT_ACTUAL_CHANGELIST): Remove unused statements.

(STMT_DELETE_ACTUAL_NODE_WITHOUT_CONFLICT): Also keep the node

when there is a new-style conflict skel.

Following up on r1357362, fix more errors in the retrieval of all marker

paths.

* subversion/libsvn_wc/conflicts.c

(svn_wc__conflict_read_markers): Propertly use pstrmemdup().

* subversion/libsvn_wc/wc_db.c

(revert_list_read_baton): Add db variable.

(revert_list_read): Fix compilation of the skel mode code.

(svn_wc__db_revert_list_read): Update caller.

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

(test_serialize_text_conflict): Extend test a bit to really verify the

paths.

When done with temporary tables and triggers explicitly drop them, to avoid

dropping unintentional items (or forgetting to drop intentional items).

This leaves similar fixups for when creating the tables and triggers.

* subversion/libsvn_wc/wc-queries.sql

(STMT_FINALIZE_CHANGELIST): Drop the right trigger explicitly.

(STMT_DROP_TARGETS_LIST,

STMT_DROP_TARGET_PROP_CACHE,

STMT_DROP_REVERT_LIST_TRIGGERS,

STMT_DROP_REVERT_LIST,

STMT_FINALIZE_DELETE): Drop explicitly.

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

(schema_statements): Add STMT_CREATE_CHANGELIST_TRIGGER.

* subversion/svn/merge-cmd.c

(svn_cl__merge): Avoid possible error leaks due to overlapping use of an

'err' variable and the SVN_ERR() macro. Use a separate 'merge_err'

variable to store errors returned from merge operations, and don't

leak it even if functions called after the merge operation return errors.

Fix a skel check in svn_wc__conflict_read_markers() that segfaulted when

used from the experimental conflict skel mode.

* subversion/libsvn_wc/conflicts.c

(svn_wc__conflict_read_markers): Fix finding markers.

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

(test_serialize_text_conflict): Read the markers.

* subversion/svn/notify.c

(svn_cl__notifier_get_conflicted_paths): Return a proper result array

containing const char * paths instead of elements of the wrong type

svn_sort__item_t.

Make the conflict handling in the revert code ready for conflict skels

by using an array of marker paths instead of specific markers.

(This also allows a simple loop in the callers)

* subversion/libsvn_wc/adm_ops.c

(revert_restore): Update caller. Loop over the conflict markers.

* subversion/libsvn_wc/wc-queries.sql

(STMT_CREATE_REVERT_LIST):

Add conflict_data blob and fill it in the triggers.

(STMT_SELECT_REVERT_LIST): Reorder columns to move the conflicts at the

end.

* subversion/libsvn_wc/wc_db.c

(revert_list_read_baton): Store marker list.

(revert_list_read): Collect a list of markers and add conflict skel code.

(svn_wc__db_revert_list_read): Use marker list.

* subversion/libsvn_wc/wc_db.h

(svn_wc__db_revert_list_read): Update prototype and documentation.

Make 'svn merge' print the conflict summary before showing output from the

conflict resolver, and also restrict post-merge interactive resolution

to paths which got new conflicts flagged during the merge operation.

Corresponds to changes made for 'svn update' in r1357298 and r1357313.

* subversion/libsvn_client/merge.c

(merge_dir_props_changed, merge_file_changed): Invoke the conflict callback

from the client context again.

(merge_locked, merge_peg_locked, do_symmetric_merge_locked): Stop resolving

conflicts before returning.

* subversion/svn/merge-cmd.c

(svn_cl__merge): Postpone conflict resolution during the merge operation.

Run the conflict resolver on any paths which got conflicts flagged during

the merge operation.

Add support for resolving specific conflicts when using the currently still

disabled conflict-skel storage.

* subversion/libsvn_wc/conflicts.c

(svn_wc__conflict_skel_resolve): New function.

* subversion/libsvn_wc/conflicts.h

(svn_wc__conflict_skel_resolve): New function.

* subversion/libsvn_wc/wc_db.c

(op_mark_resolved_baton): Add db.

(db_op_mark_resolved): Add implementation for conflict skel storage. Return

an error when operating on non-existing paths.

Make 'svn switch' print the conflict summary before showing output from the

conflict resolver, and also restrict post-switch interactive resolution

to paths which got new conflicts flagged during the switch operation.

Corresponds to changes made for 'svn update' in r1357298 and r1357313.

* subversion/libsvn_client/switch.c

(switch_internal): Always invoke the conflict callback provided by the

client context. Stop invoking the conflict resolver before returning.

* subversion/svn/switch-cmd.c

(svn_cl__switch): Force conflicts to be postponed during the switch

operation, and run the resolver on any paths which got conflicts flagged

during the switch.

When running the conflict resolver at the end of an 'svn update' operation,

resolve conflicts only on paths which got new conflicts flagged during the

update operation, rather than also resolving conflicts which were left behind

within the update targets by some other operation.

* subversion/svn/cl.h

(svn_cl__notifier_get_conflicted_paths): Declare.

* subversion/svn/notify.c

(notify_baton): Add conflicted_paths hash.

(add_conflicted_path): New helper to add a conflicted path to above hash.

(notify): Add any confliced paths to above hash.

(svn_cl__get_notifier): Initialise the conflicted_paths hash.

(svn_cl__notifier_get_conflicted_paths): Return a path-wise sorted array

of confliced paths added during notification.

* subversion/svn/update-cmd.c

(svn_cl__update): Pass the list of newly conflicted paths to the resolver,

rather than passing the entire update target list.

Make 'svn update' display conflict summary information before the interactive

conflict resolver is started, and don't invoke the conflict resolver if no

conflicts occurred during the current update operation but there are unresolved

conflicts from a previous update operation.

While trying various ways of achieving the goal of this commit, I came to

the conclusion that it is easier for client implementors to invoke the conflict

resolver themselves, rather than having the libsvn_client library invoke it.

So this commit also changes the corresponding libsvn_client code back to

its pre-r1353734 state and gives back full control over whether conflicts

are postponed during the update operation to libsvn_client API users.

Similar changes for switch and merge will follow.

* subversion/libsvn_client/checkout.c

(svn_client__checkout_internal): Track parameter list changes to

svn_client__update_internal().

* subversion/libsvn_client/client.h

(svn_client__update_internal): Remove cONFLICT_FUNC2 and CONFLICT_BATON2

paramters from function declaration.

* subversion/libsvn_client/externals.c

(switch_dir_external): Track paramter list changes to

svn_client__update_internal().

* subversion/libsvn_client/update.c

(update_internal, svn_client__update_internal): Drop the CONFLICT_FUNC2 and

CONFLICT_BATON2 parameters. Always invoke the conflict resolution callback

provided in the client context.

(svn_client_update4): Track above parameter list changes, and stop invoking

the conflict resolver before returning. This gives control over when the

conflict resolver runs back to API users.

* subversion/svn/cl.h

(svn_cl__notifier_check_conflicts, svn_cl__resolve_conflicts): Declare.

* subversion/svn/conflict-callbacks.c

(svn_cl__resolve_conflicts): New helper function that runs the resolver

on a specified list of targets.

* subversion/svn/notify.c

(svn_cl__notifier_check_conflicts): New helper to determine whether conflicts

occurred during an operation.

* subversion/svn/update-cmd.c

(svn_cl__update): Set the conflict callback in the client context to NULL

before calling svn_client_update(), postponing all conflicts. If conflicts

were reported during the update, run the conflict resolver.

* subversion/tests/cmdline/update_tests.py

(update_accept_conflicts): Adjust expected output. The conflict summary is

now printed before output from the conflict resolver is displayed, not after.

Prepare one more code path for switching to conflict skels: the

code to avoid copying conflit marker files from 'svn copy'.

Make the wc_db api more generic, assuming that the current only caller

only uses a lookup to check if paths are in the list.

* subversion/libsvn_wc/conflicts.c

(svn_wc__conflict_read_markers): New function.

* subversion/libsvn_wc/conflicts.h

(svn_wc__conflict_read_markers): New function.

* subversion/libsvn_wc/copy.c

(copy_versioned_dir): Assume that svn_wc__db_get_conflict_marker_files

returns absolute paths instead of just basenames.

* subversion/libsvn_wc/wc-queries.sql

(STMT_SELECT_CONFLICT_VICTIMS): Also check conflict_data for conflicts.

Return conflict_data as second column.

* subversion/libsvn_wc/wc_db.c

(svn_wc__db_read_conflict_victims): Update statement reference.

(marker_files_baton): New struct.

(get_conflict_marker_files): Use baton. Add implementation for conflict skel

storage.

(svn_wc__db_get_conflict_marker_files): Update caller.

* subversion/libsvn_wc/wc_db.h

(svn_wc__db_get_conflict_marker_files): Update documentation.

Tweak some sqlite queries in preparation for the future move to conflict

skels.

* subversion/libsvn_wc/entries.c

(insert_actual_node): Update columns and document what has to be done.

* subversion/libsvn_wc/wc-queries.sql

(STMT_UPDATE_CLEAR_TREE_CONFLICT): Rename to ...

(STMT_CLEAR_TREE_CONFLICT): ... this, to match siblings.

(STMT_INSERT_ACTUAL_NODE): Reorder arguments and include conflict_data.

* subversion/libsvn_wc/wc_db.c

(copy_actual): Simplify usage.

(db_op_mark_resolved): Update query.

Make it an error to perform a text or property merge into an already conflicted

node. We can't store two conflicts of the same kind on a node.

(And even if we could, it would be very hard to provide a UI to resolve the

conflict).

'svn merge' should probably provide some more user friendly handling for this

case. Just blocking merging into a somewhere conflicted tree currently breaks

a lot of tests, while it is certainly *not* best practice to merge into a

conflicted tree.

* subversion/libsvn_wc/conflicts.c

(svn_wc__conflict_create_markers): Remove ugly corner case. The new

behavior is that a second .prej file is created when this case is hit,

so there is at least some evidence that the property conflict was

deleted.

* subversion/libsvn_wc/merge.c

(svn_wc_merge5): Detect merging into an already conflicted node.

* subversion/libsvn_wc/props.c

(svn_wc__perform_props_merge): Detect merging into an already conflicted

node.

* subversion/tests/cmdline/merge_tests.py

(expected_merge_output,

svn_merge): Allow passing a list of resolved targets.

(merge_two_edits_to_same_prop): Accept the conflict before merging again.