changeset 28307:86de91c56355

changelog: lazy decode user (API) This appears to show a similar speedup as the previous patch.
author Gregory Szorc <gregory.szorc@gmail.com>
date Sat, 27 Feb 2016 22:34:18 -0800
parents 1778770e1982
children 4de74eda1d65
files mercurial/changelog.py mercurial/context.py
diffstat 2 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/changelog.py	Sat Feb 27 22:25:14 2016 -0800
+++ b/mercurial/changelog.py	Sat Feb 27 22:34:18 2016 -0800
@@ -337,7 +337,7 @@
 
         Returns a 6-tuple consisting of the following:
           - manifest node (binary)
-          - user (encoding.localstr)
+          - user (binary)
           - (time, timezone) 2-tuple of a float and int offset
           - list of files modified by the cset
           - commit message / description (binary)
@@ -350,7 +350,7 @@
         desc = text[last + 2:]
         l = text[:last].split('\n')
         manifest = bin(l[0])
-        user = encoding.tolocal(l[1])
+        user = l[1]
 
         tdata = l[2].split(' ', 2)
         if len(tdata) != 3:
--- a/mercurial/context.py	Sat Feb 27 22:25:14 2016 -0800
+++ b/mercurial/context.py	Sat Feb 27 22:34:18 2016 -0800
@@ -548,7 +548,7 @@
         return self._changeset[0]
 
     def user(self):
-        return self._changeset[1]
+        return encoding.tolocal(self._changeset[1])
     def date(self):
         return self._changeset[2]
     def files(self):