Commits

Yuya Nishihara committed 5719b55

commit: keep userhist in unicode to avoid comparison failure to QString

It seems unicode.__eq__ internally calls str(right)-equivalent in place of
unicode(right), which does not work if right object is non-ascii QString.

http://hg.python.org/cpython/file/v2.7.5/Objects/unicodeobject.c#l6126
http://hg.python.org/cpython/file/v2.7.5/Objects/unicodeobject.c#l1095

Comments (0)

Files changed (1)

tortoisehg/hgqt/commit.py

         self.msghistory = list(s.value(gpref+'history-'+repoid).toStringList())
         self.msghistory = [unicode(m) for m in self.msghistory if m]
         self.updateRecentMessages()
-        self.userhist = s.value(gpref+'userhist').toStringList()
+        self.userhist = map(unicode, s.value(gpref+'userhist').toStringList())
         self.userhist = [u for u in self.userhist if u]
         try:
             curmsg = self.repo.opener('cur-message.txt').read()