mirror of
https://github.com/facebook/sapling.git
synced 2024-10-11 17:27:53 +03:00
727359cd30
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
20 lines
564 B
Raku
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
|