Patchwork [5,of,9,V2] revlog: use raw content when building delta

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

Comments

Jun Wu - March 31, 2017, 4:45 a.m.
# HG changeset patch
# User Jun Wu <quark@fb.com>
# Date 1490921883 25200
#      Thu Mar 30 17:58:03 2017 -0700
# Node ID 290c65aad38108cc59c7e8fb7f3b37a7c7a7573b
# Parent  173d73e93cc25abdcac23fcd858a4e94d29e7461
# Available At https://bitbucket.org/quark-zju/hg-draft
#              hg pull https://bitbucket.org/quark-zju/hg-draft -r 290c65aad381
revlog: use raw content when building delta

Using external content provided by flagprocessor when building revlog delta
is wrong, because deltas are applied to raw contents in revlog.

This patch fixes the above issue by adding "raw=True".

test-revlog-raw.py now shows "local 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
@@ -1636,5 +1636,5 @@  class revlog(object):
                     else:
                         fh = dfh
-                    ptext = self.revision(self.node(rev), _df=fh)
+                    ptext = self.revision(self.node(rev), _df=fh, raw=True)
                     delta = mdiff.textdiff(ptext, t)
             header, data = self.compress(delta)
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,1 +1,2 @@ 
-abort: crashed: integrity check failed on _testrevlog.i:11
+local test passed
+abort: crashed: invalid patch