[PATCH 1 of 7] revlog: use raw content when building delta

Jun Wu quark at fb.com
Tue Mar 28 03:49:02 EDT 2017


# HG changeset patch
# User Jun Wu <quark at fb.com>
# Date 1490682886 25200
#      Mon Mar 27 23:34:46 2017 -0700
# Node ID 1e84f9bd4385a8f95ac1ec15dee14c723071ab34
# Parent  1ed57a7dd904f8b79f79ecb4ea6fe1871e7af740
# Available At https://bitbucket.org/quark-zju/hg-draft
#              hg pull https://bitbucket.org/quark-zju/hg-draft -r 1e84f9bd4385
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". There are other
issues about "raw". A test will be added later after all issues are fixed,
to reduce churn on the test file.

diff --git a/mercurial/revlog.py b/mercurial/revlog.py
--- a/mercurial/revlog.py
+++ b/mercurial/revlog.py
@@ -1629,5 +1629,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)


More information about the Mercurial-devel mailing list