Jun Wu <quark@fb.com> [Wed, 03 May 2017 23:50:41 -0700] rev 32191
diff: add a fast path to avoid loading binary contents
When diffing binary contents, with certain configs, we can show
"Binary file <name> has changed" without actual content.
That allows a fast path where we could avoid providing actual binary
contents. Note: in that case we still need to test if two contents are the
same, that's done by using "filectx.cmp", which could have its own fast
path.
Jun Wu <quark@fb.com> [Fri, 05 May 2017 17:20:32 -0700] rev 32190
diff: correct binary testing logic
This seems to be more correct given the table drawn in the previous patch.
Namely, "losedatafn" and "opts.git" are removed, "not opts.text" is added.
- losedatafn: diff output (binary) should not be affected by "losedatafn"
- opts.git: binary testing is helpful for detecting a fast path in the
next path. the fast path can also be used if opts.git is False
- opts.text: if it's set, we should treat the content as non-binary
Jun Wu <quark@fb.com> [Fri, 05 May 2017 16:48:58 -0700] rev 32189
diff: draw a table about binary diff behaviors
The table should make it easier to reason about future changes.
Jun Wu <quark@fb.com> [Wed, 03 May 2017 22:20:44 -0700] rev 32188
diff: use fctx.size() to test empty
fctx.size() could have a fast path that does not require loading content.