diff hgext/extdiff.py @ 16242:55174ab81973 stable

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.
author Thomas Arendsen Hein <thomas@intevation.de>
date Mon, 12 Mar 2012 09:39:30 +0100
parents a95efd378641
children 67964cda8701
line wrap: on
line diff
--- 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::