This is an archive of the discontinued Mercurial Phabricator instance.

xdiff: add a bdiff hunk mode
ClosedPublic

Authored by ryanmce on Mar 2 2018, 7:25 PM.

Details

Summary

xdiff generated hunks for the differences (ex. questionmarks in the
@@ -?,? +?,? @@ part from diff --git output). However, bdiff generates
matched hunks instead.

This patch adds a XDL_EMIT_BDIFFHUNK flag used by the output function
xdl_call_hunk_func. Once set, xdiff will generate bdiff-like hunks
instead. That makes it easier to use xdiff as a drop-in replacement of bdiff.

Note that since bdiff('', '') returns [(0, 0, 0, 0)], the shortcut path
if (xscr) is removed. I have checked functions called with xscr argument
(xdl_mark_ignorable, xdl_call_hunk_func, xdl_emit_diff,
xdl_free_script) work just fine with xscr = NULL.

Test Plan

Will be tested in a later patch.

Diff Detail

Repository
rHG Mercurial
Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

ryanmce created this revision.Mar 2 2018, 7:25 PM
quark edited the summary of this revision. (Show Details)Mar 3 2018, 3:07 PM
quark updated this revision to Diff 6457.
quark updated this revision to Diff 6474.Mar 3 2018, 3:30 PM
quark edited the test plan for this revision. (Show Details)Mar 3 2018, 3:39 PM
indygreg accepted this revision.Mar 3 2018, 3:57 PM
This revision is now accepted and ready to land.Mar 3 2018, 3:57 PM
durin42 accepted this revision.Mar 3 2018, 6:12 PM
This revision was automatically updated to reflect the committed changes.