# HG changeset patch # User Thomas Arendsen Hein # Date 1331541570 -3600 # Node ID 55174ab81973f87dc3800565f04cdddac94928e7 # Parent ce292f1379bad02a6478fee0aff8ce8ae8a3ee82 extdiff: escape filenames with vim/DirDiff and make quoting work with Windows Use vim function fnameescape() on filenames. Use double quotes for arguments so cmd.exe is happy. diff -r ce292f1379ba -r 55174ab81973 contrib/win32/mercurial.ini --- a/contrib/win32/mercurial.ini Thu Mar 08 13:35:27 2012 -0600 +++ b/contrib/win32/mercurial.ini Mon Mar 12 09:39:30 2012 +0100 @@ -71,7 +71,7 @@ ;cmd.bc3diff = C:\Program Files\Beyond Compare 3\BCompare.exe ;cmd.vdiff = C:\Progra~1\TortoiseSVN\bin\TortoiseMerge.exe ;cmd.vimdiff = gvim.exe -;opts.vimdiff = -f '+next' '+execute "DirDiff ".argv(0)." ".argv(1)' +;opts.vimdiff = -f "+next" "+execute 'DirDiff' fnameescape(argv(0)) fnameescape(argv(1))" [hgk] diff -r ce292f1379ba -r 55174ab81973 hgext/extdiff.py --- a/hgext/extdiff.py Thu Mar 08 13:35:27 2012 -0600 +++ b/hgext/extdiff.py Mon Mar 12 09:39:30 2012 +0100 @@ -33,7 +33,8 @@ # (see http://www.vim.org/scripts/script.php?script_id=102) Non # English user, be sure to put "let g:DirDiffDynamicDiffText = 1" in # your .vimrc - vimdiff = gvim -f '+next' '+execute "DirDiff" argv(0) argv(1)' + vimdiff = gvim -f "+next" \\ + "+execute 'DirDiff' fnameescape(argv(0)) fnameescape(argv(1))" Tool arguments can include variables that are expanded at runtime:: diff -r ce292f1379ba -r 55174ab81973 tests/test-extension.t --- a/tests/test-extension.t Thu Mar 08 13:35:27 2012 -0600 +++ b/tests/test-extension.t Mon Mar 12 09:39:30 2012 +0100 @@ -301,7 +301,8 @@ # (see http://www.vim.org/scripts/script.php?script_id=102) Non # English user, be sure to put "let g:DirDiffDynamicDiffText = 1" in # your .vimrc - vimdiff = gvim -f '+next' '+execute "DirDiff" argv(0) argv(1)' + vimdiff = gvim -f "+next" \ + "+execute 'DirDiff' fnameescape(argv(0)) fnameescape(argv(1))" Tool arguments can include variables that are expanded at runtime: