changelist_tests.py

Checkout Tools
  • last updated 1 hour ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
Follow-up to r1865929: Change test to XFail, adding issue number.
Follow-up to r1865929: Restore Windows compatibility in test.
Add a test for issue #4826, diff repos-wc non-infinite depth uses wrong depth.
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.
Following up on r1662794, make the checkout/switch/update logic in the python

test framework use the standard run_and_verify_svn stderr handling, and replace

the 4 singleton arguments of these functions with a completely optional

extra_files args (which handles the only current usage in a better way than

before), that verifies that these files are actually there.

In one case we still installed a singleton handler to allow extra files,

but found no files since the introduction of tree conflicts. (Probably 1.6.0)

The new code would return failure because the files are not here.

* subversion/tests/cmdline/authz_tests.py

* subversion/tests/cmdline/basic_tests.py

* subversion/tests/cmdline/changelist_tests.py

* subversion/tests/cmdline/checkout_tests.py

* subversion/tests/cmdline/copy_tests.py

* subversion/tests/cmdline/depth_tests.py

* subversion/tests/cmdline/diff_tests.py

* subversion/tests/cmdline/externals_tests.py

* subversion/tests/cmdline/import_tests.py

* subversion/tests/cmdline/info_tests.py

* subversion/tests/cmdline/input_validation_tests.py

* subversion/tests/cmdline/log_tests.py

* subversion/tests/cmdline/merge_authz_tests.py

* subversion/tests/cmdline/merge_automatic_tests.py

* subversion/tests/cmdline/merge_reintegrate_tests.py

* subversion/tests/cmdline/merge_tests.py

* subversion/tests/cmdline/merge_tree_conflict_tests.py

* subversion/tests/cmdline/move_tests.py

* subversion/tests/cmdline/prop_tests.py

* subversion/tests/cmdline/resolve_tests.py

* subversion/tests/cmdline/revert_tests.py

* subversion/tests/cmdline/special_tests.py

* subversion/tests/cmdline/stat_tests.py

* subversion/tests/cmdline/svnversion_tests.py

* subversion/tests/cmdline/switch_tests.py

* subversion/tests/cmdline/trans_tests.py

* subversion/tests/cmdline/tree_conflict_tests.py

* subversion/tests/cmdline/update_tests.py

* subversion/tests/cmdline/wc_tests.py

(*): Update caller. Simplify commands where possible. Tried not to

introduce behavior changes.

* subversion/tests/cmdline/svntest/actions.py

(run_and_verify_checkout2,

run_and_verify_checkout): Remove several arguments. Add dynamic keywords.

Update caller.

(verify_update): Define extra_files. Forward to disk comparison.

(verify_disk): If extra_files is set, set singleton handlers and a (new)

done handler. If needed we can add other tests this way.

(run_and_verify_update,

run_and_verify_merge): Remove some arguments. Add dynamic keywords.

Use run_and_verify_svn.

(run_and_verify_patch): Add dynamic keyword support.

(run_and_verify_switch,

run_and_verify_commit): Remove some arguments. Add dynamic keywords.

Use run_and_verify_svn.

(build_greek_tree_conflicts): Update caller.

* subversion/tests/cmdline/svntest/deeptrees.py

(deep_trees_run_tests_scheme_for_update,

deep_trees_skipping_on_update,

deep_trees_run_tests_scheme_for_switch,

deep_trees_run_tests_scheme_for_merge,

do_routine_switching): Update caller. Convert None error to [].

* subversion/tests/cmdline/svntest/factory.py

(TestFactory): Update templates.

* subversion/tests/cmdline/svntest/mergetrees.py

(set_up_dir_replace): Update caller.

* subversion/tests/cmdline/svntest/tree.py

(detect_conflict_files_done): New function.

  1. … 33 more files in changeset.
Make the standard commit logic in the test suite a bit stricter and easier

to use by using the existing run_and_verify_svn() infrastructure for

verifying the error result. When no arguments are passed, pass the directory

used for verifying the result, just like run_and_verify_update() and its

variants.

We already removed an argument from this function for 1.9, so cleaning it

up a bit more won't affect backporting.

* subversion/test/cmdline/authz_tests.py

* subversion/test/cmdline/basic_tests.py

* subversion/test/cmdline/blame_tests.py

* subversion/test/cmdline/changelist_tests.py

* subversion/test/cmdline/checkout_tests.py

* subversion/test/cmdline/commit_tests.py

* subversion/test/cmdline/copy_tests.py

* subversion/test/cmdline/depth_tests.py

* subversion/test/cmdline/diff_tests.py

* subversion/test/cmdline/entries_tests.py

* subversion/test/cmdline/export_tests.py

* subversion/test/cmdline/externals_tests.py

* subversion/test/cmdline/history_tests.py

* subversion/test/cmdline/lock_tests.py

* subversion/test/cmdline/log_tests.py

* subversion/test/cmdline/merge_authz_tests.py

* subversion/test/cmdline/merge_reintegrate_tests.py

* subversion/test/cmdline/merge_tests.py

* subversion/test/cmdline/merge_tree_conflict_tests.py

* subversion/test/cmdline/mergeinfo_tests.py

* subversion/test/cmdline/patch_tests.py

* subversion/test/cmdline/prop_tests.py

* subversion/test/cmdline/relocate_tests.py

* subversion/test/cmdline/resolve_tests.py

* subversion/test/cmdline/revert_tests.py

* subversion/test/cmdline/schedule_tests.py

* subversion/test/cmdline/special_tests.py

* subversion/test/cmdline/stat_tests.py

* subversion/test/cmdline/svnauthz_tests.py

* subversion/test/cmdline/svnlook_tests.py

* subversion/test/cmdline/svnversion_tests.py

* subversion/test/cmdline/switch_tests.py

* subversion/test/cmdline/trans_tests.py

* subversion/test/cmdline/tree_conflict_tests.py

* subversion/test/cmdline/update_tests.py

Tweak tests. Remove unneeded args if possible without changing behavior.

* subversion/test/cmdline/svntest/actions.py

(run_and_verify_commit): Update error argument name and behavior. Supply

default args if none ar provided.

(inject_conflict_into_wc,

build_greek_tree_conflicts): Update caller.

* subversion/test/cmdline/svntest/deeptrees.py

(deep_trees_run_tests_scheme_for_update,

deep_trees_run_tests_scheme_for_switch,

deep_trees_run_tests_scheme_for_merge,

commit_routine_switching): Update caller.

* subversion/test/cmdline/svntest/mergetrees.py

(set_up_dir_replace,

set_up_branch): Update caller.

  1. … 37 more files in changeset.
Remove the 'message' argument from the test suite's run_and_verify_*()

functions, because it is largely pointless.

Enough context information is available by other means, and it wasn't being

displayed for stdout mismatch which is the most common failure mode but only

for exit-code mismatch, and most callers pass 'None' anyway. It cluttered

the call sites.

* subversion/tests/cmdline/svntest/actions.py

(run_and_verify_atomic_ra_revprop_change,

run_and_verify_svnlook, run_and_verify_svnlook2,

run_and_verify_svnadmin, run_and_verify_svnadmin2,

run_and_verify_svnversion, run_and_verify_svnversion2,

run_and_verify_svn, run_and_verify_svn2,

run_and_verify_svnmucc, run_and_verify_svnmucc2,

run_and_verify_atomic_ra_revprop_change,

run_and_verify_svnauthz,

run_and_verify_log_xml): Remove 'message' parameter.

(guarantee_greek_repository,

run_and_verify_dump): Adjust calls.

