sapling/tests/test-diff-hashbinary.t
Jeffrey Dunn 727359cd30 Add hash binary config option for hg diff
Summary:
When there's a change in a binary file, it's useful for it to appear
in the output of hg diff in some format. The options today are just to get
a text message saying that there is a change or a large binary blob of the
change. This introduces a middleground where we see the hash of the final
binary.

Reviewed By: quark-zju

Differential Revision: D17579217

fbshipit-source-id: ca204bb0ee28bfef327d57eea8236d7421bf933f
2019-09-26 09:22:18 -07:00

20 lines
564 B
Raku

$ newrepo
$ setconfig diff.git=1 diff.hashbinary=1
>>> open('a.bin', 'wb').write(b'\0\1')
$ hg commit -m A -A a.bin
>>> open('a.bin', 'wb').write(b'\0\2')
$ hg diff
diff --git a/a.bin b/a.bin
Binary file a.bin has changed to 9ac521e32f8e19473bc914e1af8ae423a6d8c122
$ HGPLAIN=1 hg diff
diff --git a/a.bin b/a.bin
Binary file a.bin has changed to 9ac521e32f8e19473bc914e1af8ae423a6d8c122
$ HGPLAIN=1 HGPLAINEXCEPT=diffopts hg diff
diff --git a/a.bin b/a.bin
Binary file a.bin has changed to 9ac521e32f8e19473bc914e1af8ae423a6d8c122