diff: draw a table about binary diff behaviors
The table should make it easier to reason about future changes.
--- a/mercurial/patch.py Wed May 03 22:20:44 2017 -0700
+++ b/mercurial/patch.py Fri May 05 16:48:58 2017 -0700
@@ -2584,6 +2584,17 @@
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: