Modified: subversion/branches/move-tracking-2/subversion/tests/cmdline/lock_tests.py URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/tests/cmdline/lock_tests.py?rev=1702603&r1=1702602&r2=1702603&view=diff ============================================================================== --- subversion/branches/move-tracking-2/subversion/tests/cmdline/lock_tests.py (original) +++ subversion/branches/move-tracking-2/subversion/tests/cmdline/lock_tests.py Sat Sep 12 09:07:09 2015 @@ -275,11 +275,11 @@ def steal_lock(sbox): # attempt (and fail) to lock file - # This should give a "iota' is already locked... error, but exits 0. - svntest.actions.run_and_verify_svn2(None, - ".*already locked", 0, - 'lock', - '-m', 'trying to break', file_path_b) + # This should give a "iota' is already locked error + svntest.actions.run_and_verify_svn(None, + ".*already locked", + 'lock', + '-m', 'trying to break', file_path_b) svntest.actions.run_and_verify_svn(".*locked by user", [], 'lock', '--force', @@ -703,11 +703,11 @@ def out_of_date(sbox): '-m', '', file_path) # --- Meanwhile, in our other working copy... --- - svntest.actions.run_and_verify_svn2(None, - ".*newer version of '/iota' exists", 0, - 'lock', - '--username', svntest.main.wc_author2, - '-m', '', file_path_b) + svntest.actions.run_and_verify_svn(None, + ".*newer version of '/iota' exists", + 'lock', + '--username', svntest.main.wc_author2, + '-m', '', file_path_b) #---------------------------------------------------------------------- # Tests reverting a svn:needs-lock file @@ -1164,10 +1164,10 @@ def unlock_already_unlocked_files(sbox): error_msg = ".*Path '/A/B/E/alpha' is already locked by user '" + \ svntest.main.wc_author2 + "'.*" - svntest.actions.run_and_verify_svn2(None, error_msg, 0, - 'lock', - '--username', svntest.main.wc_author2, - alpha_path, gamma_path) + svntest.actions.run_and_verify_svn(None, error_msg, + 'lock', + '--username', svntest.main.wc_author2, + alpha_path, gamma_path) expected_status.tweak('A/D/gamma', writelocked='K') svntest.actions.run_and_verify_status(wc_dir, expected_status) @@ -1180,11 +1180,11 @@ def unlock_already_unlocked_files(sbox): error_msg = "(.*No lock on path '/A/B/lambda'.*)" + \ "|(.*'A/B/lambda' is not locked.*)" - svntest.actions.run_and_verify_svn2(None, error_msg, 0, - 'unlock', - '--username', svntest.main.wc_author2, - '--force', - iota_path, lambda_path, alpha_path) + svntest.actions.run_and_verify_svn(None, error_msg, + 'unlock', + '--username', svntest.main.wc_author2, + '--force', + iota_path, lambda_path, alpha_path) expected_status.tweak('iota', 'A/B/E/alpha', writelocked=None) @@ -1305,9 +1305,8 @@ def unlock_wrong_token(sbox): # Then, unlocking the WC path should fail. ### The error message returned is actually this, but let's worry about that ### another day... - svntest.actions.run_and_verify_svn2( - None, ".*(No lock on path)", 0, - 'unlock', file_path) + svntest.actions.run_and_verify_svn(None, ".*(No lock on path)", + 'unlock', file_path) #---------------------------------------------------------------------- # Verify that info shows lock info for locked files with URI-unsafe names @@ -1366,10 +1365,10 @@ def unlocked_lock_of_other_user(sbox): else: expected_err = "svn: warning: W160039: User '%s' is trying to use a lock owned by "\ "'%s'.*" % (svntest.main.wc_author2, svntest.main.wc_author) - svntest.actions.run_and_verify_svn2([], expected_err, 0, - 'unlock', - '--username', svntest.main.wc_author2, - pi_path) + svntest.actions.run_and_verify_svn([], expected_err, + 'unlock', + '--username', svntest.main.wc_author2, + pi_path) svntest.actions.run_and_verify_status(wc_dir, expected_status) @@ -1421,9 +1420,9 @@ def lock_twice_in_one_wc(sbox): svntest.actions.run_and_verify_svn(None, [], 'lock', mu_path, '-m', 'Locked here') - # Locking in location 2 should fail ### Currently returns exitcode 0 - svntest.actions.run_and_verify_svn2(None, ".*is already locked.*", 0, - 'lock', '-m', '', mu2_path) + # Locking in location 2 should fail + svntest.actions.run_and_verify_svn(None, ".*is already locked.*", + 'lock', '-m', '', mu2_path) # Change the file anyway os.chmod(mu2_path, 0700) @@ -1469,8 +1468,8 @@ def lock_path_not_in_head(sbox): # ..\..\..\subversion\libsvn_client\ra.c:275: (apr_err=235000) # svn: In file '..\..\..\subversion\libsvn_ra_serf\util.c' line 1120: # assertion failed (ctx->status_code) - svntest.actions.run_and_verify_svn2(None, expected_lock_fail_err_re, - 0, 'lock', lambda_path) + svntest.actions.run_and_verify_svn(None, expected_lock_fail_err_re, + 'lock', lambda_path) expected_err = 'svn: E155008: The node \'.*D\' is not a file' svntest.actions.run_and_verify_svn(None, expected_err, @@ -1679,8 +1678,8 @@ def block_unlock_if_pre_unlock_hook_fail # Make sure the unlock operation fails as pre-unlock hook blocks it. expected_unlock_fail_err_re = ".*error text" - svntest.actions.run_and_verify_svn2(None, expected_unlock_fail_err_re, - 0, 'unlock', pi_path) + svntest.actions.run_and_verify_svn(None, expected_unlock_fail_err_re, + 'unlock', pi_path) svntest.actions.run_and_verify_status(wc_dir, expected_status) #---------------------------------------------------------------------- @@ -1699,10 +1698,10 @@ def lock_invalid_token(sbox): fname = 'iota' file_path = os.path.join(sbox.wc_dir, fname) - svntest.actions.run_and_verify_svn2(None, - "svn: warning: W160037: " \ - ".*scheme.*'opaquelocktoken'", 0, - 'lock', '-m', '', file_path) + svntest.actions.run_and_verify_svn(None, + "svn: warning: W160037: " \ + ".*scheme.*'opaquelocktoken'", + 'lock', '-m', '', file_path) @Issue(3105) def lock_multi_wc(sbox): @@ -1922,27 +1921,29 @@ def lock_hook_messages(sbox): svntest.actions.create_failing_hook(repo_dir, "pre-lock", error_msg) svntest.actions.create_failing_hook(repo_dir, "pre-unlock", error_msg) - _, _, actual_stderr = svntest.actions.run_and_verify_svn2( - [], svntest.verify.AnyOutput, 0, + _, _, actual_stderr = svntest.actions.run_and_verify_svn( + [], svntest.verify.AnyOutput, 'lock', mu_url) - if len(actual_stderr) > 2: - actual_stderr = actual_stderr[-2:] + if len(actual_stderr) > 4: + actual_stderr = actual_stderr[-4:-2] + actual_stderr[-1:] expected_err = [ 'svn: warning: W165001: ' + svntest.actions.hook_failure_message('pre-lock'), error_msg + "\n", + "svn: E200009: One or more locks could not be obtained\n", ] svntest.verify.compare_and_display_lines(None, 'STDERR', expected_err, actual_stderr) - _, _, actual_stderr = svntest.actions.run_and_verify_svn2( - [], svntest.verify.AnyOutput, 0, + _, _, actual_stderr = svntest.actions.run_and_verify_svn( + [], svntest.verify.AnyOutput, 'unlock', iota_url) - if len(actual_stderr) > 2: - actual_stderr = actual_stderr[-2:] + if len(actual_stderr) > 4: + actual_stderr = actual_stderr[-4:-2] + actual_stderr[-1:] expected_err = [ 'svn: warning: W165001: ' + svntest.actions.hook_failure_message('pre-unlock'), error_msg + "\n", + "svn: E200009: One or more locks could not be released\n", ] svntest.verify.compare_and_display_lines(None, 'STDERR', expected_err, actual_stderr) @@ -2036,15 +2037,15 @@ def dav_lock_timeout(sbox): expiration_date = svntest.actions.run_and_parse_info(sbox.repo_url + '/iota')[0]['Lock Expires'] # Verify that there is a lock, by trying to obtain one - svntest.actions.run_and_verify_svn2(None, ".*locked by user", 0, - 'lock', '-m', '', sbox.ospath('iota')) + svntest.actions.run_and_verify_svn(None, ".*locked by user", + 'lock', '-m', '', sbox.ospath('iota')) expected_status = svntest.actions.get_virginal_state(wc_dir, 1) expected_status.tweak('iota', writelocked='O') svntest.actions.run_and_verify_status(wc_dir, expected_status) # This used to fail over serf with a parse error of the timeout. expected_err = "svn: warning: W160039:" - svntest.actions.run_and_verify_svn2(None, expected_err, 0, + svntest.actions.run_and_verify_svn(None, expected_err, 'unlock', sbox.repo_url + '/iota') # Force unlock via working copy, this also used to fail over serf. @@ -2207,27 +2208,27 @@ def many_locks_hooks(sbox): ' sys.exit(1)\n' 'sys.exit(0)\n') - svntest.actions.run_and_verify_svn2(".* locked", - "svn: warning: W165001: .*", 0, - 'lock', - sbox.ospath('iota'), - sbox.ospath('A/mu'), - sbox.ospath('A/B/E/alpha'), - sbox.ospath('A/D/G/pi'), - sbox.ospath('A/D/G/rho')) + svntest.actions.run_and_verify_svn(".* locked", + "svn: warning: W165001: .*", + 'lock', + sbox.ospath('iota'), + sbox.ospath('A/mu'), + sbox.ospath('A/B/E/alpha'), + sbox.ospath('A/D/G/pi'), + sbox.ospath('A/D/G/rho')) expected_status = svntest.actions.get_virginal_state(wc_dir, 1) expected_status.tweak('iota', 'A/mu', 'A/B/E/alpha', 'A/D/G/rho', writelocked='K') svntest.actions.run_and_verify_status(wc_dir, expected_status) - svntest.actions.run_and_verify_svn2(".* unlocked", - "svn: warning: W165001: .*", 0, - 'unlock', - sbox.ospath('iota'), - sbox.ospath('A/mu'), - sbox.ospath('A/B/E/alpha'), - sbox.ospath('A/D/G/rho')) + svntest.actions.run_and_verify_svn(".* unlocked", + "svn: warning: W165001: .*", + 'unlock', + sbox.ospath('iota'), + sbox.ospath('A/mu'), + sbox.ospath('A/B/E/alpha'), + sbox.ospath('A/D/G/rho')) expected_status.tweak('iota', 'A/B/E/alpha', 'A/D/G/rho', writelocked=None)
Modified: subversion/branches/move-tracking-2/subversion/tests/cmdline/merge_automatic_tests.py URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/tests/cmdline/merge_automatic_tests.py?rev=1702603&r1=1702602&r2=1702603&view=diff ============================================================================== --- subversion/branches/move-tracking-2/subversion/tests/cmdline/merge_automatic_tests.py (original) +++ subversion/branches/move-tracking-2/subversion/tests/cmdline/merge_automatic_tests.py Sat Sep 12 09:07:09 2015 @@ -1327,6 +1327,31 @@ def reintegrate_subtree_not_updated(sbox sbox.simple_commit() sbox.simple_update() +def merge_to_copy_and_add(sbox): + "merge peg to a copy and add" + + sbox.build() + + sbox.simple_copy('A', 'AA') + sbox.simple_append('A/mu', 'A/mu') + sbox.simple_commit('A') + + # This is the scenario the code is supposed to support; a copy + svntest.actions.run_and_verify_svn(None, [], + 'merge', '^/A', sbox.ospath('AA')) + + sbox.simple_mkdir('A3') + # And this case currently segfaults, because merge doesn't check + # if the path has a repository location + expected_err = ".*svn: E195012: Can't perform .*A3'.*added.*" + svntest.actions.run_and_verify_svn(None, expected_err, + 'merge', '^/A', sbox.ospath('A3')) + # Try the same merge with --reintegrate, for completeness' sake. + expected_err = ".*svn: E195012: Can't reintegrate into .*A3'.*added.*" + svntest.actions.run_and_verify_svn(None, expected_err, + 'merge', '--reintegrate', '^/A', + sbox.ospath('A3')) + ######################################################################## # Run the tests @@ -1356,6 +1381,7 @@ test_list = [ None, auto_merge_handles_replacements_in_merge_source, effective_sync_results_in_reintegrate, reintegrate_subtree_not_updated, + merge_to_copy_and_add, ] if __name__ == '__main__': Modified: subversion/branches/move-tracking-2/subversion/tests/cmdline/revert_tests.py URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/tests/cmdline/revert_tests.py?rev=1702603&r1=1702602&r2=1702603&view=diff ============================================================================== --- subversion/branches/move-tracking-2/subversion/tests/cmdline/revert_tests.py (original) +++ subversion/branches/move-tracking-2/subversion/tests/cmdline/revert_tests.py Sat Sep 12 09:07:09 2015 @@ -1630,7 +1630,13 @@ def revert_obstructing_wc(sbox): svntest.actions.run_and_verify_svn("Skipped '.*A' -- .*obstruct.*", [], 'revert', '-R', wc_dir) +def revert_moved_dir_partial(sbox): + "partial revert moved_dir" + sbox.build(read_only = True) + + sbox.simple_move('A', 'A_') + svntest.actions.run_and_verify_svn(None, [], 'revert', sbox.ospath('A')) ######################################################################## @@ -1673,6 +1679,7 @@ test_list = [ None, revert_with_unversioned_targets, revert_nonexistent, revert_obstructing_wc, + revert_moved_dir_partial, ] if __name__ == '__main__': Modified: subversion/branches/move-tracking-2/subversion/tests/cmdline/svnfsfs_tests.py URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/tests/cmdline/svnfsfs_tests.py?rev=1702603&r1=1702602&r2=1702603&view=diff ============================================================================== --- subversion/branches/move-tracking-2/subversion/tests/cmdline/svnfsfs_tests.py (original) +++ subversion/branches/move-tracking-2/subversion/tests/cmdline/svnfsfs_tests.py Sat Sep 12 09:07:09 2015 @@ -302,6 +302,15 @@ def load_index_sharded(sbox): svntest.actions.run_and_verify_svnadmin(expected_output, [], "verify", sbox.repo_dir) +@SkipUnless(svntest.main.is_fs_type_fsfs) +def test_stats_on_empty_repo(sbox): + "stats on empty repo shall not crash" + + sbox.build(create_wc=False, empty=True) + + exit_code, output, errput = \ + svntest.actions.run_and_verify_svnfsfs(None, [], 'stats', sbox.repo_dir) + ######################################################################## # Run the tests @@ -310,6 +319,7 @@ def load_index_sharded(sbox): test_list = [ None, test_stats, load_index_sharded, + test_stats_on_empty_repo, ] if __name__ == '__main__': Modified: subversion/branches/move-tracking-2/subversion/tests/cmdline/svnmucc_tests.py URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/tests/cmdline/svnmucc_tests.py?rev=1702603&r1=1702602&r2=1702603&view=diff ============================================================================== --- subversion/branches/move-tracking-2/subversion/tests/cmdline/svnmucc_tests.py (original) +++ subversion/branches/move-tracking-2/subversion/tests/cmdline/svnmucc_tests.py Sat Sep 12 09:07:09 2015 @@ -106,7 +106,9 @@ def basic_svnmucc(sbox): sbox.build() empty_file = sbox.ospath('empty') + file = sbox.ospath('file') svntest.main.file_append(empty_file, '') + svntest.main.file_append(file, 'file') # revision 2 test_svnmucc(sbox.repo_url, @@ -301,6 +303,14 @@ def basic_svnmucc(sbox): 'propsetf', 'testprop', empty_file, 'foo/z.c', 'propsetf', 'testprop', empty_file, 'foo/foo') + # revision 21 + test_svnmucc(sbox.repo_url, + ['M /foo/z.c', + ], #--------- + '-m', 'log msg', + 'propset', 'testprop', 'false', 'foo/z.c', + 'put', file, 'foo/z.c') + # Expected missing revision error xtest_svnmucc(sbox.repo_url, ["svnmucc: E200004: 'a' is not a revision" @@ -461,7 +471,7 @@ def prohibited_deletes_and_moves(sbox): # See dev@, 2015-05-11, "Re: Issue 4579 / svnmucc fails to process certain # deletes", <http://svn.haxx.se/dev/archive-2015-05/0038.shtml> - sbox.build() + sbox.build(read_only = True) svntest.main.file_write(sbox.ospath('file'), "New contents") xtest_svnmucc(sbox.repo_url, @@ -502,6 +512,82 @@ def prohibited_deletes_and_moves(sbox): 'rm', 'A/B', 'mv', 'A', 'A1') +def svnmucc_type_errors(sbox): + "test type errors" + + sbox.build(read_only=True) + + sbox.simple_append('file', 'New contents') + + xtest_svnmucc(sbox.repo_url, + ["svnmucc: E160016: Can't operate on 'B' " + "because 'A' is not a directory"], + '-m', '', + 'put', sbox.ospath('file'), 'A', + 'mkdir', 'A/B', + 'propset', 'iota', 'iota', 'iota') + + xtest_svnmucc(sbox.repo_url, + ["svnmucc: E200009: Can't delete node at 'A'"], + '-m', '', + 'mkdir', 'A/Z', + 'put', sbox.ospath('file'), 'A') + + xtest_svnmucc(sbox.repo_url, + ["svnmucc: E160020: Path 'Z' already exists"], + '-m', '', + 'mkdir', 'A/Z', + 'put', sbox.ospath('file'), 'A/Z') + +def svnmucc_propset_and_put(sbox): + "propset and put" + + sbox.build() + + sbox.simple_append('file', 'New contents') + + # First in the sane order: put, then propset + xtest_svnmucc(sbox.repo_url, + [], + '-m', '', + 'put', sbox.ospath('file'), 't1', + 'propset', 't1', 't1', 't1') + + # And now in an impossible order: propset, then put + xtest_svnmucc(sbox.repo_url, + ["svnmucc: E200009: Can't set properties at not existing 't2'"], + '-m', '', + 'propset', 't2', 't2', 't2', + 'put', sbox.ospath('file'), 't2') + + # And if the target already exists (dir) + xtest_svnmucc(sbox.repo_url, + ["svnmucc: E200009: Can't delete node at 'A'"], + '-m', '', + 'propset', 'A', 'A', 'A', + 'put', sbox.ospath('file'), 'A') + + # And if the target already exists (file) # fixed in r1702467 + xtest_svnmucc(sbox.repo_url, + [], + '-m', '', + 'propset', 'iota', 'iota', 'iota', + 'put', sbox.ospath('file'), 'iota') + + # Put same file twice (non existing) + xtest_svnmucc(sbox.repo_url, + ["svnmucc: E160020: Path 't3' already exists"], + '-m', '', + 'put', sbox.ospath('file'), 't3', + 'put', sbox.ospath('file'), 't3') + + # Put same file twice (existing) + xtest_svnmucc(sbox.repo_url, + ["svnmucc: E200009: Can't update file at 't1'"], + '-m', '', + 'put', sbox.ospath('file'), 't1', + 'put', sbox.ospath('file'), 't1') + ###################################################################### @@ -513,6 +599,8 @@ test_list = [ None, no_log_msg_non_interactive, nested_replaces, prohibited_deletes_and_moves, + svnmucc_type_errors, + svnmucc_propset_and_put, ] if __name__ == '__main__': Modified: subversion/branches/move-tracking-2/subversion/tests/cmdline/svntest/main.py URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/tests/cmdline/svntest/main.py?rev=1702603&r1=1702602&r2=1702603&view=diff ============================================================================== --- subversion/branches/move-tracking-2/subversion/tests/cmdline/svntest/main.py (original) +++ subversion/branches/move-tracking-2/subversion/tests/cmdline/svntest/main.py Sat Sep 12 09:07:09 2015 @@ -1892,8 +1892,48 @@ def _internal_run_tests(test_list, testn return exit_code +class AbbreviatedFormatter(logging.Formatter): + """A formatter with abbreviated loglevel indicators in the output. + + Use %(levelshort)s in the format string to get a single character + representing the loglevel.. + """ + + _level_short = { + logging.CRITICAL : 'C', + logging.ERROR : 'E', + logging.WARNING : 'W', + logging.INFO : 'I', + logging.DEBUG : 'D', + logging.NOTSET : '-', + } + + def format(self, record): + record.levelshort = self._level_short[record.levelno] + return logging.Formatter.format(self, record) + def _create_parser(usage=None): """Return a parser for our test suite.""" + + global logger + + # Initialize the LOGGER global variable so the option parsing can set + # its loglevel, as appropriate. + logger = logging.getLogger() + + # Did some chucklehead log something before we configured it? If they + # did, then a default handler/formatter would get installed. We want + # to be the one to install the first (and only) handler. + for handler in logger.handlers: + if not isinstance(handler.formatter, AbbreviatedFormatter): + raise Exception('Logging occurred before configuration. Some code' + ' path needs to be fixed. Examine the log output' + ' to find what/where logged something.') + + # Set a sane default log level + if logger.getEffectiveLevel() == logging.NOTSET: + logger.setLevel(logging.WARN) + def set_log_level(option, opt, value, parser, level=None): if level: # called from --verbose @@ -2025,6 +2065,22 @@ def parse_options(arglist=sys.argv[1:], parser = _create_parser(usage) (options, args) = parser.parse_args(arglist) + # If there are no logging handlers registered yet, then install our + # own with our custom formatter. (anything currently installed *is* + # our handler as tested above, in _create_parser) + if not logger.handlers: + # Now that we have some options, let's get the logger configured before + # doing anything more + if options.log_with_timestamps: + formatter = AbbreviatedFormatter('%(levelshort)s:' + ' [%(asctime)s] %(message)s', + datefmt='%Y-%m-%d %H:%M:%S') + else: + formatter = AbbreviatedFormatter('%(levelshort)s: %(message)s') + handler = logging.StreamHandler(sys.stdout) + handler.setFormatter(formatter) + logger.addHandler(handler) + # Normalize url to have no trailing slash if options.url: if options.url[-1:] == '/': @@ -2122,27 +2178,6 @@ def get_issue_details(issue_numbers): return issue_dict -class AbbreviatedFormatter(logging.Formatter): - """A formatter with abbreviated loglevel indicators in the output. - - Use %(levelshort)s in the format string to get a single character - representing the loglevel.. - """ - - _level_short = { - logging.CRITICAL : 'C', - logging.ERROR : 'E', - logging.WARNING : 'W', - logging.INFO : 'I', - logging.DEBUG : 'D', - logging.NOTSET : '-', - } - - def format(self, record): - record.levelshort = self._level_short[record.levelno] - return logging.Formatter.format(self, record) - - # Main func. This is the "entry point" that all the test scripts call # to run their list of tests. # @@ -2153,7 +2188,6 @@ def execute_tests(test_list, serial_only exiting the process. This function can be used when a caller doesn't want the process to die.""" - global logger global pristine_url global pristine_greek_repos_url global svn_binary @@ -2174,19 +2208,6 @@ def execute_tests(test_list, serial_only testnums = [] - # Initialize the LOGGER global variable so the option parsing can set - # its loglevel, as appropriate. - logger = logging.getLogger() - - # Did some chucklehead log something before we configured it? If they - # did, then a default handler/formatter would get installed. We want - # to be the one to install the first (and only) handler. - for handler in logger.handlers: - if not isinstance(handler.formatter, AbbreviatedFormatter): - raise Exception('Logging occurred before configuration. Some code' - ' path needs to be fixed. Examine the log output' - ' to find what/where logged something.') - if not options: # Override which tests to run from the commandline (parser, args) = parse_options() @@ -2194,22 +2215,6 @@ def execute_tests(test_list, serial_only else: parser = _create_parser() - # If there are no handlers registered yet, then install our own with - # our custom formatter. (anything currently installed *is* our handler - # as tested above) - if not logger.handlers: - # Now that we have some options, let's get the logger configured before - # doing anything more - if options.log_with_timestamps: - formatter = AbbreviatedFormatter('%(levelshort)s:' - ' [%(asctime)s] %(message)s', - datefmt='%Y-%m-%d %H:%M:%S') - else: - formatter = AbbreviatedFormatter('%(levelshort)s: %(message)s') - handler = logging.StreamHandler(sys.stdout) - handler.setFormatter(formatter) - logger.addHandler(handler) - # parse the positional arguments (test nums, names) for arg in test_selection: appended = False Modified: subversion/branches/move-tracking-2/subversion/tests/cmdline/update_tests.py URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/tests/cmdline/update_tests.py?rev=1702603&r1=1702602&r2=1702603&view=diff ============================================================================== --- subversion/branches/move-tracking-2/subversion/tests/cmdline/update_tests.py (original) +++ subversion/branches/move-tracking-2/subversion/tests/cmdline/update_tests.py Sat Sep 12 09:07:09 2015 @@ -6731,6 +6731,90 @@ def update_keywords_on_shortcut(sbox): for line in text_after_up]): raise svntest.Failure("update did not update the LastChangedRevision keyword") +def update_add_conflicted_deep(sbox): + "deep add conflicted" + + sbox.build() + repo_url = sbox.repo_url + + svntest.actions.run_and_verify_svnmucc( + None, [], '-U', repo_url, '-m', '', + 'mkdir', 'A/z', + 'mkdir', 'A/z/z', + 'mkdir', 'A/z/z/z') + + svntest.actions.run_and_verify_svnmucc( + None, [], '-U', repo_url, '-m', '', + 'rm', 'A/z', + 'mkdir', 'A/z', + 'mkdir', 'A/z/z', + 'mkdir', 'A/z/z/z') + + sbox.simple_append('A/z', 'A/z') + sbox.simple_add('A/z') + sbox.simple_update('A', 2) + # This final update used to segfault using 1.9.0 and 1.9.1 + sbox.simple_update('A/z/z', 3) + +def missing_tmp_update(sbox): + "missing tmp update caused segfault" + + sbox.build(read_only = True) + wc_dir = sbox.wc_dir + svntest.actions.run_and_verify_update(wc_dir, None, None, None, [], False, + wc_dir, '--set-depth', 'empty') + + os.rmdir(sbox.ospath(svntest.main.get_admin_name() + '/tmp')) + + svntest.actions.run_and_verify_svn(None, '.*Unable to create.*', + 'up', wc_dir, '--set-depth', 'infinity') + + svntest.actions.run_and_verify_svn(None, [], 'cleanup', wc_dir) + + svntest.actions.run_and_verify_update(wc_dir, None, None, None, [], False, + wc_dir, '--set-depth', 'infinity') + +def update_delete_switched(sbox): + "update delete switched" + + sbox.build(read_only = True) + wc_dir = sbox.wc_dir + + svntest.actions.run_and_verify_switch(wc_dir, sbox.ospath('A/B/E'), + sbox.repo_url + '/A/D/G', + None, None, None, [], False, + '--ignore-ancestry') + + # Introduce some change somewhere... + sbox.simple_propset('A', 'A', 'A') + + expected_status = svntest.wc.State(wc_dir, { + '' : Item(status=' ', wc_rev='1'), + 'A' : Item(status='A ', copied='+', treeconflict='C', wc_rev='-'), + 'A/B' : Item(status=' ', copied='+', wc_rev='-'), + 'A/B/E' : Item(status='A ', copied='+', wc_rev='-'), + 'A/B/E/rho' : Item(status=' ', copied='+', wc_rev='-'), + 'A/B/E/pi' : Item(status=' ', copied='+', wc_rev='-'), + 'A/B/E/tau' : Item(status=' ', copied='+', wc_rev='-'), + 'A/B/lambda' : Item(status=' ', copied='+', wc_rev='-'), + 'A/B/F' : Item(status=' ', copied='+', wc_rev='-'), + 'A/D' : Item(status=' ', copied='+', wc_rev='-'), + 'A/D/G' : Item(status=' ', copied='+', wc_rev='-'), + 'A/D/G/pi' : Item(status=' ', copied='+', wc_rev='-'), + 'A/D/G/tau' : Item(status=' ', copied='+', wc_rev='-'), + 'A/D/G/rho' : Item(status=' ', copied='+', wc_rev='-'), + 'A/D/gamma' : Item(status=' ', copied='+', wc_rev='-'), + 'A/D/H' : Item(status=' ', copied='+', wc_rev='-'), + 'A/D/H/omega' : Item(status=' ', copied='+', wc_rev='-'), + 'A/D/H/psi' : Item(status=' ', copied='+', wc_rev='-'), + 'A/D/H/chi' : Item(status=' ', copied='+', wc_rev='-'), + 'A/mu' : Item(status=' ', copied='+', wc_rev='-'), + 'A/C' : Item(status=' ', copied='+', wc_rev='-'), + 'iota' : Item(status=' ', wc_rev='1'), + }) + svntest.actions.run_and_verify_update(wc_dir, None, None, expected_status, + [], False, sbox.ospath('A'), '-r', 0) + ####################################################################### # Run the tests @@ -6818,6 +6902,9 @@ test_list = [ None, update_child_below_add, update_conflict_details, update_keywords_on_shortcut, + update_add_conflicted_deep, + missing_tmp_update, + update_delete_switched, ] if __name__ == '__main__': Modified: subversion/branches/move-tracking-2/subversion/tests/cmdline/upgrade_tests.py URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/tests/cmdline/upgrade_tests.py?rev=1702603&r1=1702602&r2=1702603&view=diff ============================================================================== --- subversion/branches/move-tracking-2/subversion/tests/cmdline/upgrade_tests.py (original) +++ subversion/branches/move-tracking-2/subversion/tests/cmdline/upgrade_tests.py Sat Sep 12 09:07:09 2015 @@ -1480,6 +1480,90 @@ def auto_analyze(sbox): if val != [(1,)]: raise svntest.Failure("analyze failed") +def upgrade_1_0_with_externals(sbox): + "test upgrading 1.0.0 working copy with externals" + + sbox.build(create_wc = False) + replace_sbox_with_tarfile(sbox, 'upgrade_1_0_with_externals.tar.bz2') + + url = sbox.repo_url + + # This is non-canonical by the rules of svn_uri_canonicalize, it gets + # written into the entries file and upgrade has to canonicalize. + non_canonical_url = url[:-1] + '%%%02x' % ord(url[-1]) + xml_entries_relocate(sbox.wc_dir, 'file:///1.0.0/repos', non_canonical_url) + + externals_propval = 'exdir_G ' + sbox.repo_url + '/A/D/G' + '\n' + adm_name = svntest.main.get_admin_name() + dir_props_file = os.path.join(sbox.wc_dir, adm_name, 'dir-props') + svntest.main.file_write(dir_props_file, + ('K 13\n' + 'svn:externals\n' + 'V %d\n' % len(externals_propval)) + + externals_propval + '\nEND\n', 'wb') + + # Attempt to use the working copy, this should give an error + expected_stderr = wc_is_too_old_regex + svntest.actions.run_and_verify_svn(None, expected_stderr, + 'info', sbox.wc_dir) + + + # Now upgrade the working copy + svntest.actions.run_and_verify_svn(None, [], + 'upgrade', sbox.wc_dir) + # And the separate working copy below COPIED or check_format() fails + svntest.actions.run_and_verify_svn(None, [], + 'upgrade', + os.path.join(sbox.wc_dir, 'COPIED', 'G')) + + # Actually check the format number of the upgraded working copy + check_format(sbox, get_current_format()) + + # Now check the contents of the working copy + # #### This working copy is not just a basic tree, + # fix with the right data once we get here + expected_status = svntest.wc.State(sbox.wc_dir, + { + '' : Item(status=' M', wc_rev=7), + 'B' : Item(status=' ', wc_rev='7'), + 'B/mu' : Item(status=' ', wc_rev='7'), + 'B/D' : Item(status=' ', wc_rev='7'), + 'B/D/H' : Item(status=' ', wc_rev='7'), + 'B/D/H/psi' : Item(status=' ', wc_rev='7'), + 'B/D/H/omega' : Item(status=' ', wc_rev='7'), + 'B/D/H/zeta' : Item(status='MM', wc_rev='7'), + 'B/D/H/chi' : Item(status=' ', wc_rev='7'), + 'B/D/gamma' : Item(status=' ', wc_rev='9'), + 'B/D/G' : Item(status=' ', wc_rev='7'), + 'B/D/G/tau' : Item(status=' ', wc_rev='7'), + 'B/D/G/rho' : Item(status=' ', wc_rev='7'), + 'B/D/G/pi' : Item(status=' ', wc_rev='7'), + 'B/B' : Item(status=' ', wc_rev='7'), + 'B/B/lambda' : Item(status=' ', wc_rev='7'), + 'MKDIR' : Item(status='A ', wc_rev='0'), + 'MKDIR/MKDIR' : Item(status='A ', wc_rev='0'), + 'A' : Item(status=' ', wc_rev='7'), + 'A/B' : Item(status=' ', wc_rev='7'), + 'A/B/lambda' : Item(status=' ', wc_rev='7'), + 'A/D' : Item(status=' ', wc_rev='7'), + 'A/D/G' : Item(status=' ', wc_rev='7'), + 'A/D/G/rho' : Item(status=' ', wc_rev='7'), + 'A/D/G/pi' : Item(status=' ', wc_rev='7'), + 'A/D/G/tau' : Item(status=' ', wc_rev='7'), + 'A/D/H' : Item(status=' ', wc_rev='7'), + 'A/D/H/psi' : Item(status=' ', wc_rev='7'), + 'A/D/H/omega' : Item(status=' ', wc_rev='7'), + 'A/D/H/zeta' : Item(status=' ', wc_rev='7'), + 'A/D/H/chi' : Item(status=' ', wc_rev='7'), + 'A/D/gamma' : Item(status=' ', wc_rev='7'), + 'A/mu' : Item(status=' ', wc_rev='7'), + 'iota' : Item(status=' ', wc_rev='7'), + 'COPIED' : Item(status=' ', wc_rev='10'), + 'DELETED' : Item(status='D ', wc_rev='10'), + 'exdir_G' : Item(status='X '), + }) + run_and_verify_status_no_server(sbox.wc_dir, expected_status) + ######################################################################## # Run the tests @@ -1537,6 +1621,7 @@ test_list = [ None, changelist_upgrade_1_6, upgrade_1_7_dir_external, auto_analyze, + upgrade_1_0_with_externals, ] Modified: subversion/branches/move-tracking-2/subversion/tests/libsvn_fs/fs-test.c URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/tests/libsvn_fs/fs-test.c?rev=1702603&r1=1702602&r2=1702603&view=diff ============================================================================== --- subversion/branches/move-tracking-2/subversion/tests/libsvn_fs/fs-test.c (original) +++ subversion/branches/move-tracking-2/subversion/tests/libsvn_fs/fs-test.c Sat Sep 12 09:07:09 2015 @@ -4969,7 +4969,7 @@ unordered_txn_dirprops(const svn_test_op /* Commit the first one first. */ SVN_ERR(test_commit_txn(&new_rev, txn, NULL, pool)); - /* Some backends are clever then others. */ + /* Some backends are cleverer than others. */ if (is_bdb) { /* Then commit the second -- but expect an conflict because the @@ -5591,7 +5591,7 @@ dir_prop_merge(const svn_test_opts_t *op SVN_ERR(svn_fs_abort_txn(c_txn, pool)); /* Changes in a sub-tree should not conflict with prop changes to some - parent directory but some backends are clever then others. */ + parent directory but some backends are cleverer than others. */ if (is_bdb) { SVN_ERR(test_commit_txn(&head_rev, top_txn, "/A", pool)); Propchange: subversion/branches/move-tracking-2/tools/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Sat Sep 12 09:07:09 2015 @@ -82,4 +82,4 @@ /subversion/branches/verify-at-commit/tools:1462039-1462408 /subversion/branches/verify-keep-going/tools:1439280-1546110 /subversion/branches/wc-collate-path/tools:1402685-1480384 -/subversion/trunk/tools:1606692-1701347 +/subversion/trunk/tools:1606692-1702602 Modified: subversion/branches/move-tracking-2/tools/client-side/bash_completion URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/tools/client-side/bash_completion?rev=1702603&r1=1702602&r2=1702603&view=diff ============================================================================== --- subversion/branches/move-tracking-2/tools/client-side/bash_completion (original) +++ subversion/branches/move-tracking-2/tools/client-side/bash_completion Sat Sep 12 09:07:09 2015 @@ -84,6 +84,7 @@ function _svn_info() done } +# broken since svn 1.7 | FIXME: change to svn status -v ? # _svn_lls (dir|file|all) files... # list svn-managed files from list # some 'svn status --all-files' would be welcome here? @@ -106,6 +107,85 @@ function _svn_lls() done } +# try to complete TARGET +# 1. [nothing] lists available protocols +# 2. svn+ssh:// lists servers from .ssh/known_hosts +# 3. http[s]:// lists already used svn servers +# 4. file:// lists files from dir +# 5. ^/ or protocol except file:/ triggers svn ls +# this code expects bash 4, $cur is split by : too +# +# $1 'all' | 'remote_only' +# return true if found something +function _svn_complete_target() { + # echo -e "\n_svn_complete_target: [$cur] 1:[${COMP_WORDS[COMP_CWORD]}] 2:[${COMP_WORDS[COMP_CWORD-1]}] 3:[${COMP_WORDS[COMP_CWORD-2]}] | [${COMP_WORDS[@]}] [$COMP_WORDBREAKS]" + local prefix=${COMP_WORDS[COMP_CWORD-2]} + local colon=${COMP_WORDS[COMP_CWORD-1]} + # see about COMP_WORDBREAKS workaround in prop completion + if [[ $prefix == "file" && "$colon" == ":" ]] + then + # file completion for file:// urls + COMPREPLY=( $(compgen -d -S '/' -X '*/.*' -- $cur ) ) + return + elif [[ ( $1 == "all" && $cur == ^/* ) || ( "$colon" == ":" && $cur == //*/* ) ]] + then # we already hava a protocoll and host: autocomplete for svn ls ^/bla | svn ls remote_url | svn checkout remote_url + local p + if [ "$colon" == ":" ] ; then + p="$prefix$colon" + fi + if [[ $cur =~ ((.*/)([^/]*)) ]] # url = everything up to the last / + then + local url="${BASH_REMATCH[2]}" + local path="${BASH_REMATCH[3]}" + local remote_files="$(svn ls --non-interactive "$p$url" 2> /dev/null )" + COMPREPLY=( $(compgen -P "$url" -W "$remote_files" -- "$path" ) ) + compopt -o nospace + return 0 + fi + elif [[ "$colon" == ":" ]] + then + # get known servers + # svn+ssh:// + if [[ $prefix == "svn+ssh" && $cur =~ (^//(.*)) ]] ; then + local server_start=${BASH_REMATCH[2]} + # debian & suse: /usr/share/bash-completion/bash_completion + local suffix=/ + _known_hosts_real -p // "$server_start" + else + local urls= file= + for file in ~/.subversion/auth/svn.simple/* ; do + if [ -r $file ] ; then + local url=$(_svn_read_hashfile svn:realmstring < $file) + url=${url/*</} + url=${url/>*/} + urls="$urls $url" + fi + done + + # only suggest/show possible suffixes + local suffix=$cur c= choices= + for c in $urls ; do + [[ $c == $prefix:* ]] && choices="$choices ${c#*:}" + done + + COMPREPLY=( $(compgen -W "$choices" -- $suffix ) ) + fi + compopt -o nospace + return + else + # show schemas + if [ $1 == 'all' ] ; then + COMPREPLY=( $(compgen -W "^/ $urlSchemas" -- $cur) ) + else + COMPREPLY=( $(compgen -W "$urlSchemas" -- $cur) ) + fi + compopt -o nospace + return + fi + #echo "nothing found" + return 1 +} + # This completion guides the command/option order along the one suggested # by "svn help", although other syntaxes are allowed. # @@ -393,39 +473,10 @@ _svn() if [[ $cmd == @(co|checkout|ls|list) && $stat = 'arg' && \ $SVN_BASH_COMPL_EXT == *urls* ]] then - # see about COMP_WORDBREAKS workaround in prop completion - if [[ $cur == file:* ]] - then - # file completion for file:// urls - local where=${cur/file:/} - COMPREPLY=( $(compgen -d -S '/' -X '*/.*' -- $where ) ) - return - elif [[ $cur == *:* ]] - then - # get known urls - local urls= file= - for file in ~/.subversion/auth/svn.simple/* ; do - if [ -r $file ] ; then - local url=$(_svn_read_hashfile svn:realmstring < $file) - url=${url/*</} - url=${url/>*/} - urls="$urls $url" - fi - done - - # only suggest/show possible suffixes - local prefix=${cur%:*} suffix=${cur#*:} c= choices= - for c in $urls ; do - [[ $c == $prefix:* ]] && choices="$choices ${c#*:}" - done - - COMPREPLY=( $(compgen -W "$choices" -- $suffix ) ) - return + if [[ $cmd == @(ls|list) ]] ; then + _svn_complete_target 'all' && return else - # show schemas - COMPREPLY=( $(compgen -W "$urlSchemas" -- $cur) ) - compopt -o nospace - return + _svn_complete_target 'remote_only' && return fi fi @@ -450,11 +501,15 @@ _svn() compopt -o nospace return 0 fi + # this part is broken with bash 4 URL contains https only elif [[ $URL == */branches/* && $here == */trunk* && \ ! $hasReintegrateOpt && $cur = '' && $stat = 'arg' ]] ; then # force --reintegrate only if the current word is empty COMPREPLY=( $(compgen -W '--reintegrate' -- $cur ) ) return 0 + # autocomplete for svn merge ^/bla + else + _svn_complete_target 'all' && return fi fi
