Show More
@@ -1,63 +1,259 b'' | |||
|
1 | #!/bin/sh | |
|
1 | ||
|
2 | $ echo "[extensions]" >> $HGRCPATH | |
|
3 | $ echo "autodiff=$TESTDIR/autodiff.py" >> $HGRCPATH | |
|
4 | $ echo "[diff]" >> $HGRCPATH | |
|
5 | $ echo "nodates=1" >> $HGRCPATH | |
|
6 | ||
|
7 | $ hg init repo | |
|
8 | $ cd repo | |
|
9 | ||
|
10 | make a combination of new, changed and deleted file | |
|
2 | 11 | |
|
3 | echo "[extensions]" >> $HGRCPATH | |
|
4 | echo "autodiff=$TESTDIR/autodiff.py" >> $HGRCPATH | |
|
5 | echo "[diff]" >> $HGRCPATH | |
|
6 | echo "nodates=1" >> $HGRCPATH | |
|
12 | $ echo regular > regular | |
|
13 | $ echo rmregular > rmregular | |
|
14 | $ touch rmempty | |
|
15 | $ echo exec > exec | |
|
16 | $ chmod +x exec | |
|
17 | $ echo rmexec > rmexec | |
|
18 | $ chmod +x rmexec | |
|
19 | $ echo setexec > setexec | |
|
20 | $ echo unsetexec > unsetexec | |
|
21 | $ chmod +x unsetexec | |
|
22 | $ echo binary > binary | |
|
23 | $ python -c "file('rmbinary', 'wb').write('\0')" | |
|
24 | $ hg ci -Am addfiles | |
|
25 | adding binary | |
|
26 | adding exec | |
|
27 | adding regular | |
|
28 | adding rmbinary | |
|
29 | adding rmempty | |
|
30 | adding rmexec | |
|
31 | adding rmregular | |
|
32 | adding setexec | |
|
33 | adding unsetexec | |
|
34 | $ echo regular >> regular | |
|
35 | $ echo newregular >> newregular | |
|
36 | $ rm rmempty | |
|
37 | $ touch newempty | |
|
38 | $ rm rmregular | |
|
39 | $ echo exec >> exec | |
|
40 | $ echo newexec > newexec | |
|
41 | $ chmod +x newexec | |
|
42 | $ rm rmexec | |
|
43 | $ chmod +x setexec | |
|
44 | $ chmod -x unsetexec | |
|
45 | $ python -c "file('binary', 'wb').write('\0\0')" | |
|
46 | $ python -c "file('newbinary', 'wb').write('\0')" | |
|
47 | $ rm rmbinary | |
|
48 | $ hg addremove -s 0 | |
|
49 | adding newbinary | |
|
50 | adding newempty | |
|
51 | adding newexec | |
|
52 | adding newregular | |
|
53 | removing rmbinary | |
|
54 | removing rmempty | |
|
55 | removing rmexec | |
|
56 | removing rmregular | |
|
57 | ||
|
58 | git=no: regular diff for all files | |
|
59 | ||
|
60 | $ hg autodiff --git=no | |
|
61 | diff -r b3f053cd7c7f binary | |
|
62 | Binary file binary has changed | |
|
63 | diff -r b3f053cd7c7f exec | |
|
64 | --- a/exec | |
|
65 | +++ b/exec | |
|
66 | @@ -1,1 +1,2 @@ | |
|
67 | exec | |
|
68 | +exec | |
|
69 | diff -r b3f053cd7c7f newbinary | |
|
70 | Binary file newbinary has changed | |
|
71 | diff -r b3f053cd7c7f newexec | |
|
72 | --- /dev/null | |
|
73 | +++ b/newexec | |
|
74 | @@ -0,0 +1,1 @@ | |
|
75 | +newexec | |
|
76 | diff -r b3f053cd7c7f newregular | |
|
77 | --- /dev/null | |
|
78 | +++ b/newregular | |
|
79 | @@ -0,0 +1,1 @@ | |
|
80 | +newregular | |
|
81 | diff -r b3f053cd7c7f regular | |
|
82 | --- a/regular | |
|
83 | +++ b/regular | |
|
84 | @@ -1,1 +1,2 @@ | |
|
85 | regular | |
|
86 | +regular | |
|
87 | diff -r b3f053cd7c7f rmbinary | |
|
88 | Binary file rmbinary has changed | |
|
89 | diff -r b3f053cd7c7f rmexec | |
|
90 | --- a/rmexec | |
|
91 | +++ /dev/null | |
|
92 | @@ -1,1 +0,0 @@ | |
|
93 | -rmexec | |
|
94 | diff -r b3f053cd7c7f rmregular | |
|
95 | --- a/rmregular | |
|
96 | +++ /dev/null | |
|
97 | @@ -1,1 +0,0 @@ | |
|
98 | -rmregular | |
|
99 | ||
|
100 | git=yes: git diff for single regular file | |
|
101 | ||
|
102 | $ hg autodiff --git=yes regular | |
|
103 | diff --git a/regular b/regular | |
|
104 | --- a/regular | |
|
105 | +++ b/regular | |
|
106 | @@ -1,1 +1,2 @@ | |
|
107 | regular | |
|
108 | +regular | |
|
109 | ||
|
110 | git=auto: regular diff for regular files and removals | |
|
7 | 111 | |
|
8 | hg init repo | |
|
9 | cd repo | |
|
10 | echo '% make a combination of new, changed and deleted file' | |
|
11 | echo regular > regular | |
|
12 | echo rmregular > rmregular | |
|
13 | touch rmempty | |
|
14 | echo exec > exec | |
|
15 | chmod +x exec | |
|
16 | echo rmexec > rmexec | |
|
17 | chmod +x rmexec | |
|
18 | echo setexec > setexec | |
|
19 | echo unsetexec > unsetexec | |
|
20 | chmod +x unsetexec | |
|
21 | echo binary > binary | |
|
22 | python -c "file('rmbinary', 'wb').write('\0')" | |
|
23 | hg ci -Am addfiles | |
|
24 | echo regular >> regular | |
|
25 | echo newregular >> newregular | |
|
26 | rm rmempty | |
|
27 | touch newempty | |
|
28 |
|
|
|
29 | echo exec >> exec | |
|
30 | echo newexec > newexec | |
|
31 | chmod +x newexec | |
|
32 | rm rmexec | |
|
33 | chmod +x setexec | |
|
34 | chmod -x unsetexec | |
|
35 | python -c "file('binary', 'wb').write('\0\0')" | |
|
36 | python -c "file('newbinary', 'wb').write('\0')" | |
|
37 | rm rmbinary | |
|
38 | hg addremove -s 0 | |
|
112 | $ hg autodiff --git=auto regular newregular rmregular rmbinary rmexec | |
|
113 | diff -r b3f053cd7c7f newregular | |
|
114 | --- /dev/null | |
|
115 | +++ b/newregular | |
|
116 | @@ -0,0 +1,1 @@ | |
|
117 | +newregular | |
|
118 | diff -r b3f053cd7c7f regular | |
|
119 | --- a/regular | |
|
120 | +++ b/regular | |
|
121 | @@ -1,1 +1,2 @@ | |
|
122 | regular | |
|
123 | +regular | |
|
124 | diff -r b3f053cd7c7f rmbinary | |
|
125 | Binary file rmbinary has changed | |
|
126 | diff -r b3f053cd7c7f rmexec | |
|
127 | --- a/rmexec | |
|
128 | +++ /dev/null | |
|
129 | @@ -1,1 +0,0 @@ | |
|
130 | -rmexec | |
|
131 | diff -r b3f053cd7c7f rmregular | |
|
132 | --- a/rmregular | |
|
133 | +++ /dev/null | |
|
134 | @@ -1,1 +0,0 @@ | |
|
135 | -rmregular | |
|
39 | 136 | |
|
40 | echo '% git=no: regular diff for all files' | |
|
41 | hg autodiff --git=no | |
|
137 | $ for f in exec newexec setexec unsetexec binary newbinary newempty rmempty; do | |
|
138 | > echo | |
|
139 | > echo '% git=auto: git diff for' $f | |
|
140 | > hg autodiff --git=auto $f | |
|
141 | > done | |
|
142 | ||
|
143 | % git=auto: git diff for exec | |
|
144 | diff -r b3f053cd7c7f exec | |
|
145 | --- a/exec | |
|
146 | +++ b/exec | |
|
147 | @@ -1,1 +1,2 @@ | |
|
148 | exec | |
|
149 | +exec | |
|
150 | ||
|
151 | % git=auto: git diff for newexec | |
|
152 | diff --git a/newexec b/newexec | |
|
153 | new file mode 100755 | |
|
154 | --- /dev/null | |
|
155 | +++ b/newexec | |
|
156 | @@ -0,0 +1,1 @@ | |
|
157 | +newexec | |
|
158 | ||
|
159 | % git=auto: git diff for setexec | |
|
160 | diff --git a/setexec b/setexec | |
|
161 | old mode 100644 | |
|
162 | new mode 100755 | |
|
163 | ||
|
164 | % git=auto: git diff for unsetexec | |
|
165 | diff --git a/unsetexec b/unsetexec | |
|
166 | old mode 100755 | |
|
167 | new mode 100644 | |
|
168 | ||
|
169 | % git=auto: git diff for binary | |
|
170 | diff --git a/binary b/binary | |
|
171 | index a9128c283485202893f5af379dd9beccb6e79486..09f370e38f498a462e1ca0faa724559b6630c04f | |
|
172 | GIT binary patch | |
|
173 | literal 2 | |
|
174 | Jc${Nk0000200961 | |
|
175 | ||
|
176 | ||
|
177 | % git=auto: git diff for newbinary | |
|
178 | diff --git a/newbinary b/newbinary | |
|
179 | new file mode 100644 | |
|
180 | index 0000000000000000000000000000000000000000..f76dd238ade08917e6712764a16a22005a50573d | |
|
181 | GIT binary patch | |
|
182 | literal 1 | |
|
183 | Ic${MZ000310RR91 | |
|
184 | ||
|
185 | ||
|
186 | % git=auto: git diff for newempty | |
|
187 | diff --git a/newempty b/newempty | |
|
188 | new file mode 100644 | |
|
189 | ||
|
190 | % git=auto: git diff for rmempty | |
|
191 | diff --git a/rmempty b/rmempty | |
|
192 | deleted file mode 100644 | |
|
42 | 193 | |
|
43 | echo '% git=no: git diff for single regular file' | |
|
44 | hg autodiff --git=yes regular | |
|
45 | ||
|
46 | echo '% git=auto: regular diff for regular files and removals' | |
|
47 | hg autodiff --git=auto regular newregular rmregular rmbinary rmexec | |
|
194 | git=warn: regular diff with data loss warnings | |
|
48 | 195 | |
|
49 | for f in exec newexec setexec unsetexec binary newbinary newempty rmempty; do | |
|
50 | echo '% git=auto: git diff for' $f | |
|
51 | hg autodiff --git=auto $f | |
|
52 | done | |
|
53 | ||
|
54 | echo '% git=warn: regular diff with data loss warnings' | |
|
55 | hg autodiff --git=warn | |
|
196 | $ hg autodiff --git=warn | |
|
197 | diff -r b3f053cd7c7f binary | |
|
198 | Binary file binary has changed | |
|
199 | diff -r b3f053cd7c7f exec | |
|
200 | --- a/exec | |
|
201 | +++ b/exec | |
|
202 | @@ -1,1 +1,2 @@ | |
|
203 | exec | |
|
204 | +exec | |
|
205 | diff -r b3f053cd7c7f newbinary | |
|
206 | Binary file newbinary has changed | |
|
207 | diff -r b3f053cd7c7f newexec | |
|
208 | --- /dev/null | |
|
209 | +++ b/newexec | |
|
210 | @@ -0,0 +1,1 @@ | |
|
211 | +newexec | |
|
212 | diff -r b3f053cd7c7f newregular | |
|
213 | --- /dev/null | |
|
214 | +++ b/newregular | |
|
215 | @@ -0,0 +1,1 @@ | |
|
216 | +newregular | |
|
217 | diff -r b3f053cd7c7f regular | |
|
218 | --- a/regular | |
|
219 | +++ b/regular | |
|
220 | @@ -1,1 +1,2 @@ | |
|
221 | regular | |
|
222 | +regular | |
|
223 | diff -r b3f053cd7c7f rmbinary | |
|
224 | Binary file rmbinary has changed | |
|
225 | diff -r b3f053cd7c7f rmexec | |
|
226 | --- a/rmexec | |
|
227 | +++ /dev/null | |
|
228 | @@ -1,1 +0,0 @@ | |
|
229 | -rmexec | |
|
230 | diff -r b3f053cd7c7f rmregular | |
|
231 | --- a/rmregular | |
|
232 | +++ /dev/null | |
|
233 | @@ -1,1 +0,0 @@ | |
|
234 | -rmregular | |
|
235 | data lost for: binary | |
|
236 | data lost for: newbinary | |
|
237 | data lost for: newempty | |
|
238 | data lost for: newexec | |
|
239 | data lost for: rmempty | |
|
240 | data lost for: setexec | |
|
241 | data lost for: unsetexec | |
|
56 | 242 | |
|
57 |
|
|
|
58 | hg autodiff --git=abort regular setexec | |
|
243 | git=abort: fail on execute bit change | |
|
244 | ||
|
245 | $ hg autodiff --git=abort regular setexec | |
|
246 | abort: losing data for setexec | |
|
247 | ||
|
248 | git=abort: succeed on regular file | |
|
59 | 249 | |
|
60 | echo '% git=abort: succeed on regular file' | |
|
61 | hg autodiff --git=abort regular | |
|
250 | $ hg autodiff --git=abort regular | |
|
251 | diff -r b3f053cd7c7f regular | |
|
252 | --- a/regular | |
|
253 | +++ b/regular | |
|
254 | @@ -1,1 +1,2 @@ | |
|
255 | regular | |
|
256 | +regular | |
|
62 | 257 | |
|
63 | cd .. | |
|
258 | $ cd .. | |
|
259 |
|
1 | NO CONTENT: file was removed |
General Comments 0
You need to be logged in to leave comments.
Login now