* subversion/tests/cmdline/svntest/*.py

Adjust calls.

* subversion/tests/cmdline/*_tests.py

Adjust calls.

  1. … 58 more files in changeset.
Further clean up the ExpectedOutput classes in the test suite.

* subversion/tests/cmdline/svntest/verify.py

(ExpectedOutput, RegexOutput): Write proper doc strings. Give each class

its own __init__() method. Override the matches() method instead of

delegating to an is_equivalent_list() method. Simplify logic and pre-

compile regular expressions.

(UnorderedOutput): The same, and don't support the 'match_all=False' case

as we don't need it.

(UnorderedRegexOutput): The same, and don't use multiple inheritance as we

don't need it.

* subversion/tests/cmdline/externals_tests.py

(pinned_externals): Make the argument to RegexOutput() a string not a

list, for consistency with everywhere else, as it's now enforced.

* subversion/tests/cmdline/changelist_tests.py

(tree_conflicts_and_changelists_on_commit): Use RegexOutput instead of

UnorderedRegexOutput because that's all we need and UnorderedRegexOutput

no longer supports this 'match any' usage.

  1. … 2 more files in changeset.
Replace many local reimplementations of svntest.actions.verify_disk() with

a call to this standard function.

* subversion/tests/cmdline/changelist_tests.py

(propmods_with_changelists):

* subversion/tests/cmdline/copy_tests.py

(copy_replace_with_props,

revision_kinds_local_source,

copy_added_paths_with_props,

copy_peg_rev_local_files,

copy_peg_rev_local_dirs):

* subversion/tests/cmdline/merge_tests.py

(merge_added_subtree):

* subversion/tests/cmdline/prop_tests.py

(make_local_props,

props_on_replaced_file,

rm_of_replaced_file,

obstructed_subdirs):

* subversion/tests/cmdline/svnadmin_tests.py

(load_and_verify_dumpstream):

* subversion/tests/cmdline/revert_tests.py

(revert_replacement_with_props,

revert_file_merge_replace_with_history,

revert_after_second_replace,

revert_with_unversioned_targets):

Replace local code by call to verify_disk()

* subversion/tests/cmdline/svntest/actions.py

(run_and_verify_checkout2): Replace local reimplementation with call to

verify_disk().

(verify_update): Extract disk verification code from here and place it into

(verify_disk): .. this function, that used to call verify_update.

  1. … 6 more files in changeset.
Per discussion on IRC, and in compliance with one of the suggestions

found at http://subversion.tigris.org/issues/show_bug.cgi?id=3348#desc10,

revert the changes (r1159286, r1159299, and r1160691) which caused the

empty-string changelist name (as applied to the --changelist option)

to be specially handled.

  1. … 4 more files in changeset.
Avoid some unneeded work when setting and clearing changelists.

* subversion/libsvn_wc/wc-queries.sql

(STMT_CREATE_CHANGELIST_LIST): Give table a primary key.

Replace three separate triggers with one simpler one.

* subversion/libsvn_wc/wc_db.c

(set_changelist_txn): Don't create unneeded actual nodes, when we are just

clearing the changelists.

* subversion/tests/cmdline/changelist_tests.py

(verify_changelist_output): First show what changed, before erroring on the

number of lines.

(add_remove_changelists): Use sbox.ospath() to improve readability.

  1. … 2 more files in changeset.
*** THIS CHANGE REVERTED IN r1428585 ***

Blindly attempt to fix the windows buildbot.

* subversion/tests/cmdline/changelist_tests.py

(empty_pseudo_changelist): Respect os.path.sep.

*** THIS CHANGE REVERTED IN r1428585 ***

Fix issue #3348, 'Provide syntax which means "include all files not in a

changelist"'.

[ Question: why is filtering done twice, both in adm_ops.c and in status.c? ]

* subversion/libsvn_wc/adm_ops.c

(svn_wc__internal_changelist_match):

Special case the empty changelist name as "not in a changelist".

* subversion/libsvn_client/status.c

(tweak_status):

Special case the empty changelist name as "not in a changelist".

* subversion/tests/cmdline/changelist_tests.py

(empty_pseudo_changelist): New test.

(test_list): Run it.

* subversion/svn/main.c

(main):

Drop a validation which is already done by

svn_client_add_to_changelist() and is now bogus.

  1. … 3 more files in changeset.
Resolve issue #3985, "Re: 1.7 corrupts WC when reverting add of changelist

member".

* subversion/libsvn_wc/wc-queries.sql

(STMT_DELETE_ACTUAL_NODE_LEAVING_CHANGELIST): Don't check a column against

itself.

(STMT_DELETE_ACTUAL_NODE_LEAVING_CHANGELIST_RECURSIVE): Resolve the same

problem, but in this case use the explicit name of the other table.

* subversion/tests/cmdline/changelist_tests.py

(readd_after_revert): Remove XFail and add issue number.

  1. … 1 more file in changeset.
Add XFail test for 1.7 issue reported in the users@s.a.o thread

"Re: 1.7 corrupts WC when reverting add of changelist member".

* subversion/tests/cmdline/changelist_tests.py

(readd_after_revert): New function.

(test_list): Add readd_after_revert.

Make the 'populate target tree' code in wc_db.c return an error when it

receives an nonexisting node as (root-)target.

(This also resolves some remaining parts of issue #3779)

* subversion/libsvn_wc/wc-queries.sql

(STMT_INSERT_TARGET_DEPTH_INFINITY,

STMT_INSERT_TARGET_WITH_CHANGELIST_DEPTH_INFINITY): Avoid the LIKE operator

when we can use an index to obtain the same result.

* subversion/libsvn_wc/wc_db.c

(populate_targets_tree): Don't pass/generate the like argument. Obtain the

number of affected rows and check if the node actually exists if the number

of affected rows is 0.

* subversion/svn/changelist-cmd.c

(svn_cl__changelist): Return an error when an error occurred, just like

the other svn commands that handle SVN_WC_PATH_NOT_FOUND.

* subversion/tests/cmdline/changelist_tests.py

(add_remove_non_existent_target,

add_remove_unversioned_target): New tests. Based on a patch by Noorul

Islam K M, but tweaked for the different error handling.

(test_list): Add new tests.

* subversion/tests/cmdline/tree_conflict_tests.py

(actual_only_node_behaviour): Update expected result and remove review marker

as we now produce a warning.

Found by: danielsh

Noorul Islam K M <noorul{_AT_}collab.net>

stsp

  1. … 4 more files in changeset.
Expand the testsuite to test 'proplist --changelist'.

* subversion/tests/cmdline/changelist_tests.py

(propmods_with_changelists): Add a scenario which uses proplist.

Fix issue 3820, replacing a file with a directory clears any changelist.

* subversion/libsvn_wc/wc_db.c

(insert_working_node): Remove any changelist for directories.

* subversion/libsvn_wc/adm_ops.c

(add_from_disk): Don't remove changelist.

* subversion/libsvn_wc/wc-queries.sql

(STMT_UPDATE_ACTUAL_CLEAR_CHANGELIST): New.

* subversion/tests/cmdline/changelist_tests.py

(change_to_dir): Remove XFAIL, restore changelist before testing

that merge removes it.

  1. … 3 more files in changeset.
Remove two hacks from the info calculation.

* subversion/libsvn_wc/info.c

(build_info_for_entry): Store the real depth and changelist.

* subversion/svn/info-cmd.c

(print_info_xml): Print depth infinity for files with depth unknown.

* subversion/tests/cmdline/changelist_tests.py

(change_to_dir): Mark XFail. This issue wasn't fixed: the test was broken.

  1. … 2 more files in changeset.
Improve a test exception message.

* subversion/tests/cmdline/changelist_tests.py

(verify_pget_output): If this fails, tell what we got and what we expected.

Make delete remove actual nodes with tree conflicts, thus resolving them.

* subversion/libsvn_wc/wc_db.h

(svn_wc__db_base_add_file): Add insert_base_deleted parameter.

* subversion/libsvn_wc/wc_db.c

(struct insert_base_baton_t): Add member.

(insert_base_node): Insert base-deleted node.

(svn_wc__db_base_add_file): Add insert_base_deleted parameter.

(op_delete_txn): Delete actual nodes with tree conflicts.

* subversion/tests/libsvn_wc/db-test.c

(test_inserting_nodes): Adjust svn_wc__db_base_add_file call.

* subversion/libsvn_wc/update_editor.c

(add_directory): Set tree conflict after deleting directory.

(close_file): Use svn_wc__db_base_add_file to insert base-deleted

rather than calling svn_wc__db_op_delete.

* subversion/tests/cmdline/tree_conflict_tests.py

(query_absent_tree_conflicted_dir): Adjust expectations.

* subversion/tests/cmdline/changelist_tests.py

(tree_conflicts_and_changelists_on_commit2): Don't delete absent

dir, adjust expectations.

(tree_conflicts_and_changelists_on_commit3): Remove since it is now

equivalent to tree_conflicts_and_changelists_on_commit2.

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

(do_delete): Add actual before and after parameters.

(test_op_delete): Adjust do_delete calls, add actual node test.

  1. … 7 more files in changeset.
Verify the 'mkdir' output in a Python test.

* subversion/tests/cmdline/changelist_tests.py

(_re_cl_rem_pattern): Split from _re_cl_rem.

(change_to_dir): Verify that a 'removed from changelist' notification is generated.

(I believe the verification has room for improvement, here.)

* subversion/tests/cmdline/changelist_tests.py

(change_to_dir): Extend to cover a merge that replaces a file with a dir.

(This is a test for issue #3820.)

Fix issue #3820, "Replacing file with dir should remove file from changelist".

* subversion/tests/cmdline/changelist_tests.py

(change_to_dir): Expect it to pass.

* subversion/libsvn_wc/adm_ops.c

(add_from_disk):

Explicitly set "no changelist" when adding a directory.

Grow NOTIFY_FUNC and NOTIFY_BATON parameters.

(svn_wc_add4):

Allow setting "no changelist" on directories.

Pass NOTIFY_FUNC and NOTIFY_BATON to add_from_disk().

  1. … 1 more file in changeset.
Fix issue #3822 "revert should not remove files from changelist".

* subversion/tests/cmdline/changelist_tests.py

(revert_deleted_in_changelist): Expect it to pass.

* subversion/libsvn_wc/wc_db.h

(svn_wc__db_op_revert_actual):

Document that it doesn't revert changelists. (This function has only

one caller, so I made the non-reverting of changelists non-optional.)

* subversion/libsvn_wc/wc_db.c

(svn_wc__db_op_revert_actual):

Use an SQL query that doesn't delete nodes with changelists. (There is

already a "clear everything but changelist association" if() further down

the function.)

  1. … 2 more files in changeset.
Add XFAIL changelist tests for issues 3820 and 3822.

* subversion/tests/cmdline/changelist_tests.py

(change_to_dir, revert_deleted_in_changelist): New.

(test_list): Add new tests

Use Python decorators to denote XFail, Skip, SkipUnless and Wimp tests. Also,

add Issue decorators where appropriate.

* subversion/tests/cmdline/*.py:

As above.

* subversion/tests/cmdline/svntest/testcase.py

(XFail): Renamed to _XFail.

(Wimp): Renamed to _Wimp.

(Skip): Renamed to _Skip, and propagate the issue list.

(SkipUnless): Renamed to _SkipUnless.

(XFail_deco): Add a conditional function argument.

(Skip_deco): Make the conditional function optional.

(SkipUnless_deco): Propagate the issue list.

  1. … 46 more files in changeset.
Fix tests broken by r1064458 by updating the expected output.

This makes the test check the apr_err return by the library --- except for

those cases where both the cmdline client and the library do a validation,

where it just checks that the cmdline client *still* returns E205000.

In one case, the current output is

"svn: Skipping argument: E123456: '.+' ends in a reserved name".

* subversion/tests/cmdline/cat_tests.py

* subversion/tests/cmdline/changelist_tests.py

* subversion/tests/cmdline/diff_tests.py

* subversion/tests/cmdline/autoprop_tests.py

* subversion/tests/cmdline/input_validation_tests.py

* subversion/tests/cmdline/prop_tests.py

* subversion/tests/cmdline/special_tests.py

* subversion/tests/cmdline/update_tests.py

* subversion/tests/cmdline/commit_tests.py

* subversion/tests/cmdline/merge_tests.py

* subversion/tests/cmdline/lock_tests.py

* subversion/tests/cmdline/switch_tests.py

* subversion/tests/cmdline/stat_tests.py

* subversion/tests/cmdline/basic_tests.py

* subversion/tests/cmdline/merge_reintegrate_tests.py

* subversion/tests/cmdline/schedule_tests.py

* subversion/tests/cmdline/depth_tests.py

Update expected output.

  1. … 16 more files in changeset.
Enable the SVN_EXPERIMENTAL_COPY code and remove the old code.

* subversion/libsvn_wc/copy.c

(copy_props, copy_added_file_administratively,

copy_added_dir_administratively, copy_file_administratively,

post_copy_cleanup, copy_dir_administratively): Remove.

(svn_wc_copy3): Remove conditional code.

* subversion/libsvn_wc/wc_db.c

(svn_wc__db_read_info): Remove conditional code.

* subversion/tests/cmdline/changelist_tests.py

(move_keeps_changelist, move_added_keeps_changelist): Remove XFail.

* subversion/tests/cmdline/copy_tests.py

(allow_unversioned_parent_for_copy_src): Mark XFail.

(copy_added_dir_with_copy): Remove XFail.

  1. … 3 more files in changeset.
Change the way notifications for changelists are printed by the CLI client.

Also, clean up abuse of an svn_error_t as a container for notification

information.

* subversion/include/svn_wc.h

(svn_wc_notify_action_t): Deprecate svn_wc_notify_changelist_moved.

(svn_wc_notify_t): Clear up docstring of changelist_name.

* subversion/include/svn_error_codes.h

(SVN_ERR_WC_CHANGELIST_MOVE): Deprecate. Moving something from one

changelist to another is not an error.

* subversion/svn/notify.c

(notify): Print notifications such as 'A [changelist name] path' instead

of printing English sentences that contain the same information but

take a lot longer to parse for both humans and machines.

* subversion/libsvn_wc/adm_ops.c

(svn_wc_set_changelist2): Stop sending errors about files that get moved

from one changelist to another (the CLI client was peeking into the ERR

member of the notification baton to obtain and print a warning message

generated within libsvn_wc!). Instead, provide clear separation between

logic and presentation layers: Just send delete from / add to changelist

notifications to clients and let them figure out their own way of

presenting the changelist move to the user.

* subversion/tests/cmdline/changelist_tests.py

(_re_cl_add, _re_cl_rem, verify_changelist_output,

add_remove_changelists): Adjust expected output.

  1. … 4 more files in changeset.