revlog: use raw revisions in clone
authorJun Wu <quark@fb.com>
Thu, 30 Mar 2017 18:24:23 -0700
changeset 31754 5b93c6fdb391
parent 31753 5d11b5edcb0b
child 31755 ec48d57de110
revlog: use raw revisions in clone test-revlog-raw.py now shows "clone test passed", but there is more to fix.
mercurial/revlog.py
tests/test-revlog-raw.py.out
--- a/mercurial/revlog.py	Thu Mar 30 18:23:27 2017 -0700
+++ b/mercurial/revlog.py	Thu Mar 30 18:24:23 2017 -0700
@@ -2084,14 +2084,14 @@
                 # (Possibly) reuse the delta from the revlog if allowed and
                 # the revlog chunk is a delta.
                 cachedelta = None
-                text = None
+                rawtext = None
                 if populatecachedelta:
                     dp = self.deltaparent(rev)
                     if dp != nullrev:
                         cachedelta = (dp, str(self._chunk(rev)))
 
                 if not cachedelta:
-                    text = self.revision(rev)
+                    rawtext = self.revision(rev, raw=True)
 
                 ifh = destrevlog.opener(destrevlog.indexfile, 'a+',
                                         checkambig=False)
@@ -2099,7 +2099,7 @@
                 if not destrevlog._inline:
                     dfh = destrevlog.opener(destrevlog.datafile, 'a+')
                 try:
-                    destrevlog._addrevision(node, text, tr, linkrev, p1, p2,
+                    destrevlog._addrevision(node, rawtext, tr, linkrev, p1, p2,
                                             flags, cachedelta, ifh, dfh)
                 finally:
                     if dfh:
--- a/tests/test-revlog-raw.py.out	Thu Mar 30 18:23:27 2017 -0700
+++ b/tests/test-revlog-raw.py.out	Thu Mar 30 18:24:23 2017 -0700
@@ -1,3 +1,4 @@
 local test passed
 addgroupcopy test passed
-abort: crashed: invalid patch
+clone test passed
+abort: crashed: integrity check failed on _destrevlog.i:5