Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 2.0.1, 2.0.2, and 2.0.3

stable tag: fix illegal multibyte sequence error with non-English commit message

Because util.i18n returns 'utf-8' string instead of local string, non-English
commit message becomes invalid on non-UTF-8 environment.
This fixes the problem by using hgqt.i18n, which returns unicode object.

Now message is always unicode, this removes if-clause to skip
hglib.fromunicode.

Changeset 8f1b91111b43

Parent ec4f9e54d69d

by Yuya Nishihara

Changes to one file · Browse files at 8f1b91111b43 Showing diff from parent ec4f9e54d69d Diff from another changeset...

 
5
6
7
8
 
9
10
 
11
12
13
 
251
252
253
254
255
256
 
 
257
258
259
 
302
303
304
305
306
307
 
 
308
309
310
 
5
6
7
 
8
9
 
10
11
12
13
 
251
252
253
 
 
 
254
255
256
257
258
 
301
302
303
 
 
 
304
305
306
307
308
@@ -5,9 +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.   -from tortoisehg.util import hglib, i18n +from tortoisehg.util import hglib  from tortoisehg.hgqt.i18n import _ -from tortoisehg.hgqt import qtlib, cmdui +from tortoisehg.hgqt import qtlib, cmdui, i18n    from PyQt4.QtCore import *  from PyQt4.QtGui import * @@ -251,9 +251,8 @@
  ctx = self.repo[self.rev]   msgset = keep._('Added tag %s for changeset %s')   message = (english and msgset['id'] or msgset['str']) \ - % (tag, str(ctx)) - if not isinstance(message, str): - message = hglib.fromunicode(message) + % (tagu, str(ctx)) + message = hglib.fromunicode(message)     def finished():   if exists: @@ -302,9 +301,8 @@
  return   if not message:   msgset = keep._('Removed tag %s') - message = (english and msgset['id'] or msgset['str']) % tag - if not isinstance(message, str): - message = hglib.fromunicode(message) + message = (english and msgset['id'] or msgset['str']) % tagu + message = hglib.fromunicode(message)     def finished():   self.set_status(_("Tag '%s' has been removed") % tagu, True)