@@ -1578,17 +1578,17 @@ class revlog(object):
return True
- def _addrevision(self, node, text, transaction, link, p1, p2, flags,
- cachedelta, ifh, dfh, alwayscache=False, raw=False):
+ def _addrevision(self, node, rawtext, transaction, link, p1, p2, flags,
+ cachedelta, ifh, dfh, alwayscache=False):
"""internal function to add revisions to the log
see addrevision for argument descriptions.
+
+ note: "addrevision" takes non-raw text, "_addrevision" takes raw text.
+
invariants:
- - text is optional (can be None); if not set, cachedelta must be set.
+ - rawtext is optional (can be None); if not set, cachedelta must be set.
if both are set, they must correspond to each other.
- - raw is optional; if set to True, it indicates the revision data is to
- be treated by _processflags() as raw. It is usually set by changegroup
- generation and debug commands.
"""
- btext = [text]
+ btext = [rawtext]
def buildtext():
if btext[0] is not None:
@@ -1608,9 +1608,9 @@ class revlog(object):
else:
fh = dfh
- basetext = self.revision(self.node(baserev), _df=fh, raw=raw)
+ basetext = self.revision(self.node(baserev), _df=fh, raw=True)
btext[0] = mdiff.patch(basetext, delta)
try:
- res = self._processflags(btext[0], flags, 'read', raw=raw)
+ res = self._processflags(btext[0], flags, 'read', raw=True)
btext[0], validatehash = res
if validatehash:
@@ -1664,9 +1664,9 @@ class revlog(object):
# full versions are inserted when the needed deltas
# become comparable to the uncompressed text
- if text is None:
+ if rawtext is None:
textlen = mdiff.patchedsize(self.rawsize(cachedelta[0]),
cachedelta[1])
else:
- textlen = len(text)
+ textlen = len(rawtext)
# should we try to build a delta?
@@ -1709,6 +1709,6 @@ class revlog(object):
dist, l, data, base, chainbase, chainlen, compresseddeltalen = delta
else:
- text = buildtext()
- data = self.compress(text)
+ rawtext = buildtext()
+ data = self.compress(rawtext)
l = len(data[1]) + len(data[0])
base = chainbase = curr
@@ -1722,9 +1722,9 @@ class revlog(object):
self._writeentry(transaction, ifh, dfh, entry, data, link, offset)
- if alwayscache and text is None:
- text = buildtext()
+ if alwayscache and rawtext is None:
+ rawtext = buildtext()
- if type(text) == str: # only accept immutable objects
- self._cache = (node, curr, text)
+ if type(rawtext) == str: # only accept immutable objects
+ self._cache = (node, curr, rawtext)
self._chainbasecache[curr] = chainbase
return node
@@ -1848,6 +1848,5 @@ class revlog(object):
p1, p2, flags, (baserev, delta),
ifh, dfh,
- alwayscache=bool(addrevisioncb),
- raw=True)
+ alwayscache=bool(addrevisioncb))
if addrevisioncb:
@@ -2,3 +2,3 @@ local test passed
addgroupcopy test passed
clone test passed
-abort: crashed: integrity check failed on _destrevlog.i:5
+lowlevelcopy test passed