comparison tests/test-diff-binary-file.t @ 31821:66a9faadbc83

patch: make diff in git mode respect --text option (issue5510) This changeset makes patch respect -a/--text option in --git mode by aligning its behaviour with git itself.
author Alexander Fomin <afomin@fb.com>
date Wed, 05 Apr 2017 15:15:06 -0700
parents 186f2afe9919
children fde4822b0102
comparison
equal deleted inserted replaced
31820:45761ef1bc93 31821:66a9faadbc83
71 index 37ba3d1c6f17137d9c5f5776fa040caf5fe73ff9..8e27be7d6154a1f68ea9160ef0e18691d20560dc 71 index 37ba3d1c6f17137d9c5f5776fa040caf5fe73ff9..8e27be7d6154a1f68ea9160ef0e18691d20560dc
72 GIT binary patch 72 GIT binary patch
73 literal 5 73 literal 5
74 Mc$_OqttjCF00uV!&;S4c 74 Mc$_OqttjCF00uV!&;S4c
75 75
76 $ cd ..
77
78 Test text mode with extended git-style diff format
79 $ hg init b
80 $ cd b
81 $ cat > writebin.py <<EOF
82 > import sys
83 > path = sys.argv[1]
84 > open(path, 'wb').write('\x00\x01\x02\x03')
85 > EOF
86 $ python writebin.py binfile.bin
87 $ hg add binfile.bin
88 $ hg ci -m 'add binfile.bin'
89
90 $ echo >> binfile.bin
91 $ hg ci -m 'change binfile.bin'
92
93 $ hg diff --git -a -r 0 -r 1
94 diff --git a/binfile.bin b/binfile.bin
95 --- a/binfile.bin
96 +++ b/binfile.bin
97 @@ -1,1 +1,1 @@
98 -\x00\x01\x02\x03 (esc)
99 \ No newline at end of file
100 +\x00\x01\x02\x03 (esc)
101
102 $ HGPLAIN=1 hg diff --git -a -r 0 -r 1
103 diff --git a/binfile.bin b/binfile.bin
104 --- a/binfile.bin
105 +++ b/binfile.bin
106 @@ -1,1 +1,1 @@
107 -\x00\x01\x02\x03 (esc)
108 \ No newline at end of file
109 +\x00\x01\x02\x03 (esc)
76 110
77 $ cd .. 111 $ cd ..