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

changeset: add option to change coloring style for changeset viewer

'tortoisehg.diffcolorstyle' option is introduced, which has 'tortoisehg'
prefix, but it's placed in 'Diff' tab.

Changeset 7a7eda7adfc2

Parent 782189b23886

by Yuki KODAMA

Changes to 2 files · Browse files at 7a7eda7adfc2 Showing diff from parent 782189b23886 Diff from another changeset...

 
26
27
28
 
29
30
31
 
799
800
801
802
803
 
 
 
 
 
 
 
 
 
 
 
804
805
806
 
26
27
28
29
30
31
32
 
800
801
802
 
 
803
804
805
806
807
808
809
810
811
812
813
814
815
816
@@ -26,6 +26,7 @@
  self.stbar = stbar   self.glog_parent = None   self.bfile = None + self.colorstyle = repo.ui.config('tortoisehg', 'diffcolorstyle')     # initialize changeset/issue tracker link regex and dict   csmatch = r'(\b[0-9a-f]{12}(?:[0-9a-f]{28})?\b)' @@ -799,8 +800,17 @@
    tag_table.add(make_texttag('diff', font=self.rawfonts['fontdiff']))   tag_table.add(make_texttag('blue', foreground='blue')) - tag_table.add(make_texttag('red', foreground='red')) - tag_table.add(make_texttag('green', foreground='darkgreen')) + if self.colorstyle == 'background': + tag_table.add(make_texttag('red', + paragraph_background=gtklib.PRED)) + tag_table.add(make_texttag('green', + paragraph_background=gtklib.PGREEN)) + elif self.colorstyle == 'none': + tag_table.add(make_texttag('red')) + tag_table.add(make_texttag('green')) + else: + tag_table.add(make_texttag('red', foreground='red')) + tag_table.add(make_texttag('green', foreground='darkgreen'))   tag_table.add(make_texttag('black', foreground='black'))   tag_table.add(make_texttag('greybg',   paragraph_background='grey',
 
249
250
251
252
 
 
 
 
 
253
254
255
 
249
250
251
 
252
253
254
255
256
257
258
259
@@ -249,7 +249,11 @@
  ' Default: False')),   (_('Ignore Blank Lines'), 'diff.ignoreblanklines', ['False', 'True'],   _('Ignore changes whose lines are all blank.' - ' Default: False'))) + ' Default: False')), + (_('Coloring Style'), 'tortoisehg.diffcolorstyle', + ['none', 'foreground', 'background'], + _('Adjust the coloring style of diff lines in the changeset viewer.' + 'Default: foreground')))    class PathEditDialog(gtk.Dialog):   _protocols = (('ssh', _('ssh')), ('http', _('http')),