changelog: lazy decode user (API)
authorGregory Szorc <gregory.szorc@gmail.com>
Sat, 27 Feb 2016 22:34:18 -0800
changeset 28307 86de91c56355
parent 28306 1778770e1982
child 28308 4de74eda1d65
changelog: lazy decode user (API) This appears to show a similar speedup as the previous patch.
mercurial/changelog.py
mercurial/context.py
--- 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):