# HG changeset patch # User Jun Wu # Date 2017-03-31 01:23:27 # Node ID 5d11b5edcb0b27d303277312591a9c00ea96a203 # Parent f424fb180fea18835e7f96feff8b6141fff5ec8e revlog: use raw revisions in revdiff See the added comment. revdiff is meant to output the raw delta that will be written to revlog. It should use raw. test-revlog-raw.py now shows "addgroupcopy test passed", but there is more to fix. diff --git a/mercurial/revlog.py b/mercurial/revlog.py --- a/mercurial/revlog.py +++ b/mercurial/revlog.py @@ -1239,12 +1239,16 @@ class revlog(object): return rev - 1 def revdiff(self, rev1, rev2): - """return or calculate a delta between two revisions""" + """return or calculate a delta between two revisions + + The delta calculated is in binary form and is intended to be written to + revlog data directly. So this function needs raw revision data. + """ if rev1 != nullrev and self.deltaparent(rev2) == rev1: return bytes(self._chunk(rev2)) - return mdiff.textdiff(self.revision(rev1), - self.revision(rev2)) + return mdiff.textdiff(self.revision(rev1, raw=True), + self.revision(rev2, raw=True)) def revision(self, nodeorrev, _df=None, raw=False): """return an uncompressed revision of a given node or revision 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,2 +1,3 @@ local test passed +addgroupcopy test passed abort: crashed: invalid patch