##// END OF EJS Templates
patch: test and document a bit binary to regular file upgrade
Patrick Mezard -
r12576:1c9bb7e0 stable
parent child Browse files
Show More
@@ -1569,6 +1569,9 b' def trydiff(repo, revs, ctx1, ctx2, modi'
1569 header.append('new file mode %s\n' % mode)
1569 header.append('new file mode %s\n' % mode)
1570 elif ctx2.flags(f):
1570 elif ctx2.flags(f):
1571 losedatafn(f)
1571 losedatafn(f)
1572 # In theory, if tn was copied or renamed we should check
1573 # if the source is binary too but the copy record already
1574 # forces git mode.
1572 if util.binary(tn):
1575 if util.binary(tn):
1573 if opts.git:
1576 if opts.git:
1574 dodiff = 'binary'
1577 dodiff = 'binary'
@@ -20,6 +20,7 b' echo unsetexec > unsetexec'
20 chmod +x unsetexec
20 chmod +x unsetexec
21 echo binary > binary
21 echo binary > binary
22 python -c "file('rmbinary', 'wb').write('\0')"
22 python -c "file('rmbinary', 'wb').write('\0')"
23 python -c "file('bintoregular', 'wb').write('\0')"
23 hg ci -Am addfiles
24 hg ci -Am addfiles
24 echo regular >> regular
25 echo regular >> regular
25 echo newregular >> newregular
26 echo newregular >> newregular
@@ -28,6 +29,7 b' touch newempty'
28 rm rmregular
29 rm rmregular
29 echo exec >> exec
30 echo exec >> exec
30 echo newexec > newexec
31 echo newexec > newexec
32 echo bintoregular > bintoregular
31 chmod +x newexec
33 chmod +x newexec
32 rm rmexec
34 rm rmexec
33 chmod +x setexec
35 chmod +x setexec
@@ -46,7 +48,8 b' hg autodiff --git=yes regular'
46 echo '% git=auto: regular diff for regular files and non-binary removals'
48 echo '% git=auto: regular diff for regular files and non-binary removals'
47 hg autodiff --git=auto regular newregular rmregular rmexec
49 hg autodiff --git=auto regular newregular rmregular rmexec
48
50
49 for f in exec newexec setexec unsetexec binary newbinary newempty rmempty rmbinary; do
51 for f in exec newexec setexec unsetexec binary newbinary newempty rmempty \
52 rmbinary bintoregular; do
50 echo '% git=auto: git diff for' $f
53 echo '% git=auto: git diff for' $f
51 hg autodiff --git=auto $f
54 hg autodiff --git=auto $f
52 done
55 done
@@ -1,5 +1,6 b''
1 % make a combination of new, changed and deleted file
1 % make a combination of new, changed and deleted file
2 adding binary
2 adding binary
3 adding bintoregular
3 adding exec
4 adding exec
4 adding regular
5 adding regular
5 adding rmbinary
6 adding rmbinary
@@ -17,40 +18,42 b' removing rmempty'
17 removing rmexec
18 removing rmexec
18 removing rmregular
19 removing rmregular
19 % git=no: regular diff for all files
20 % git=no: regular diff for all files
20 diff -r b3f053cd7c7f binary
21 diff -r a66d19b9302d binary
21 Binary file binary has changed
22 Binary file binary has changed
22 diff -r b3f053cd7c7f exec
23 diff -r a66d19b9302d bintoregular
24 Binary file bintoregular has changed
25 diff -r a66d19b9302d exec
23 --- a/exec
26 --- a/exec
24 +++ b/exec
27 +++ b/exec
25 @@ -1,1 +1,2 @@
28 @@ -1,1 +1,2 @@
26 exec
29 exec
27 +exec
30 +exec
28 diff -r b3f053cd7c7f newbinary
31 diff -r a66d19b9302d newbinary
29 Binary file newbinary has changed
32 Binary file newbinary has changed
30 diff -r b3f053cd7c7f newexec
33 diff -r a66d19b9302d newexec
31 --- /dev/null
34 --- /dev/null
32 +++ b/newexec
35 +++ b/newexec
33 @@ -0,0 +1,1 @@
36 @@ -0,0 +1,1 @@
34 +newexec
37 +newexec
35 diff -r b3f053cd7c7f newregular
38 diff -r a66d19b9302d newregular
36 --- /dev/null
39 --- /dev/null
37 +++ b/newregular
40 +++ b/newregular
38 @@ -0,0 +1,1 @@
41 @@ -0,0 +1,1 @@
39 +newregular
42 +newregular
40 diff -r b3f053cd7c7f regular
43 diff -r a66d19b9302d regular
41 --- a/regular
44 --- a/regular
42 +++ b/regular
45 +++ b/regular
43 @@ -1,1 +1,2 @@
46 @@ -1,1 +1,2 @@
44 regular
47 regular
45 +regular
48 +regular
46 diff -r b3f053cd7c7f rmbinary
49 diff -r a66d19b9302d rmbinary
47 Binary file rmbinary has changed
50 Binary file rmbinary has changed
48 diff -r b3f053cd7c7f rmexec
51 diff -r a66d19b9302d rmexec
49 --- a/rmexec
52 --- a/rmexec
50 +++ /dev/null
53 +++ /dev/null
51 @@ -1,1 +0,0 @@
54 @@ -1,1 +0,0 @@
52 -rmexec
55 -rmexec
53 diff -r b3f053cd7c7f rmregular
56 diff -r a66d19b9302d rmregular
54 --- a/rmregular
57 --- a/rmregular
55 +++ /dev/null
58 +++ /dev/null
56 @@ -1,1 +0,0 @@
59 @@ -1,1 +0,0 @@
@@ -63,29 +66,29 b' diff --git a/regular b/regular'
63 regular
66 regular
64 +regular
67 +regular
65 % git=auto: regular diff for regular files and non-binary removals
68 % git=auto: regular diff for regular files and non-binary removals
66 diff -r b3f053cd7c7f newregular
69 diff -r a66d19b9302d newregular
67 --- /dev/null
70 --- /dev/null
68 +++ b/newregular
71 +++ b/newregular
69 @@ -0,0 +1,1 @@
72 @@ -0,0 +1,1 @@
70 +newregular
73 +newregular
71 diff -r b3f053cd7c7f regular
74 diff -r a66d19b9302d regular
72 --- a/regular
75 --- a/regular
73 +++ b/regular
76 +++ b/regular
74 @@ -1,1 +1,2 @@
77 @@ -1,1 +1,2 @@
75 regular
78 regular
76 +regular
79 +regular
77 diff -r b3f053cd7c7f rmexec
80 diff -r a66d19b9302d rmexec
78 --- a/rmexec
81 --- a/rmexec
79 +++ /dev/null
82 +++ /dev/null
80 @@ -1,1 +0,0 @@
83 @@ -1,1 +0,0 @@
81 -rmexec
84 -rmexec
82 diff -r b3f053cd7c7f rmregular
85 diff -r a66d19b9302d rmregular
83 --- a/rmregular
86 --- a/rmregular
84 +++ /dev/null
87 +++ /dev/null
85 @@ -1,1 +0,0 @@
88 @@ -1,1 +0,0 @@
86 -rmregular
89 -rmregular
87 % git=auto: git diff for exec
90 % git=auto: git diff for exec
88 diff -r b3f053cd7c7f exec
91 diff -r a66d19b9302d exec
89 --- a/exec
92 --- a/exec
90 +++ b/exec
93 +++ b/exec
91 @@ -1,1 +1,2 @@
94 @@ -1,1 +1,2 @@
@@ -131,46 +134,56 b' deleted file mode 100644'
131 diff --git a/rmbinary b/rmbinary
134 diff --git a/rmbinary b/rmbinary
132 deleted file mode 100644
135 deleted file mode 100644
133 Binary file rmbinary has changed
136 Binary file rmbinary has changed
137 % git=auto: git diff for bintoregular
138 diff --git a/bintoregular b/bintoregular
139 index f76dd238ade08917e6712764a16a22005a50573d..9c42f2b6427d8bf034b7bc23986152dc01bfd3ab
140 GIT binary patch
141 literal 13
142 Uc$`bh%qz(+N=+}#Ni5<5043uE82|tP
143
134 % git=warn: regular diff with data loss warnings
144 % git=warn: regular diff with data loss warnings
135 diff -r b3f053cd7c7f binary
145 diff -r a66d19b9302d binary
136 Binary file binary has changed
146 Binary file binary has changed
137 diff -r b3f053cd7c7f exec
147 diff -r a66d19b9302d bintoregular
148 Binary file bintoregular has changed
149 diff -r a66d19b9302d exec
138 --- a/exec
150 --- a/exec
139 +++ b/exec
151 +++ b/exec
140 @@ -1,1 +1,2 @@
152 @@ -1,1 +1,2 @@
141 exec
153 exec
142 +exec
154 +exec
143 diff -r b3f053cd7c7f newbinary
155 diff -r a66d19b9302d newbinary
144 Binary file newbinary has changed
156 Binary file newbinary has changed
145 diff -r b3f053cd7c7f newexec
157 diff -r a66d19b9302d newexec
146 --- /dev/null
158 --- /dev/null
147 +++ b/newexec
159 +++ b/newexec
148 @@ -0,0 +1,1 @@
160 @@ -0,0 +1,1 @@
149 +newexec
161 +newexec
150 diff -r b3f053cd7c7f newregular
162 diff -r a66d19b9302d newregular
151 --- /dev/null
163 --- /dev/null
152 +++ b/newregular
164 +++ b/newregular
153 @@ -0,0 +1,1 @@
165 @@ -0,0 +1,1 @@
154 +newregular
166 +newregular
155 diff -r b3f053cd7c7f regular
167 diff -r a66d19b9302d regular
156 --- a/regular
168 --- a/regular
157 +++ b/regular
169 +++ b/regular
158 @@ -1,1 +1,2 @@
170 @@ -1,1 +1,2 @@
159 regular
171 regular
160 +regular
172 +regular
161 diff -r b3f053cd7c7f rmbinary
173 diff -r a66d19b9302d rmbinary
162 Binary file rmbinary has changed
174 Binary file rmbinary has changed
163 diff -r b3f053cd7c7f rmexec
175 diff -r a66d19b9302d rmexec
164 --- a/rmexec
176 --- a/rmexec
165 +++ /dev/null
177 +++ /dev/null
166 @@ -1,1 +0,0 @@
178 @@ -1,1 +0,0 @@
167 -rmexec
179 -rmexec
168 diff -r b3f053cd7c7f rmregular
180 diff -r a66d19b9302d rmregular
169 --- a/rmregular
181 --- a/rmregular
170 +++ /dev/null
182 +++ /dev/null
171 @@ -1,1 +0,0 @@
183 @@ -1,1 +0,0 @@
172 -rmregular
184 -rmregular
173 data lost for: binary
185 data lost for: binary
186 data lost for: bintoregular
174 data lost for: newbinary
187 data lost for: newbinary
175 data lost for: newempty
188 data lost for: newempty
176 data lost for: newexec
189 data lost for: newexec
@@ -181,7 +194,7 b' data lost for: unsetexec'
181 % git=abort: fail on execute bit change
194 % git=abort: fail on execute bit change
182 abort: losing data for setexec
195 abort: losing data for setexec
183 % git=abort: succeed on regular file
196 % git=abort: succeed on regular file
184 diff -r b3f053cd7c7f regular
197 diff -r a66d19b9302d regular
185 --- a/regular
198 --- a/regular
186 +++ b/regular
199 +++ b/regular
187 @@ -1,1 +1,2 @@
200 @@ -1,1 +1,2 @@
General Comments 0
You need to be logged in to leave comments. Login now