Hi,
All my manual tests for the current --invoke-diff-cmd work fine, but I
cannot get the test suite to work.
I added the following new test (nr 49) to diff_tests.py:
[[[
# Check the order of the arguments for an external diff tool
def diff_invoke_external_diffcmd(sbox):
"svn diff --diff-invoke-cmd has correct arguments"
sbox.build(read_only = True)
os.chdir(sbox.wc_dir)
iota_path = 'iota'
svntest.main.file_append(iota_path, "new text in iota")
expected_output = svntest.verify.ExpectedOutput([
"Index: iota\n",
"===================================================================\n",
"--- l1\n",
"+++ l2\n",
"@@ -1 +1,2 @@\n",
"This is the file 'iota'.\n",
"+new text in iota\n",
"\ No newline at end of file\n",
# os.path.abspath(svntest.wc.text_base_path("iota")) + "\n",
#os.path.abspath("iota") + "\n
])
# Check that the output of diff corresponds with the expected arguments,
# in the correct order.
svntest.actions.run_and_verify_svn(None, expected_output, [],
'diff', '--invoke-diff-cmd="diff
-u --label l1 %f1% --label l2 %f2%', "",
iota_path)
]]]
************************************************************************
If I now run this test, svn diff correctly expands the command (as
expected, see the line starting with "W: svn: E200012:"), but svn
crashes (the test fails too, but that is I think a separate problem)
g_at_musashi:~/trunk_ziff/subversion/tests/cmdline$ ./diff_tests.py 49
W: subversion/svn/diff-cmd.c:412,
W: subversion/libsvn_client/diff.c:2130,
W: subversion/libsvn_client/diff.c:1654,
W: subversion/libsvn_wc/diff_local.c:500,
W: subversion/libsvn_wc/status.c:2758,
W: subversion/libsvn_wc/status.c:1460,
W: subversion/libsvn_wc/status.c:1212,
W: subversion/libsvn_wc/status.c:931,
W: subversion/libsvn_wc/diff_local.c:364,
W: subversion/libsvn_wc/diff_editor.c:568,
W: subversion/libsvn_diff/diff_tree.c:1208,
W: subversion/libsvn_wc/diff_editor.c:2708,
W: subversion/libsvn_client/diff.c:975,
W: subversion/libsvn_client/diff.c:839,
W: subversion/libsvn_subr/io.c:3040: (apr_err=SVN_ERR_EXTERNAL_PROGRAM)
W: svn: E200012: '"diff -u --label l1 %f1% --label l2 %f2%' was expanded
to "diff -u --label l1
/home/g/trunk_ziff/subversion/tests/cmdline/svn-test-work/working_copies/diff_tests-49/.svn/pristine/2c/2c0aa9014a0cd07f01795a333d82485ef6d083e2.svn-base
--label l2
/home/g/trunk_ziff/subversion/tests/cmdline/svn-test-work/working_copies/diff_tests-49/iota
and returned 255
W: CWD:
/home/g/trunk_ziff/subversion/tests/cmdline/svn-test-work/working_copies/diff_tests-49
W: EXCEPTION: Failure: Command failed:
"/home/g/trunk_ziff/subversion/svn/svn diff --invoke-diff-cmd="diff -u
--label l1 %f1% --label l2 %f2% ..."; exit code 1
Traceback (most recent call last):
File "/home/g/trunk_ziff/subversion/tests/cmdline/svntest/main.py",
line 1550, in run
rc = self.pred.run(sandbox)
File
"/home/g/trunk_ziff/subversion/tests/cmdline/svntest/testcase.py", line
176, in run
return self.func(sandbox)
File "./diff_tests.py", line 3304, in diff_invoke_external_diffcmd
iota_path)
File
"/home/g/trunk_ziff/subversion/tests/cmdline/svntest/actions.py", line
282, in run_and_verify_svn
expected_exit, *varargs)
File
"/home/g/trunk_ziff/subversion/tests/cmdline/svntest/actions.py", line
320, in run_and_verify_svn2
exit_code, out, err = main.run_svn(want_err, *varargs)
File "/home/g/trunk_ziff/subversion/tests/cmdline/svntest/main.py",
line 682, in run_svn
*(_with_auth(_with_config_dir(varargs))))
File "/home/g/trunk_ziff/subversion/tests/cmdline/svntest/main.py",
line 365, in run_command
None, *varargs)
File "/home/g/trunk_ziff/subversion/tests/cmdline/svntest/main.py",
line 557, in run_command_stdin
'"; exit code ' + str(exit_code))
Failure: Command failed: "/home/g/trunk_ziff/subversion/svn/svn diff
--invoke-diff-cmd="diff -u --label l1 %f1% --label l2 %f2% ..."; exit
code 1
FAIL: diff_tests.py 49: svn diff --diff-invoke-cmd has correct arguments
g_at_musashi:~/trunk_ziff/subversion/tests/cmdline$
************************************************************************
Running the rejected output without svn works:
g_at_musashi:~/trunk_ziff/subversion/tests/cmdline$ diff -u --label l1
/home/g/trunk_ziff/subversion/tests/cmdline/svn-test-work/working_copies/diff_tests-49/.svn/pristine/2c/2c0aa9014a0cd07f01795a333d82485ef6d083e2.svn-base
--label l2
/home/g/trunk_ziff/subversion/tests/cmdline/svn-test-work/working_copies/diff_tests-49/iota
--- l1
+++ l2
@@ -1 +1,2 @@
This is the file 'iota'.
+new text in iota
\ No newline at end of file
g_at_musashi:~/trunk_ziff/subversion/tests/cmdline$
************************************************************************
So does running svn with the rejected output without the test suite:
g_at_musashi:~/trunk_ziff/subversion/tests/cmdline$
/home/g/trunk_ziff/subversion/svn/svn diff --invoke-diff-cmd="diff -u
--label l1 %f1% --label l2 %f2%"
Index: diff_tests.py
===================================================================
--- l1
+++ l2
@@ -3274,6 +3274,34 @@
... normal diff ensues ...
************************************************************************
So does changing into the directory I think it's normally operating in
and using the rejected output:
g_at_musashi:~/trunk_ziff/subversion/tests/cmdline$ cd
svn-test-work/working_copies/diff_tests-49/
g_at_musashi:~/trunk_ziff/subversion/tests/cmdline/svn-test-work/working_copies/diff_tests-49$
/home/g/trunk_ziff/subversion/svn/svn diff --invoke-diff-cmd="diff -u
--label l1 %f1% --label l2 %f2%"
Index: iota
===================================================================
--- l1
+++ l2
@@ -1 +1,2 @@
This is the file 'iota'.
+new text in iota
\ No newline at end of file
g_at_musashi:~/trunk_ziff/subversion/tests/cmdline/svn-test-work/working_copies/diff_tests-49$
************************************************************************
many thanks for any hints you might have for me,
Gabriela
Received on 2013-05-08 19:09:01 CEST