# HG changeset patch # User Matt Mackall # Date 1192081613 18000 # Node ID c728424d44c61416645e9d8d6e62523ea654fc74 # Parent 17a4b20eda7bcbb5cc7947a54d933549627bba60 revlog: fix caching of buffer objects diff --git a/mercurial/changelog.py b/mercurial/changelog.py --- a/mercurial/changelog.py +++ b/mercurial/changelog.py @@ -74,7 +74,7 @@ class appender: return ret def write(self, s): - self.data.append(s) + self.data.append(str(s)) self.offset += len(s) class changelog(revlog): diff --git a/mercurial/revlog.py b/mercurial/revlog.py --- a/mercurial/revlog.py +++ b/mercurial/revlog.py @@ -903,7 +903,7 @@ class revlog(object): if node == nullid: return "" if self._cache and self._cache[0] == node: - return self._cache[2] + return str(self._cache[2]) # look up what we need to read text = None @@ -924,7 +924,7 @@ class revlog(object): # do we have useful data cached? if self._cache and self._cache[1] >= base and self._cache[1] < rev: base = self._cache[1] - text = self._cache[2] + text = str(self._cache[2]) self._loadindex(base, rev + 1) else: self._loadindex(base, rev + 1) diff --git a/mercurial/util.py b/mercurial/util.py --- a/mercurial/util.py +++ b/mercurial/util.py @@ -1421,7 +1421,7 @@ class chunkbuffer(object): self.iter = False self.buf = collector.getvalue() if len(self.buf) == l: - s, self.buf = self.buf, '' + s, self.buf = str(self.buf), '' else: s, self.buf = self.buf[:l], buffer(self.buf, l) return s