Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 1.0, 1.0.1, and 1.0.2

hglib: further fixup logic for hg-1.4 extdiff configurations

If extdiff configuration did not have any variables, add $parent1 $child as
visdiff.py used to do.

Changeset 04cbc9485753

Parent 3ee74d16161b

by Steve Borho

Changes to one file · Browse files at 04cbc9485753 Showing diff from parent 3ee74d16161b Diff from another changeset...

 
231
232
233
 
 
 
 
 
 
 
 
 
 
 
234
235
236
 
238
239
240
241
242
243
244
245
246
 
247
248
249
 
254
255
256
257
258
259
260
261
 
262
263
264
 
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
 
249
250
251
 
 
 
 
 
 
252
253
254
255
 
260
261
262
 
 
 
 
 
263
264
265
266
@@ -231,6 +231,17 @@
  global _difftools   if _difftools:   return _difftools + + def fixup_extdiff(diffopts): + if '$child' not in diffopts: + diffopts += ' $parent1 $child' + if '$parent2' in diffopts: + mergeopts = diffopts + diffopts = diffopts.replace('$parent2', '') + else: + mergeopts = None + return diffopts, mergeopts +   tools = {}   for cmd, path in ui.configitems('extdiff'):   if cmd.startswith('cmd.'): @@ -238,12 +249,7 @@
  if not path:   path = cmd   diffopts = ui.config('extdiff', 'opts.' + cmd, '') - diffopts = diffopts and [diffopts] or [] - if '$parent2' in diffopts: - mergeopts = diffopts - diffopts = diffopts.replace('$parent2', '') - else: - mergeopts = None + diffopts, mergeopts = fixup_extdiff(diffopts)   tools[cmd] = [path, diffopts, mergeopts]   elif cmd.startswith('opts.'):   continue @@ -254,11 +260,7 @@
  path = diffopts.pop(0)   else:   path, diffopts = cmd, [] - if '$parent2' in diffopts: - mergeopts = diffopts - diffopts = diffopts.replace('$parent2', '') - else: - mergeopts = None + diffopts, mergeopts = fixup_extdiff(' '.join(diffopts))   tools[cmd] = [path, diffopts, mergeopts]   mt = []   mergetools(ui, mt)