# HG changeset patch
# User OHASHI Hideya <ohachige@gmail.com>
# Date 1187487889 -32400
# Node ID ac88a4feb97192bb7e6e8ff65464d36f40f480cb
# Parent  93e6391565f81db8467c85e0005700f6c601d41b
gtools: handling character encodings

diff -r 93e6391565f8 -r ac88a4feb971 hgext/gtools.py
--- a/hgext/gtools.py	Sat Aug 18 19:48:51 2007 +0900
+++ b/hgext/gtools.py	Sun Aug 19 10:44:49 2007 +0900
@@ -617,6 +617,7 @@ class GLog(GDialog):
                     lines = block.split('\n')
                     parents = []
                     for line in lines:
+                        line = util.fromlocal(line)
                         sep = line.index(':')
                         info = line[0:sep]
                         value = line[sep+1:].strip()
@@ -629,7 +630,7 @@ class GLog(GDialog):
                             log[info] = value
     
                     self.model.append((log['rev'], log['user'], log['summary'], log['date'], 
-                                       util.strdate(log['date'], '%a %b %d %H:%M:%S %Y', {})[0],
+                                       util.strdate(util.tolocal(log['date']), '%a %b %d %H:%M:%S %Y', {})[0],
                                        parents))
                 yield logtext is not None
 
@@ -684,6 +685,7 @@ class GLog(GDialog):
         lines_iter = iter(lines)
 
         for line in lines_iter:
+            line = util.fromlocal(line)
             if line.startswith('changeset:'):
                 buffer.insert_with_tags_by_name(buff_iter, line + '\n', 'changeset')
             if line.startswith('date:'):
@@ -1325,6 +1327,7 @@ class GStatus(GDialog):
                 difftext.seek(0)
                 iter = buffer.get_start_iter()
                 for line in difftext:
+                    line = util.fromlocal(line)
                     if line.startswith('---') or line.startswith('+++'):
                         buffer.insert_with_tags_by_name(iter, line, 'header')
                     elif line.startswith('-'):
