Patchwork [7,of,9,V2] revlog: use raw revisions in clone

login
register
mail settings
Submitter Jun Wu
Date March 31, 2017, 4:45 a.m.
Message ID <4bc37a3afb8b56b3d124.1490935516@x1c>
Download mbox | patch
Permalink /patch/19862/
State Accepted
Headers show

Comments

Jun Wu - March 31, 2017, 4:45 a.m.
# HG changeset patch
# User Jun Wu <quark@fb.com>
# Date 1490923463 25200
#      Thu Mar 30 18:24:23 2017 -0700
# Node ID 4bc37a3afb8b56b3d124188cc16ea8d83a0ba92d
# Parent  272495735d544f8ab6053752db4e0a648f07415d
# Available At https://bitbucket.org/quark-zju/hg-draft
#              hg pull https://bitbucket.org/quark-zju/hg-draft -r 4bc37a3afb8b
revlog: use raw revisions in clone

test-revlog-raw.py now shows "clone test passed", but there is more to fix.

Patch

diff --git a/mercurial/revlog.py b/mercurial/revlog.py
--- a/mercurial/revlog.py
+++ b/mercurial/revlog.py
@@ -2085,5 +2085,5 @@  class revlog(object):
                 # the revlog chunk is a delta.
                 cachedelta = None
-                text = None
+                rawtext = None
                 if populatecachedelta:
                     dp = self.deltaparent(rev)
@@ -2092,5 +2092,5 @@  class revlog(object):
 
                 if not cachedelta:
-                    text = self.revision(rev)
+                    rawtext = self.revision(rev, raw=True)
 
                 ifh = destrevlog.opener(destrevlog.indexfile, 'a+',
@@ -2100,5 +2100,5 @@  class revlog(object):
                     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:
diff --git a/tests/test-revlog-raw.py.out b/tests/test-revlog-raw.py.out
--- a/tests/test-revlog-raw.py.out
+++ b/tests/test-revlog-raw.py.out
@@ -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