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

visdiff: add $repo $phash1 $phash2 and $chash variables

Users may use these variables in their diffargs and diff3args
configurations to add changeset hashes or the repository name.

Closes #1020

Changeset da8ee2d02077

Parent 557fcd2ebea1

by Steve Borho

Changes to one file · Browse files at da8ee2d02077 Showing diff from parent 557fcd2ebea1 Diff from another changeset...

 
29
30
31
32
 
33
34
35
 
92
93
94
 
95
96
97
 
267
268
269
270
271
272
273
 
 
 
274
275
276
 
322
323
324
 
325
326
327
 
572
573
574
 
 
575
576
577
 
579
580
581
 
582
583
 
 
584
585
586
587
588
589
 
590
591
 
 
592
593
594
595
596
597
 
598
599
 
 
600
601
602
 
29
30
31
 
32
33
34
35
 
92
93
94
95
96
97
98
 
268
269
270
 
271
272
 
273
274
275
276
277
278
 
324
325
326
327
328
329
330
 
575
576
577
578
579
580
581
582
 
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
@@ -29,7 +29,7 @@
  openflags = 0    # Match parent2 first, so 'parent1?' will match both parent1 and parent -_regex = '\$(parent2|parent1?|child|plabel1|plabel2|clabel)' +_regex = '\$(parent2|parent1?|child|plabel1|plabel2|clabel|repo|phash1|phash2|chash)'    _nonexistant = _('[non-existant]')   @@ -92,6 +92,7 @@
  diffcmd, diffopts, mergeopts = detectedtools[preferred]   replace = dict(parent=fname, parent1=fname,   plabel1=fname + _('[working copy]'), + repo='', phash1='', phash2='', chash='',   child=patchedfname, clabel=_('[original]'))   launchtool(diffcmd, diffopts, replace, True)   @@ -267,10 +268,11 @@
  label1b += '[other]'   label2 += '[merged]'   - # Function to quote file/dir names in the argument string   replace = dict(parent=dir1a, parent1=dir1a, parent2=dir1b,   plabel1=label1a, plabel2=label1b, - clabel=label2, child=dir2) + phash1=str(ctx1a), phash2=str(ctx1b), + repo=hglib.get_reponame(repo), + clabel=label2, child=dir2, chash=str(ctx2))   launchtool(diffcmd, args, replace, True)     # detect if changes were made to mirrored working files @@ -322,6 +324,7 @@
    self.set_default_size(400, 250)   self.set_has_separator(False) + self.reponame=hglib.get_reponame(repo)     self.ctxs = (ctx1a, ctx1b, ctx2)   self.copies = cpy @@ -572,6 +575,8 @@
  # Function to quote file/dir names in the argument string   replace = dict(parent=file1a, parent1=file1a, plabel1=label1a,   parent2=file1b, plabel2=label1b, + repo=self.reponame, + phash1=str(ctx1a), phash2=str(ctx1b), chash=str(ctx2),   clabel=label2, child=file2)   args = ctx1b and self.mergeopts or self.diffopts   launchtool(self.diffpath, args, replace, False) @@ -579,24 +584,33 @@
  def p1dirdiff(self, button):   dir1a, dir1b, dir2 = self.dirs   rev1a, rev1b, rev2 = self.revs + ctx1a, ctx1b, ctx2 = self.ctxs     replace = dict(parent=dir1a, parent1=dir1a, plabel1=rev1a, + repo=self.reponame, + phash1=str(ctx1a), phash2=str(ctx1b), chash=str(ctx2),   parent2='', plabel2='', clabel=rev2, child=dir2)   launchtool(self.diffpath, self.diffopts, replace, False)     def p2dirdiff(self, button):   dir1a, dir1b, dir2 = self.dirs   rev1a, rev1b, rev2 = self.revs + ctx1a, ctx1b, ctx2 = self.ctxs     replace = dict(parent=dir1b, parent1=dir1b, plabel1=rev1b, + repo=self.reponame, + phash1=str(ctx1a), phash2=str(ctx1b), chash=str(ctx2),   parent2='', plabel2='', clabel=rev2, child=dir2)   launchtool(self.diffpath, self.diffopts, replace, False)     def threewaydirdiff(self, button):   dir1a, dir1b, dir2 = self.dirs   rev1a, rev1b, rev2 = self.revs + ctx1a, ctx1b, ctx2 = self.ctxs     replace = dict(parent=dir1a, parent1=dir1a, plabel1=rev1a, + repo=self.reponame, + phash1=str(ctx1a), phash2=str(ctx1b), chash=str(ctx2),   parent2=dir1b, plabel2=rev1b, clabel=dir2, child=rev2)   launchtool(self.diffpath, self.mergeopts, replace, False)