Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 1.1, 1.1.1, and 1.1.2

visdiff: drop support for ancestor snapshots

It was an interesting idea; but none of the existing visual diff tools
could use an ancestor version when displaying merge diffs. So I'm removing
the generation of what was a redundant node snapshot. This should make
merge visualizations a bit faster to start.

Changeset b4d349e3a302

Parent 9cdeea94eada

by Steve Borho

Changes to 2 files · Browse files at b4d349e3a302 Showing diff from parent 9cdeea94eada Diff from another changeset...

 
8
9
10
11
12
13
14
 
34
35
36
37
38
39
40
 
64
65
66
67
68
69
70
71
 
8
9
10
 
11
12
13
 
33
34
35
 
36
37
38
 
62
63
64
 
 
65
66
67
@@ -8,7 +8,6 @@
 beyondcompare3.gui=True  beyondcompare3.diffargs=/lro /lefttitle='$plabel1' /righttitle='$clabel' /solo /expandall $parent $child  beyondcompare3.diff3args=$parent1 $parent2 $child /lefttitle='$plabel1' /centertitle='$clabel' /righttitle='$plabel2' /solo /ro -;beyondcompare3.diff3args=$parent1 $parent2 $ancestor /mergeoutput=$child /lefttitle='$plabel1' /centertitle='$alabel' /righttitle='$plabel2' /outputtitle='$clabel' /solo /expandall /ro  beyondcompare3.dirdiff=True    araxis.regkey=SOFTWARE\Classes\TypeLib\{46799e0a-7bd1-4330-911c-9660bb964ea2}\7.0\HELPDIR @@ -34,7 +33,6 @@
 kdiff3.gui=True  kdiff3.diffargs=--L1 '$plabel1' --L2 '$clabel' $parent $child  kdiff3.diff3args=--L1 '$plabel1' --L2 '$clabel' --L3 '$plabel2' $parent1 $child $parent2 -;kdiff3.diff3args=--L1 '$alabel' --L2 '$plabel1' --L3 '$plabel2' $ancestor $parent1 $parent2 -o $child  kdiff3.dirdiff=True    diffmerge.regkey=Software\SourceGear\SourceGear DiffMerge\ @@ -64,8 +62,6 @@
 tortoisemerge.gui=True  tortoisemerge.diffargs=/base:$parent /mine:$child /basename:'$plabel1' /minename:'$clabel'  ; TortoiseMerge does not support three-way file or directory comparisons -; This command looked like it worked, but it overwrote the merge results -;tortoisemerge.diff3args=/base:$ancestor /mine:$parent1 /theirs:$parent2 /merged:$child /basename:'$alabel' /minename:'$plabel1' /theirsname:'$plabel2' /mergedname:'$clabel'    ecmerge.priority=-10  ecmerge.args=$base $local $other --mode=merge3 --title0=base --title1=local --title2=other --to=$output
 
29
30
31
32
 
33
34
35
 
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
 
 
242
243
244
 
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
 
335
336
337
338
339
340
341
342
 
343
344
345
 
432
433
434
435
 
436
437
438
 
451
452
453
454
455
456
457
458
459
460
461
462
463
464
 
 
465
466
467
 
471
472
473
474
475
 
 
476
477
478
 
559
560
561
562
563
564
 
 
 
565
566
567
 
580
581
582
583
584
585
586
 
 
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
 
 
610
611
612
613
 
614
615
616
617
618
 
 
619
620
621
622
 
623
624
625
626
627
 
 
628
629
630
631
632
 
633
634
635
 
29
30
31
 
32
33
34
35
 
227
228
229
 
 
 
 
 
 
 
 
 
230
 
 
231
232
233
234
235
 
261
262
263
 
264
265
266
267
 
268
269
270
271
272
 
273
274
275
 
323
324
325
 
 
 
 
 
326
327
328
329
 
416
417
418
 
419
420
421
422
 
