Mercurial > public > mercurial-scm > hg
diff tests/test-extdiff.t @ 23682:1642eb429536
windows: quote the specified string only when it has to be quoted
Before this patch, "windows.shellquote" (as used as "util.shellquote")
always quotes specified strings with double quotation marks, for
external process invocation.
But some problematic applications can't work correctly, when command
line arguments are quoted: see issue4463 for detail.
On the other hand, quoting itself is needed to specify arguments
containing whitespaces and/or some special characters exactly.
This patch makes "windows.shellquote" examine the specified string and
quote it only when it may have to be quoted for safety.
author | FUJIWARA Katsunori <foozy@lares.dti.ne.jp> |
---|---|
date | Thu, 25 Dec 2014 23:33:26 +0900 |
parents | 4075f2f8ea53 |
children | 5edb387158a1 |
line wrap: on
line diff
--- a/tests/test-extdiff.t Thu Dec 25 23:33:26 2014 +0900 +++ b/tests/test-extdiff.t Thu Dec 25 23:33:26 2014 +0900 @@ -107,11 +107,11 @@ $ echo a >> a #if windows $ hg --debug 4463a | grep '^running' - running '"echo" a-naked \'single quoted\' "double quoted" "*\\a" "*\\a"' in */extdiff.* (glob) + running 'echo a-naked \'single quoted\' "double quoted" *\\a *\\a' in */extdiff.* (glob) $ hg --debug 4463b | grep '^running' - running 'echo b-naked \'single quoted\' "double quoted" "*\\a" "*\\a"' in */extdiff.* (glob) + running 'echo b-naked \'single quoted\' "double quoted" *\\a *\\a' in */extdiff.* (glob) $ hg --debug echo | grep '^running' - running '"*echo*" "*\\a" "*\\a"' in */extdiff.* (glob) + running '*echo* *\\a *\\a' in */extdiff.* (glob) #else $ hg --debug 4463a | grep '^running' running '\'echo\' a-naked \'single quoted\' "double quoted" \'*/a\' \'$TESTTMP/a/a\'' in */extdiff.* (glob) @@ -138,15 +138,15 @@ > EOF #if windows $ hg --debug 4463b2 | grep '^running' - running 'echo b2-naked \'single quoted\' "double quoted" "*\\a" "*\\a"' in */extdiff.* (glob) + running 'echo b2-naked \'single quoted\' "double quoted" *\\a *\\a' in */extdiff.* (glob) $ hg --debug 4463b3 | grep '^running' - running 'echo b3-naked \'single quoted\' "double quoted" "*\\a" "*\\a"' in */extdiff.* (glob) + running 'echo b3-naked \'single quoted\' "double quoted" *\\a *\\a' in */extdiff.* (glob) $ hg --debug 4463b4 | grep '^running' - running 'echo "*\\a" "*\\a"' in */extdiff.* (glob) - $ hg --debug 4463b4 --option 'being quoted' | grep '^running' - running 'echo "being quoted" "*\\a" "*\\a"' in */extdiff.* (glob) - $ hg --debug extdiff -p echo --option 'being quoted' | grep '^running' - running '"echo" "being quoted" "*\\a" "*\\a"' in */extdiff.* (glob) + running 'echo *\\a *\\a' in */extdiff.* (glob) + $ hg --debug 4463b4 --option b4-naked --option 'being quoted' | grep '^running' + running 'echo b4-naked "being quoted" *\\a *\\a' in */extdiff.* (glob) + $ hg --debug extdiff -p echo --option echo-naked --option 'being quoted' | grep '^running' + running 'echo echo-naked "being quoted" *\\a *\\a' in */extdiff.* (glob) #else $ hg --debug 4463b2 | grep '^running' running 'echo b2-naked \'single quoted\' "double quoted" \'*/a\' \'$TESTTMP/a/a\'' in */extdiff.* (glob)