##// END OF EJS Templates
Add test for git binary diff support
Brendan Cully -
r3368:751df21d default
parent child Browse files
Show More
1 NO CONTENT: file copied from templates/static/hgicon.png to tests/binfile.bin
@@ -1,49 +1,62 b''
1 1 #!/bin/sh
2 2
3 3 hg init a
4 4 cd a
5 5
6 6 echo start > start
7 7 hg ci -Amstart -d '0 0'
8 8 echo new > new
9 9 hg ci -Amnew -d '0 0'
10 10 echo '% new file'
11 11 hg diff --git -r 0
12 12
13 13 hg cp new copy
14 14 hg ci -mcopy -d '0 0'
15 15 echo '% copy'
16 16 hg diff --git -r 1:tip
17 17
18 18 hg mv copy rename
19 19 hg ci -mrename -d '0 0'
20 20 echo '% rename'
21 21 hg diff --git -r 2:tip
22 22
23 23 hg rm rename
24 24 hg ci -mdelete -d '0 0'
25 25 echo '% delete'
26 26 hg diff --git -r 3:tip
27 27
28 28 cat > src <<EOF
29 29 1
30 30 2
31 31 3
32 32 4
33 33 5
34 34 EOF
35 35 hg ci -Amsrc -d '0 0'
36 36 chmod +x src
37 37 hg ci -munexec -d '0 0'
38 38 echo '% chmod 644'
39 39 hg diff --git -r 5:tip
40 40
41 41 hg mv src dst
42 42 chmod -x dst
43 43 echo a >> dst
44 44 hg ci -mrenamemod -d '0 0'
45 45 echo '% rename+mod+chmod'
46 46 hg diff --git -r 6:tip
47 47
48 48 echo '% nonexistent in tip+chmod'
49 49 hg diff --git -r 5:6
50
51 echo '% binary diff'
52 cp $TESTDIR/binfile.bin .
53 hg add binfile.bin
54 hg diff --git > b.diff
55 cat b.diff
56
57 echo '% import binary diff'
58 hg revert binfile.bin
59 rm binfile.bin
60 hg import -mfoo b.diff
61 cmp binfile.bin $TESTDIR/binfile.bin
62
@@ -1,46 +1,67 b''
1 1 adding start
2 2 adding new
3 3 % new file
4 4 diff --git a/new b/new
5 5 new file mode 100644
6 6 --- /dev/null
7 7 +++ b/new
8 8 @@ -0,0 +1,1 @@
9 9 +new
10 10 % copy
11 11 diff --git a/new b/copy
12 12 copy from new
13 13 copy to copy
14 14 % rename
15 15 diff --git a/copy b/rename
16 16 rename from copy
17 17 rename to rename
18 18 % delete
19 19 diff --git a/rename b/rename
20 20 deleted file mode 100644
21 21 --- a/rename
22 22 +++ /dev/null
23 23 @@ -1,1 +0,0 @@
24 24 -new
25 25 adding src
26 26 % chmod 644
27 27 diff --git a/src b/src
28 28 old mode 100644
29 29 new mode 100755
30 30 % rename+mod+chmod
31 31 diff --git a/src b/dst
32 32 old mode 100755
33 33 new mode 100644
34 34 rename from src
35 35 rename to dst
36 36 --- a/dst
37 37 +++ b/dst
38 38 @@ -3,3 +3,4 @@ 3
39 39 3
40 40 4
41 41 5
42 42 +a
43 43 % nonexistent in tip+chmod
44 44 diff --git a/src b/src
45 45 old mode 100644
46 46 new mode 100755
47 % binary diff
48 diff --git a/binfile.bin b/binfile.bin
49 new file mode 100644
50 index 0000000000000000000000000000000000000000..37ba3d1c6f17137d9c5f5776fa040caf5fe73ff9
51 GIT binary patch
52 literal 593
53 zc$@)I0<QguP)<h;3K|Lk000e1NJLTq000mG000mO0ssI2kdbIM00009a7bBm000XU
54 z000XU0RWnu7ytkO2XskIMF-Uh9TW;VpMjwv0005-Nkl<ZD9@FWPs=e;7{<>W$NUkd
55 zX$nnYLt$-$V!?uy+1V%`z&Eh=ah|duER<4|QWhju3gb^nF*8iYobxWG-qqXl=2~5M
56 z*IoDB)sG^CfNuoBmqLTVU^<;@nwHP!1wrWd`{(mHo6VNXWtyh{alzqmsH*yYzpvLT
57 zLdY<T=ks|woh-`&01!ej#(xbV1f|pI*=%;d-%F*E*X#ZH`4I%6SS+$EJDE&ct=8po
58 ziN#{?_j|kD%Cd|oiqds`xm@;oJ-^?NG3Gdqrs?5u*zI;{nogxsx~^|Fn^Y?Gdc6<;
59 zfMJ+iF1J`LMx&A2?dEwNW8ClebzPTbIh{@$hS6*`kH@1d%Lo7fA#}N1)oN7`gm$~V
60 z+wDx#)OFqMcE{s!JN0-xhG8ItAjVkJwEcb`3WWlJfU2r?;Pd%dmR+q@mSri5q9_W-
61 zaR2~ECX?B2w+zELozC0s*6Z~|QG^f{3I#<`?)Q7U-JZ|q5W;9Q8i_=pBuSzunx=U;
62 z9C)5jBoYw9^?EHyQl(M}1OlQcCX>lXB*ODN003Z&P17_@)3Pi=i0wb04<W?v-u}7K
63 zXmmQA+wDgE!qR9o8jr`%=ab_&uh(l?R=r;Tjiqon91I2-hIu?57~@*4h7h9uORK#=
64 fQItJW-{SoTm)8|5##k|m00000NkvXXu0mjf{mKw4
65
66 % import binary diff
67 applying b.diff
General Comments 0
You need to be logged in to leave comments. Login now