[ANN] GUI log, status, and commit

Hideya 'OhaC' OHASHI ohachige at gmail.com
Sat Aug 18 05:16:20 CDT 2007


Hi.

2007/8/12, Brad Schick <schickb at gmail.com>:
> I've created an extension for mercurial called gtools. The extension
> provides graphical status, log, and commit dialogs. The dialogs provide
> a nice way to see what is happening in a repository, and can launch
> external diff and edit tools that open source files in-place whenever
> possible. This lets you save changes made to source files directly back
> to your working copy.

gtools couldn't work well with LANG=ja_JP.EUC-JP
This patch can solve this issue.

# HG changeset patch
# User OHASHI Hideya <ohachige at gmail.com>
# Date 1187431815 -32400
# Node ID 6df30256834152db249a07682593d10f8d05bb77
# Parent  c16b1f9d9ff09c422b4c0ef9fd380b830692458b
gtools: handling character encodings

diff -r c16b1f9d9ff0 -r 6df302568341 hgext/gtools.py
--- a/hgext/gtools.py   Sat Aug 18 19:04:23 2007 +0900
+++ b/hgext/gtools.py   Sat Aug 18 19:10:15 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('-'):


More information about the Mercurial mailing list