# HG changeset patch # User Jun Wu # Date 2017-05-05 23:48:58 # Node ID 15f10ee778f83a0c1e546ef7c16f01e008e0a719 # Parent 776127b29a5cb8134315b726a6f06badde80db46 diff: draw a table about binary diff behaviors The table should make it easier to reason about future changes. diff --git a/mercurial/patch.py b/mercurial/patch.py --- a/mercurial/patch.py +++ b/mercurial/patch.py @@ -2584,6 +2584,17 @@ def trydiff(repo, revs, ctx1, ctx2, modi elif revs and not repo.ui.quiet: header.append(diffline(path1, revs)) + # fctx.is | diffopts | what to | is fctx.data() + # binary() | text nobinary git index | output? | outputted? + # ------------------------------------|---------------------------- + # yes | no no no * | summary | no + # yes | no no yes * | base85 | yes + # yes | no yes no * | summary | no + # yes | no yes yes 0 | summary | no + # yes | no yes yes >0 | summary | semi [1] + # yes | yes * * * | text diff | yes + # no | * * * * | text diff | yes + # [1]: hash(fctx.data()) is outputted. so fctx.data() cannot be faked if binary and opts.git and not opts.nobinary and not opts.text: text = mdiff.b85diff(content1, content2) if text: