Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 2.1.2 and tip

stable htmlui: use cgi.escape in place of Qt.escape

Qt.escape implicitly upgrades the given string to unicode. Because htmlui
is Mercurial-level API, it should keep str object of local-encoding.

Changeset 38f283b2d44e

Parent 4ca096e61c5d

by Yuya Nishihara

Changes to one file · Browse files at 38f283b2d44e Showing diff from parent 4ca096e61c5d Diff from another changeset...

 
5
6
7
8
 
9
10
11
12
13
14
 
43
44
45
46
47
 
48
49
50
 
5
6
7
 
8
9
10
 
11
12
13
 
42
43
44
 
 
45
46
47
48
@@ -5,10 +5,9 @@
 # This software may be used and distributed according to the terms of the  # GNU General Public License version 2, incorporated herein by reference.   -import os, time +import os, cgi, time    from mercurial import ui -from PyQt4 import QtCore  from tortoisehg.hgqt import qtlib  from tortoisehg.util import hglib   @@ -43,8 +42,7 @@
    def style(self, msg, label):   'Escape message for safe HTML, then apply specified style' - msg = QtCore.Qt.escape(msg) - msg = msg.replace('\n', '<br />') + msg = cgi.escape(msg).replace('\n', '<br />')   style = qtlib.geteffect(label)   return '<span style="%s">%s</span>' % (style, msg)