[tui] ctx.description(): always tries to convert to unicode (closes #98647)

tries to convert to unicode like hgviewlib.hggraph.getlog.

authorTakumi IINO <trot.thunder@gmail.com>
changeset67eb0203eace
branchstable
phasepublic
hiddenno
parent revision#f475bc6966e8 [qt] re-enable "reselect currently visited rev and file on reload" (closes #93641)
child revision#6ed904105bcc [tui] help shortcut command raise list index out of range (closes #98677)
files modified by this revision
hgviewlib/curses/hgrepoviewer.py
# HG changeset patch
# User Takumi IINO <trot.thunder@gmail.com>
# Date 1339410909 -7200
# Mon Jun 11 12:35:09 2012 +0200
# Branch stable
# Node ID 67eb0203eacebbb727c8c1e2f7e5bcc13b6c08fe
# Parent f475bc6966e8d97fe4476de67ffda9ce92c35cb9
[tui] ctx.description(): always tries to convert to unicode (closes #98647)

tries to convert to unicode like hgviewlib.hggraph.getlog.

diff --git a/hgviewlib/curses/hgrepoviewer.py b/hgviewlib/curses/hgrepoviewer.py
@@ -27,11 +27,11 @@
1  import urwid
2  from urwid import AttrWrap, Pile, Columns, SolidFill, signals
3  from urwid.util import is_mouse_press
4 
5  from hgviewlib.hggraph import HgRepoListWalker
6 -from hgviewlib.util import exec_flag_changed, isbfile
7 +from hgviewlib.util import exec_flag_changed, isbfile, tounicode
8 
9  from hgviewlib.curses.graphlog import RevisionsWalker
10  from hgviewlib.curses.manifest import ManifestWalker
11  from hgviewlib.curses import (Body, SourceText, ScrollableListBox,
12                                register_command, unregister_command,
@@ -202,11 +202,11 @@
13              return
14          numbering = False
15          flag = ''
16          if filename is None: # source content is the changeset description
17              wrap = 'space' # Do not cut description and wrap content
18 -            data = ctx.description()
19 +            data = tounicode(ctx.description())
20              if pygments:
21                  lexer = lexers.RstLexer()
22          else: # source content is a file
23              wrap = 'clip' # truncate lines
24              flag, data = self.manifest_walker.filedata(filename)