diff --git a/tests/test-diff-binary-file b/tests/test-diff-binary-file new file mode 100755 --- /dev/null +++ b/tests/test-diff-binary-file @@ -0,0 +1,25 @@ +#!/bin/sh + +hg init a +cd a +cp $TESTDIR/binfile.bin . +hg add binfile.bin +hg ci -m 'add binfile.bin' -d '0 0' + +echo >> binfile.bin +hg ci -m 'change binfile.bin' -d '0 0' + +hg revert -r 0 binfile.bin +hg ci -m 'revert binfile.bin' -d '0 0' + +echo % diff -r 0 -r 1 +hg diff --nodates -r 0 -r 1 + +echo % diff -r 0 -r 2 +hg diff --nodates -r 0 -r 2 + +echo % diff --git -r 0 -r 1 +hg diff --git -r 0 -r 1 + +echo % diff --git -r 0 -r 2 +hg diff --git -r 0 -r 2 diff --git a/tests/test-diff-binary-file.out b/tests/test-diff-binary-file.out new file mode 100644 --- /dev/null +++ b/tests/test-diff-binary-file.out @@ -0,0 +1,24 @@ +% diff -r 0 -r 1 +diff -r 48b371597640 -r acea2ab458c8 binfile.bin +Binary file binfile.bin has changed +% diff -r 0 -r 2 +% diff --git -r 0 -r 1 +diff --git a/binfile.bin b/binfile.bin +index 37ba3d1c6f17137d9c5f5776fa040caf5fe73ff9..58dc31a9e2f40f74ff3b45903f7d620b8e5b7356 +GIT binary patch +literal 594 +zc$@)J0W$NUkd +zX$nnYLt$-$V!?uy+1V%`z&Eh=ah|duER<4|QWhju3gb^nF*8iYobxWG-qqXl=2~5M +z*IoDB)sG^CfNuoBmqLTVU^<;@nwHP!1wrWd`{(mHo6VNXWtyh{alzqmsH*yYzpvLT +zLdYlXB*ODN003Z&P17_@)3Pi=i0wb04