##// 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 revs = opts.get('rev')
122 revs = opts.get('rev')
123 change = opts.get('change')
123 change = opts.get('change')
124 args = ' '.join(diffopts)
124 args = ' '.join(map(util.shellquote, diffopts))
125 do3way = '$parent2' in args
125 do3way = '$parent2' in args
126
126
127 if revs and change:
127 if revs and change:
@@ -280,8 +280,7 b' def uisetup(ui):'
280 cmd = cmd[4:]
280 cmd = cmd[4:]
281 if not path:
281 if not path:
282 path = cmd
282 path = cmd
283 diffopts = ui.config('extdiff', 'opts.' + cmd, '')
283 diffopts = shlex.split(ui.config('extdiff', 'opts.' + cmd, ''))
284 diffopts = diffopts and [diffopts] or []
285 elif cmd.startswith('opts.'):
284 elif cmd.startswith('opts.'):
286 continue
285 continue
287 else:
286 else:
@@ -19,6 +19,8 b' Should diff cloned directories:'
19 $ echo "[extdiff]" >> $HGRCPATH
19 $ echo "[extdiff]" >> $HGRCPATH
20 $ echo "cmd.falabala=echo" >> $HGRCPATH
20 $ echo "cmd.falabala=echo" >> $HGRCPATH
21 $ echo "opts.falabala=diffing" >> $HGRCPATH
21 $ echo "opts.falabala=diffing" >> $HGRCPATH
22 $ echo "cmd.edspace=echo" >> $HGRCPATH
23 $ echo 'opts.edspace="name <user@example.com>"' >> $HGRCPATH
22
24
23 $ hg falabala
25 $ hg falabala
24 diffing a.000000000000 a
26 diffing a.000000000000 a
@@ -168,6 +170,16 b' Test extdiff with --option:'
168 diffing this */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob)
170 diffing this */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob)
169 [1]
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 Test with revsets:
183 Test with revsets:
172
184
173 $ hg extdif -p echo -c "rev(1)"
185 $ hg extdif -p echo -c "rev(1)"
General Comments 0
You need to be logged in to leave comments. Login now