Mercurial > public > mercurial-scm > hg
comparison mercurial/revlog.py @ 35845:be923ce44d6a
revlog: correct type in check to verify rawtext is immutable
This fixes far more failures than I feel like it has any right to, so
there's clearly some subtle interaction between self._cache and other
parts of this code. :(
Differential Revision: https://phab.mercurial-scm.org/D1906
author | Augie Fackler <augie@google.com> |
---|---|
date | Thu, 18 Jan 2018 09:14:30 -0500 |
parents | f90f6fd130c1 |
children | 61326dd7cb8d |
comparison
equal
deleted
inserted
replaced
35844:522f868680ca | 35845:be923ce44d6a |
---|---|
2097 self._writeentry(transaction, ifh, dfh, entry, data, link, offset) | 2097 self._writeentry(transaction, ifh, dfh, entry, data, link, offset) |
2098 | 2098 |
2099 if alwayscache and rawtext is None: | 2099 if alwayscache and rawtext is None: |
2100 rawtext = deltacomputer._buildtext(revinfo, fh) | 2100 rawtext = deltacomputer._buildtext(revinfo, fh) |
2101 | 2101 |
2102 if type(rawtext) == str: # only accept immutable objects | 2102 if type(rawtext) == bytes: # only accept immutable objects |
2103 self._cache = (node, curr, rawtext) | 2103 self._cache = (node, curr, rawtext) |
2104 self._chainbasecache[curr] = chainbase | 2104 self._chainbasecache[curr] = chainbase |
2105 return node | 2105 return node |
2106 | 2106 |
2107 def _writeentry(self, transaction, ifh, dfh, entry, data, link, offset): | 2107 def _writeentry(self, transaction, ifh, dfh, entry, data, link, offset): |