| 1 |
$ hg init a |
| 2 |
$ cd a |
| 3 |
$ cp "$TESTDIR/binfile.bin" . |
| 4 |
$ hg add binfile.bin |
| 5 |
$ hg ci -m 'add binfile.bin' |
| 6 |
|
| 7 |
$ echo >> binfile.bin |
| 8 |
$ hg ci -m 'change binfile.bin' |
| 9 |
|
| 10 |
$ hg revert -r 0 binfile.bin |
| 11 |
$ hg ci -m 'revert binfile.bin' |
| 12 |
$ hg cp binfile.bin nonbinfile |
| 13 |
$ echo text > nonbinfile |
| 14 |
$ hg ci -m 'make non-binary copy of binary file' |
| 15 |
|
| 16 |
$ hg diff --nodates -r 0 -r 1 |
| 17 |
diff -r 48b371597640 -r acea2ab458c8 binfile.bin |
| 18 |
Binary file binfile.bin has changed |
| 19 |
|
| 20 |
$ hg diff --nodates -r 0 -r 2 |
| 21 |
|
| 22 |
$ hg diff --git -r 0 -r 1 |
| 23 |
diff --git a/binfile.bin b/binfile.bin |
| 24 |
index 37ba3d1c6f17137d9c5f5776fa040caf5fe73ff9..58dc31a9e2f40f74ff3b45903f7d620b8e5b7356 |
| 25 |
GIT binary patch |
| 26 |
literal 594 |
| 27 |
zc$@)J0<HatP)<h;3K|Lk000e1NJLTq000mG000mO0ssI2kdbIM00009a7bBm000XU |
| 28 |
z000XU0RWnu7ytkO2XskIMF-Uh9TW;VpMjwv0005-Nkl<ZD9@FWPs=e;7{<>W$NUkd |
| 29 |
zX$nnYLt$-$V!?uy+1V%`z&Eh=ah|duER<4|QWhju3gb^nF*8iYobxWG-qqXl=2~5M |
| 30 |
z*IoDB)sG^CfNuoBmqLTVU^<;@nwHP!1wrWd`{(mHo6VNXWtyh{alzqmsH*yYzpvLT |
| 31 |
zLdY<T=ks|woh-`&01!ej#(xbV1f|pI*=%;d-%F*E*X#ZH`4I%6SS+$EJDE&ct=8po |
| 32 |
ziN#{?_j|kD%Cd|oiqds`xm@;oJ-^?NG3Gdqrs?5u*zI;{nogxsx~^|Fn^Y?Gdc6<; |
| 33 |
zfMJ+iF1J`LMx&A2?dEwNW8ClebzPTbIh{@$hS6*`kH@1d%Lo7fA#}N1)oN7`gm$~V |
| 34 |
z+wDx#)OFqMcE{s!JN0-xhG8ItAjVkJwEcb`3WWlJfU2r?;Pd%dmR+q@mSri5q9_W- |
| 35 |
zaR2~ECX?B2w+zELozC0s*6Z~|QG^f{3I#<`?)Q7U-JZ|q5W;9Q8i_=pBuSzunx=U; |
| 36 |
z9C)5jBoYw9^?EHyQl(M}1OlQcCX>lXB*ODN003Z&P17_@)3Pi=i0wb04<W?v-u}7K |
| 37 |
zXmmQA+wDgE!qR9o8jr`%=ab_&uh(l?R=r;Tjiqon91I2-hIu?57~@*4h7h9uORK#= |
| 38 |
gQItJW-{SoTm)8|5##k|m00000NkvXXu0mjf3JwksH2?qr |
| 39 |
|
| 40 |
|
| 41 |
$ hg diff --git -r 0 -r 2 |
| 42 |
|
| 43 |
$ hg diff --config diff.nobinary=True --git -r 0 -r 1 |
| 44 |
diff --git a/binfile.bin b/binfile.bin |
| 45 |
Binary file binfile.bin has changed |
| 46 |
|
| 47 |
$ HGPLAIN=1 hg diff --config diff.nobinary=True --git -r 0 -r 1 |
| 48 |
diff --git a/binfile.bin b/binfile.bin |
| 49 |
index 37ba3d1c6f17137d9c5f5776fa040caf5fe73ff9..58dc31a9e2f40f74ff3b45903f7d620b8e5b7356 |
| 50 |
GIT binary patch |
| 51 |
literal 594 |
| 52 |
zc$@)J0<HatP)<h;3K|Lk000e1NJLTq000mG000mO0ssI2kdbIM00009a7bBm000XU |
| 53 |
z000XU0RWnu7ytkO2XskIMF-Uh9TW;VpMjwv0005-Nkl<ZD9@FWPs=e;7{<>W$NUkd |
| 54 |
zX$nnYLt$-$V!?uy+1V%`z&Eh=ah|duER<4|QWhju3gb^nF*8iYobxWG-qqXl=2~5M |
| 55 |
z*IoDB)sG^CfNuoBmqLTVU^<;@nwHP!1wrWd`{(mHo6VNXWtyh{alzqmsH*yYzpvLT |
| 56 |
zLdY<T=ks|woh-`&01!ej#(xbV1f|pI*=%;d-%F*E*X#ZH`4I%6SS+$EJDE&ct=8po |
| 57 |
ziN#{?_j|kD%Cd|oiqds`xm@;oJ-^?NG3Gdqrs?5u*zI;{nogxsx~^|Fn^Y?Gdc6<; |
| 58 |
zfMJ+iF1J`LMx&A2?dEwNW8ClebzPTbIh{@$hS6*`kH@1d%Lo7fA#}N1)oN7`gm$~V |
| 59 |
z+wDx#)OFqMcE{s!JN0-xhG8ItAjVkJwEcb`3WWlJfU2r?;Pd%dmR+q@mSri5q9_W- |
| 60 |
zaR2~ECX?B2w+zELozC0s*6Z~|QG^f{3I#<`?)Q7U-JZ|q5W;9Q8i_=pBuSzunx=U; |
| 61 |
z9C)5jBoYw9^?EHyQl(M}1OlQcCX>lXB*ODN003Z&P17_@)3Pi=i0wb04<W?v-u}7K |
| 62 |
zXmmQA+wDgE!qR9o8jr`%=ab_&uh(l?R=r;Tjiqon91I2-hIu?57~@*4h7h9uORK#= |
| 63 |
gQItJW-{SoTm)8|5##k|m00000NkvXXu0mjf3JwksH2?qr |
| 64 |
|
| 65 |
|
| 66 |
|
| 67 |
$ hg diff --git -r 2 -r 3 |
| 68 |
diff --git a/binfile.bin b/nonbinfile |
| 69 |
copy from binfile.bin |
| 70 |
copy to nonbinfile |
| 71 |
index 37ba3d1c6f17137d9c5f5776fa040caf5fe73ff9..8e27be7d6154a1f68ea9160ef0e18691d20560dc |
| 72 |
GIT binary patch |
| 73 |
literal 5 |
| 74 |
Mc$_OqttjCF00uV!&;S4c |
| 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(b'\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) |
| 110 |
|
| 111 |
Test binary mode with extended git-style diff format |
| 112 |
$ hg diff --no-binary -r 0 -r 1 |
| 113 |
diff -r fb45f71337ad -r 9ca112d1a3c1 binfile.bin |
| 114 |
Binary file binfile.bin has changed |
| 115 |
|
| 116 |
$ hg diff --git --no-binary -r 0 -r 1 |
| 117 |
diff --git a/binfile.bin b/binfile.bin |
| 118 |
Binary file binfile.bin has changed |
| 119 |
|
| 120 |
$ hg diff --git --binary -r 0 -r 1 |
| 121 |
diff --git a/binfile.bin b/binfile.bin |
| 122 |
index eaf36c1daccfdf325514461cd1a2ffbc139b5464..ba71a782e93f3fb63a428383706065e3ec2828e9 |
| 123 |
GIT binary patch |
| 124 |
literal 5 |
| 125 |
Mc${NkWMbw50018V5dZ)H |
| 126 |
|
| 127 |
$ hg diff --git --binary --config diff.nobinary=True -r 0 -r 1 |
| 128 |
diff --git a/binfile.bin b/binfile.bin |
| 129 |
index eaf36c1daccfdf325514461cd1a2ffbc139b5464..ba71a782e93f3fb63a428383706065e3ec2828e9 |
| 130 |
GIT binary patch |
| 131 |
literal 5 |
| 132 |
Mc${NkWMbw50018V5dZ)H |
| 133 |
|
| 134 |
|
| 135 |
$ hg diff --git --binary --text -r 0 -r 1 |
| 136 |
diff --git a/binfile.bin b/binfile.bin |
| 137 |
--- a/binfile.bin |
| 138 |
+++ b/binfile.bin |
| 139 |
@@ -1,1 +1,1 @@ |
| 140 |
-\x00\x01\x02\x03 (esc) |
| 141 |
\ No newline at end of file |
| 142 |
+\x00\x01\x02\x03 (esc) |
| 143 |
|
| 144 |
$ cd .. |