From 115d9ab4d4ca222139e5b0db87e59248bfb6410e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20St=C4=99pniowski?= Date: Fri, 7 Aug 2009 15:41:28 +0200 Subject: [PATCH] =?utf8?q?Umo=C5=BCliwianie=20ustawiania=20opisu=20zmian?= =?utf8?q?=20oraz=20nazwy=20u=C5=BCytkownika=20w=20unicode=20(utf-8).?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- lib/hg.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/hg.py b/lib/hg.py index 535707d8..a2702f6c 100644 --- a/lib/hg.py +++ b/lib/hg.py @@ -1,7 +1,10 @@ # -*- coding: utf-8 -*- import os import codecs -from mercurial import localrepo, ui, error, match, node +from mercurial import localrepo, ui, error, match, node, encoding + + +encoding.encoding = 'utf-8' class RepositoryDoesNotExist(Exception): @@ -48,7 +51,7 @@ class Repository(object): if path not in self._pending_files: self._pending_files.append(path) - def commit(self, message='hgshelve auto commit', key=None, user=None): + def commit(self, message=u'hgshelve auto commit', key=None, user=None): """ Commit unsynchronized data to disk. Arguments:: @@ -56,6 +59,11 @@ class Repository(object): - message: mercurial's changeset message - key: supply to sync only one key """ + if isinstance(message, unicode): + message = message.encode('utf-8') + if isinstance(user, unicode): + user = user.encode('utf-8') + commited = False rev = None files_to_add = [] -- 2.20.1