changeset 32189:15f10ee778f8

diff: draw a table about binary diff behaviors The table should make it easier to reason about future changes.
author Jun Wu <quark@fb.com>
date Fri, 05 May 2017 16:48:58 -0700
parents 776127b29a5c
children 0c67ab3d77d5
files mercurial/patch.py
diffstat 1 files changed, 11 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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: