Add tests for the current handling of svn:eol-style when exporting the
working copy contents.
* subversion/tests/cmdline/export_tests.py
(export_working_copy_eol_translation,
export_working_copy_inconsistent_eol): New tests.
(test_list): Run the new tests.
@@ -1153,6 +1153,52 @@ def export_keyword_translation_inconsistent_eol(sbox):
expected_disk,
keep_eol_style=True)
+def export_working_copy_eol_translation(sbox):
+ "export working copy with EOL translation"
+ sbox.build(empty=True)
+ sbox.simple_mkdir('dir')
+ sbox.simple_add_text('test\n', 'dir/file')
+ sbox.simple_propset('svn:eol-style', 'CRLF', 'dir/file')
+ sbox.simple_commit()
+
+ export_target = sbox.add_wc_path('export')
+
+ expected_disk = svntest.wc.State('', {
+ 'dir' : Item(),
+ 'dir/file' : Item("test\r\n"),
+ })
+
+ expected_output = svntest.wc.State(export_target, {
+ 'dir' : Item(status='A '),
+ 'dir/file' : Item(status='A ')
+ })
+
+ svntest.actions.run_and_verify_export2(sbox.wc_dir,
+ export_target,
+ expected_output,
+ expected_disk,
+ keep_eol_style=True)
+
+def export_working_copy_inconsistent_eol(sbox):
+ "export working copy with inconsistent EOLs"
+ sbox.build(empty=True)
+ sbox.simple_mkdir('dir')
+ sbox.simple_add_text('test\n', 'dir/file')
+ sbox.simple_propset('svn:eol-style', 'CRLF', 'dir/file')
+ sbox.simple_commit()
+
+ # Edit the file so that it would have inconsistent EOLs.
+ sbox.simple_append('dir/file', 'test\n\r\n', truncate=True)
+
+ # Attempt to export the working copy, expect an error.
+ export_target = sbox.add_wc_path('export')
+ svntest.actions.run_and_verify_svn(
+ None,
+ "svn: E135000: Inconsistent line ending style\n",
+ 'export',
+ sbox.wc_dir,
+ export_target)
+
########################################################################
# Run the tests
@@ -1192,6 +1238,8 @@ test_list = [ None,
export_file_externals2,
export_revision_with_root_relative_external,
export_keyword_translation_inconsistent_eol,
+ export_working_copy_eol_translation,
+ export_working_copy_inconsistent_eol,
]
if __name__ == '__main__':
