Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.9, 0.9.1, and 0.9.1.1

datamine: fix unneeded escaping of description in status bar

gtk.Tooltips needs escaping of tooltip text, but no need escaping
in the label of StatusBar. To avoid this, I inserted a new column,
original (non-escaped) description to both ListStore structures.

Changeset d06b36b981f8

Parent ba10c2ef3f59

by Yuki KODAMA

Changes to one file · Browse files at d06b36b981f8 Showing diff from parent ba10c2ef3f59 Diff from another changeset...

 
27
28
29
30
31
 
 
 
32
33
34
35
36
37
38
39
40
 
 
 
 
 
 
41
42
43
 
252
253
254
255
 
256
257
258
 
 
 
259
260
261
 
344
345
346
 
347
348
349
 
363
364
365
366
 
367
368
369
 
478
479
480
481
 
482
483
484
 
 
485
486
487
 
500
501
502
503
504
505
506
 
 
 
 
507
508
509
 
613
614
615
 
616
617
618
 
643
644
645
646
 
647
648
649
 
785
786
787
788
 
789
790
791
792
793
794
 
 
795
796
797
 
27
28
29
 
 
30
31
32
33
34
35
36
 
 
 
 
 
37
38
39
40
41
42
43
44
45
 
254
255
256
 
257
258
 
 
259
260
261
262
263
264
 
347
348
349
350
351
352
353
 
367
368
369
 
370
371
372
373
 
482
483
484
 
485
486
487
 
488
489
490
491
492
 
505
506
507
 
 
 
 
508
509
510
511
512
513
514
 
618
619
620
621
622
623
624
 
649
650
651
 
652
653
654
655
 
791
792
793
 
794
795
796
797
798
 
 
799
800
801
802
803
@@ -27,17 +27,19 @@
 # Column indexes for grep  GCOL_REVID = 0  GCOL_LINE = 1 # matched line -GCOL_DESC = 2 # summary -GCOL_PATH = 3 +GCOL_EDESC = 2 # escaped summary +GCOL_DESC = 3 # summary +GCOL_PATH = 4    # Column indexes for annotation  ACOL_REVID = 0  ACOL_LINE = 1 # file line -ACOL_DESC = 2 # summary -ACOL_PATH = 3 -ACOL_COLOR = 4 -ACOL_USER = 5 -ACOL_LNUM = 6 # line number +ACOL_EDESC = 2 # escaped summary +ACOL_DESC = 3 # summary +ACOL_PATH = 4 +ACOL_COLOR = 5 +ACOL_USER = 6 +ACOL_LNUM = 7 # line number    class DataMineDialog(gdialog.GDialog):   @@ -252,10 +254,11 @@
  date = hglib.toutf(hglib.displaytime(ctx.date()))   text = hglib.tounicode(ctx.description()).replace(u'\0', '')   lines = text.splitlines() - summary = gtklib.markup_escape_text(lines and lines[0] or '') + summary = hglib.toutf(lines and lines[0] or '')   desc = '%s@%s %s "%s"' % (author, rev, date, summary) - self.changedesc[rev] = (desc, author) - return (desc, author) + desc_esc = gtklib.markup_escape_text(desc) + self.changedesc[rev] = (desc, desc_esc, author) + return self.changedesc[rev]     def search_clicked(self, button, data):   self.add_search_page() @@ -344,6 +347,7 @@
  results = gtk.ListStore(str, # revision id   str, # matched line (utf-8)   str, # description (utf-8, escaped) + str, # description (utf-8)   str) # file path (utf-8)   treeview.set_model(results)   treeview.set_search_equal_func(self.search_in_grep) @@ -363,7 +367,7 @@
  column.add_attribute(cell, 'text', col)   treeview.append_column(column)   if hasattr(treeview, 'set_tooltip_column'): - treeview.set_tooltip_column(GCOL_DESC) + treeview.set_tooltip_column(GCOL_EDESC)   scroller = gtk.ScrolledWindow()   scroller.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)   scroller.add(treeview) @@ -478,10 +482,11 @@
  (path, revid, text) = line.split(':', 2)   except ValueError:   continue - tip, user = self.get_rev_desc(long(revid)) + desc, desc_esc, user = self.get_rev_desc(long(revid))   if self.tabwidth:   text = text.expandtabs(self.tabwidth) - model.append((revid, hglib.toutf(text[:512]), tip, hglib.toutf(path))) + model.append((revid, hglib.toutf(text[:512]), desc_esc, + desc, hglib.toutf(path)))   if thread.isAlive():   return True   else: @@ -500,10 +505,10 @@
  (path, focus) = treeview.get_cursor()   model = treeview.get_model()   if path is not None and model is not None: - paths = model.get_iter(path) - self.currev = model[paths][GCOL_REVID] - self.curpath = hglib.fromutf(model[paths][GCOL_PATH]) - self.stbar.set_status_text(hglib.toutf(model[paths][GCOL_DESC])) + iter = model.get_iter(path) + self.currev = model[iter][GCOL_REVID] + self.curpath = hglib.fromutf(model[iter][GCOL_PATH]) + self.stbar.set_status_text(hglib.toutf(model[iter][GCOL_DESC]))     def close_current_page(self):   num = self.notebook.get_current_page() @@ -613,6 +618,7 @@
  results = gtk.ListStore(str, # revision id   str, # file line (utf-8)   str, # description (utf-8, escaped) + str, # description (utf-8)   str, # file path (utf-8)   str, # color   str, # author (utf-8) @@ -643,7 +649,7 @@
  self.add_header_context_menu(column, context_menu)   treeview.set_headers_clickable(True)   if hasattr(treeview, 'set_tooltip_column'): - treeview.set_tooltip_column(ACOL_DESC) + treeview.set_tooltip_column(ACOL_EDESC)   results.path = path   results.rev = revid   scroller = gtk.ScrolledWindow() @@ -785,13 +791,13 @@
  rowrev = long(revid)   except ValueError:   continue - tip, user = self.get_rev_desc(rowrev) + desc, desc_esc, user = self.get_rev_desc(rowrev)   ctx = self.repo[rowrev]   color = colormap.get_color(ctx, curdate)   if self.tabwidth:   text = text.expandtabs(self.tabwidth) - model.append((revid, hglib.toutf(text[:512]), tip, hglib.toutf(path.strip()), - color, user, len(model)+1)) + model.append((revid, hglib.toutf(text[:512]), desc_esc, desc, + hglib.toutf(path.strip()), color, user, len(model)+1))   if thread.isAlive():   return True   else: