##// END OF EJS Templates
extdiff: quote user-supplied options passed to shell...
Michael Fyles -
r23138:72a89cf8 stable
parent child Browse files
Show More
@@ -121,7 +121,7 b' def dodiff(ui, repo, diffcmd, diffopts, '
121 121
122 122 revs = opts.get('rev')
123 123 change = opts.get('change')
124 args = ' '.join(diffopts)
124 args = ' '.join(map(util.shellquote, diffopts))
125 125 do3way = '$parent2' in args
126 126
127 127 if revs and change:
@@ -280,8 +280,7 b' def uisetup(ui):'
280 280 cmd = cmd[4:]
281 281 if not path:
282 282 path = cmd
283 diffopts = ui.config('extdiff', 'opts.' + cmd, '')
284 diffopts = diffopts and [diffopts] or []
283 diffopts = shlex.split(ui.config('extdiff', 'opts.' + cmd, ''))
285 284 elif cmd.startswith('opts.'):
286 285 continue
287 286 else:
@@ -19,6 +19,8 b' Should diff cloned directories:'
19 19 $ echo "[extdiff]" >> $HGRCPATH
20 20 $ echo "cmd.falabala=echo" >> $HGRCPATH
21 21 $ echo "opts.falabala=diffing" >> $HGRCPATH
22 $ echo "cmd.edspace=echo" >> $HGRCPATH
23 $ echo 'opts.edspace="name <user@example.com>"' >> $HGRCPATH
22 24
23 25 $ hg falabala
24 26 diffing a.000000000000 a
@@ -168,6 +170,16 b' Test extdiff with --option:'
168 170 diffing this */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob)
169 171 [1]
170 172
173 Test extdiff's handling of options with spaces in them:
174
175 $ hg edspace -c 1
176 name <user@example.com> */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob)
177 [1]
178
179 $ hg extdiff -p echo -o "name <user@example.com>" -c 1
180 name <user@example.com> */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob)
181 [1]
182
171 183 Test with revsets:
172 184
173 185 $ hg extdif -p echo -c "rev(1)"
General Comments 0
You need to be logged in to leave comments. Login now