435
436
437
 
 
 
 
 
 
 
 
438
 
 
439
440
441
442
443
 
447
448
449
 
 
450
451
452
453
454
 
535
536
537
 
 
 
538
539
540
541
542
543
 
556
557
558
 
559
 
 
560
561
562
563
564
565
 
566
567
568
569
 
570
571
572
573
574
 
575
576
577
578
579
 
 
580
581
582
583
 
 
584
585
586
587
 
 
588
589
590
591
 
 
592
593
594
595
 
 
596
597
598
599
 
 
 
600
601
602
603
@@ -29,7 +29,7 @@
  openflags = 0    # Match parent2 first, so 'parent1?' will match both parent1 and parent -_regex = '\$(parent2|parent1?|child|plabel1|plabel2|clabel|ancestor|alabel)' +_regex = '\$(parent2|parent1?|child|plabel1|plabel2|clabel)'    _nonexistant = _('[non-existant]')   @@ -227,18 +227,9 @@
  files = mod_b | rem_b | ((mod_a | add_a) - add_b)   dir1b = snapshot(repo, files, ctx1b, tmproot)[0]   label1b = '@%d' % ctx1b.rev() - # snapshot for ancestor revision - ctxa = ctx1a.ancestor(ctx1b) - if ctxa == ctx1a: - dira = dir1a - elif ctxa == ctx1b: - dira = dir1b - else: - dira = snapshot(repo, MAR, ctxa, tmproot)[0] - labela = '@%d' % ctxa.rev()   else: - dir1b, dira = None, None - label1b, labela = '', '' + dir1b = None + label1b = ''     if ctx2.rev() is not None:   # If ctx2 is not the working copy, create a snapshot for it @@ -270,18 +261,15 @@
  label1a, dir1a = getfile(lfile, dir1a, label1a)   if do3way:   label1b, dir1b = getfile(lfile, dir1b, label1b) - labela, dira = getfile(lfile, dira, labela)   label2, dir2 = getfile(lfile, dir2, label2)   if do3way:   label1a += '[local]'   label1b += '[other]' - labela += '[ancestor]'   label2 += '[merged]'     # Function to quote file/dir names in the argument string   replace = dict(parent=dir1a, parent1=dir1a, parent2=dir1b,   plabel1=label1a, plabel2=label1b, - ancestor=dira, alabel=labela,   clabel=label2, child=dir2)   launchtool(diffcmd, args, replace, True)   @@ -335,11 +323,7 @@
  self.set_default_size(400, 250)   self.set_has_separator(False)   - if ctx1b: - ctxa = ctx1a.ancestor(ctx1b) - else: - ctxa = ctx1a - self.ctxs = (ctx1a, ctx1b, ctxa, ctx2) + self.ctxs = (ctx1a, ctx1b, ctx2)   self.copies = cpy   self.ui = repo.ui   @@ -432,7 +416,7 @@
  gobject.idle_add(self.fillmodel, repo, model, sa, sb)     def fillmodel(self, repo, model, sa, sb): - ctx1a, ctx1b, ctxa, ctx2 = self.ctxs + ctx1a, ctx1b, ctx2 = self.ctxs   mod_a, add_a, rem_a = sa   mod_b, add_b, rem_b = sb   sources = set(self.copies.values()) @@ -451,17 +435,9 @@
  files = sources | mod_b | rem_b | ((mod_a | add_a) - add_b)   dir1b = snapshot(repo, files, ctx1b, tmproot)[0]   rev1b = '@%d' % ctx1b.rev() - if ctxa == ctx1a: - dira = dir1a - elif ctxa == ctx1b: - dira = dir1b - else: - # snapshot for ancestor revision - dira = snapshot(repo, MAR, ctxa, tmproot)[0] - reva = '@%d' % ctxa.rev()   else: - dir1b, dira = None, None - rev1b, reva = '', '' + dir1b = None + rev1b = ''     # If ctx2 is the working copy, use it directly   if ctx2.rev() is None: @@ -471,8 +447,8 @@
  dir2 = snapshot(repo, MA, ctx2, tmproot)[0]   rev2 = '@%d' % ctx2.rev()   - self.dirs = (dir1a, dir1b, dira, dir2) - self.revs = (rev1a, rev1b, reva, rev2) + self.dirs = (dir1a, dir1b, dir2) + self.revs = (rev1a, rev1b, rev2)     def get_status(file, mod, add, rem):   if file in mod: @@ -559,9 +535,9 @@
  def launch(self, st, fname):   fname = hglib.fromutf(fname)   source = self.copies.get(fname, None) - dir1a, dir1b, dira, dir2 = self.dirs - rev1a, rev1b, reva, rev2 = self.revs - ctx1a, ctx1b, ctxa, ctx2 = self.ctxs + dir1a, dir1b, dir2 = self.dirs + rev1a, rev1b, rev2 = self.revs + ctx1a, ctx1b, ctx2 = self.ctxs     def getfile(ctx, dir, fname, source):   m = ctx.manifest() @@ -580,56 +556,48 @@
  local, file1a = getfile(ctx1a, dir1a, fname, source)   if ctx1b:   other, file1b = getfile(ctx1b, dir1b, fname, source) - ancestor, filea = getfile(ctxa, dira, fname, source)   else: - other, ancestor = fname, fname - file1b, filea = None, None + other = fname, fname + file1b = None   fname, file2 = getfile(ctx2, dir2, fname, None)     label1a = local+rev1a   label1b = other+rev1b - labela = ancestor+reva   label2 = fname+rev2   if ctx1b:   label1a += '[local]'   label1b += '[other]' - labela += '[ancestor]'   label2 += '[merged]'     # Function to quote file/dir names in the argument string   replace = dict(parent=file1a, parent1=file1a, plabel1=label1a,   parent2=file1b, plabel2=label1b, - ancestor=filea, alabel=labela,   clabel=label2, child=file2)   args = ctx1b and self.mergeopts or self.diffopts   launchtool(self.diffpath, args, replace, False)     def p1dirdiff(self, button): - dir1a, dir1b, dira, dir2 = self.dirs - rev1a, rev1b, reva, rev2 = self.revs + dir1a, dir1b, dir2 = self.dirs + rev1a, rev1b, rev2 = self.revs     replace = dict(parent=dir1a, parent1=dir1a, plabel1=rev1a, - parent2='', plabel2='', ancestor='', alabel='', - clabel=rev2, child=dir2) + parent2='', plabel2='', clabel=rev2, child=dir2)   launchtool(self.diffpath, self.diffopts, replace, False)     def p2dirdiff(self, button): - dir1a, dir1b, dira, dir2 = self.dirs - rev1a, rev1b, reva, rev2 = self.revs + dir1a, dir1b, dir2 = self.dirs + rev1a, rev1b, rev2 = self.revs     replace = dict(parent=dir1b, parent1=dir1b, plabel1=rev1b, - parent2='', plabel2='', ancestor='', alabel='', - clabel=rev2, child=dir2) + parent2='', plabel2='', clabel=rev2, child=dir2)   launchtool(self.diffpath, self.diffopts, replace, False)     def threewaydirdiff(self, button): - dir1a, dir1b, dira, dir2 = self.dirs - rev1a, rev1b, reva, rev2 = self.revs + dir1a, dir1b, dir2 = self.dirs + rev1a, rev1b, rev2 = self.revs     replace = dict(parent=dir1a, parent1=dir1a, plabel1=rev1a, - parent2=dir1b, plabel2=rev1b, - ancestor=dira, alabel=reva, - clabel=dir2, child=rev2) + parent2=dir1b, plabel2=rev1b, clabel=dir2, child=rev2)   launchtool(self.diffpath, self.mergeopts, replace, False)