[PATCH 5 of 8] encode/decode edited commit message

Andrey grooz-work at gorodok.net
Mon Nov 20 10:29:55 UTC 2006


# HG changeset patch
# User Andrey <grooz-work at gorodok.net>
# Date 1163358614 -21600
# Node ID e101210ee793840dfb04290b3fbd9fac05f9c4c2
# Parent  ad1e778d48b8e6ae6a75dd5b1cebf854f9fbc0e4
encode/decode edited commit message
(transplanted from ec3f55ed7276a122618b0724bcf23f50bfcfc5b8)

diff -r ad1e778d48b8 -r e101210ee793 mercurial/ui.py
--- a/mercurial/ui.py	Tue Nov 14 08:30:14 2006 +0600
+++ b/mercurial/ui.py	Mon Nov 13 01:10:14 2006 +0600
@@ -433,7 +433,7 @@ class ui(object):
                                       text=True)
         try:
             f = os.fdopen(fd, "w")
-            f.write(text)
+            f.write(self.encode(text))
             f.close()
 
             editor = (os.environ.get("HGEDITOR") or
@@ -445,7 +445,7 @@ class ui(object):
                         onerr=util.Abort, errprefix=_("edit failed"))
 
             f = open(name)
-            t = f.read()
+            t = self.decode(f.read())
             f.close()
             t = re.sub("(?m)^HG:.*\n", "", t)
         finally:



More information about the Mercurial-devel mailing list