def run_sync(url, source_url=None, expected_error=None, source_prop_encoding=None): "Synchronize the mirror repository with the master" if source_url is not None: args = ["synchronize", url, source_url, "--username", svntest.main.wc_author, "--password", svntest.main.wc_passwd] else: # Allow testing of old source-URL-less syntax args = ["synchronize", url, "--username", svntest.main.wc_author, "--password", svntest.main.wc_passwd] if source_prop_encoding: args.append("--source-prop-encoding") args.append(source_prop_encoding) exit_code, output, errput = svntest.main.run_svnsync(*args) for index, line in enumerate(errput[:]): if re.search("warning: W200007", line): del errput[index] if errput: if expected_error is None: raise SVNUnexpectedStderr(errput) else: expected_error = svntest.verify.RegexOutput(expected_error, match_all=False) svntest.verify.compare_and_display_lines(None, "STDERR", expected_error, errput) elif expected_error is not None: raise SVNExpectedStderr if not output and not expected_error: # should be: ['Committed revision 1.\n', 'Committed revision 2.\n'] raise SVNUnexpectedStdout("Missing stdout")
def run_copy_revprops(url, source_url, expected_error=None, source_prop_encoding=None): "Copy revprops to the mirror repository from the master" args = [ "copy-revprops", url, source_url, "--username", svntest.main.wc_author, "--password", svntest.main.wc_passwd ] if source_prop_encoding: args.append("--source-prop-encoding") args.append(source_prop_encoding) exit_code, output, errput = svntest.main.run_svnsync(*args) for index, line in enumerate(errput[:]): if re.search("warning: W200007", line): del errput[index] if errput: if expected_error is None: raise SVNUnexpectedStderr(errput) else: expected_error = svntest.verify.RegexOutput(expected_error, match_all=False) svntest.verify.compare_and_display_lines(None, "STDERR", expected_error, errput) elif expected_error is not None: raise SVNExpectedStderr if not output and not expected_error: # should be: ['Copied properties for revision 1.\n', # 'Copied properties for revision 2.\n'] raise SVNUnexpectedStdout("Missing stdout")
def run_init(dst_url, src_url): "Initialize the mirror repository from the master" exit_code, output, errput = svntest.main.run_svnsync( "initialize", dst_url, src_url, "--username", svntest.main.wc_author, "--password", svntest.main.wc_passwd) if errput: raise SVNUnexpectedStderr(errput) if output != ['Copied properties for revision 0.\n']: raise SVNUnexpectedStdout(output)
def run_init(dst_url, src_url, source_prop_encoding=None): "Initialize the mirror repository from the master" args = ["initialize", dst_url, src_url, "--username", svntest.main.wc_author, "--password", svntest.main.wc_passwd] if source_prop_encoding: args.append("--source-prop-encoding") args.append(source_prop_encoding) exit_code, output, errput = svntest.main.run_svnsync(*args) for index, line in enumerate(errput[:]): if re.search("warning: W200007", line): del errput[index] if errput: raise SVNUnexpectedStderr(errput) if output != ['Copied properties for revision 0.\n']: raise SVNUnexpectedStdout(output)
def run_sync(url, expected_error=None): "Synchronize the mirror repository with the master" exit_code, output, errput = svntest.main.run_svnsync( "synchronize", url, "--username", svntest.main.wc_author, "--password", svntest.main.wc_passwd) if errput: if expected_error is None: raise SVNUnexpectedStderr(errput) else: expected_error = svntest.verify.RegexOutput(expected_error, match_all=False) svntest.verify.compare_and_display_lines(None, "STDERR", expected_error, errput) elif expected_error is not None: raise SVNExpectedStderr if not output and not expected_error: # should be: ['Committed revision 1.\n', 'Committed revision 2.\n'] raise SVNUnexpectedStdout("Missing stdout")
def run_copy_revprops(url, expected_error=None): "Copy revprops to the mirror repository from the master" exit_code, output, errput = svntest.main.run_svnsync( "copy-revprops", url, "--username", svntest.main.wc_author, "--password", svntest.main.wc_passwd) if errput: if expected_error is None: raise SVNUnexpectedStderr(errput) else: expected_error = svntest.verify.RegexOutput(expected_error, match_all=False) svntest.verify.compare_and_display_lines(None, "STDERR", expected_error, errput) elif expected_error is not None: raise SVNExpectedStderr if not output and not expected_error: # should be: ['Copied properties for revision 1.\n', # 'Copied properties for revision 2.\n'] raise SVNUnexpectedStdout("Missing stdout")
def run_info(url, expected_error=None): "Print synchronization information of the repository" exit_code, output, errput = svntest.main.run_svnsync( "info", url, "--username", svntest.main.wc_author, "--password", svntest.main.wc_passwd) if errput: if expected_error is None: raise SVNUnexpectedStderr(errput) else: expected_error = svntest.verify.RegexOutput(expected_error, match_all=False) svntest.verify.compare_and_display_lines(None, "STDERR", expected_error, errput) elif expected_error is not None: raise SVNExpectedStderr if not output and not expected_error: # should be: ['From URL: http://....\n', # 'From UUID: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n', # 'Last Merged Revision: XXX\n'] raise SVNUnexpectedStdout("Missing stdout")