author | Pierre-Yves David <pierre-yves.david@ens-lyon.org> |
Tue, 21 Feb 2017 18:41:37 +0100 | |
changeset 31120 | c4e8fa2b1c40 |
parent 31099 | b44ab288358e |
child 32940 | 75be14993fda |
permissions | -rw-r--r-- |
12419 | 1 |
Test EOL extension |
11249
0bb67503ad4b
eol: extension for managing file EOLs
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
2 |
|
13519
43b3b761d9d1
tests: don't overwrite HGRCPATH
Martin Geisler <mg@aragost.com>
parents:
13505
diff
changeset
|
3 |
$ cat >> $HGRCPATH <<EOF |
12419 | 4 |
> [diff] |
5 |
> git = True |
|
6 |
> EOF |
|
7 |
||
8 |
Set up helpers |
|
11249
0bb67503ad4b
eol: extension for managing file EOLs
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
9 |
|
12419 | 10 |
$ cat > switch-eol.py <<EOF |
11 |
> import sys |
|
12 |
> try: |
|
13 |
> import os, msvcrt |
|
14 |
> msvcrt.setmode(sys.stdin.fileno(), os.O_BINARY) |
|
15 |
> msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY) |
|
16 |
> except ImportError: |
|
17 |
> pass |
|
18 |
> (old, new) = sys.argv[1] == 'LF' and ('\n', '\r\n') or ('\r\n', '\n') |
|
19 |
> print "%% switching encoding from %r to %r" % (old, new) |
|
20 |
> for path in sys.argv[2:]: |
|
21 |
> data = file(path, 'rb').read() |
|
22 |
> data = data.replace(old, new) |
|
23 |
> file(path, 'wb').write(data) |
|
24 |
> EOF |
|
11249
0bb67503ad4b
eol: extension for managing file EOLs
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
25 |
|
12419 | 26 |
$ seteol () { |
27 |
> if [ $1 = "LF" ]; then |
|
28 |
> EOL='\n' |
|
29 |
> else |
|
30 |
> EOL='\r\n' |
|
31 |
> fi |
|
32 |
> } |
|
11249
0bb67503ad4b
eol: extension for managing file EOLs
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
33 |
|
12419 | 34 |
$ makerepo () { |
35 |
> seteol $1 |
|
36 |
> echo "% setup $1 repository" |
|
37 |
> hg init repo |
|
38 |
> cd repo |
|
39 |
> cat > .hgeol <<EOF |
|
40 |
> [repository] |
|
41 |
> native = $1 |
|
42 |
> [patterns] |
|
43 |
> mixed.txt = BIN |
|
44 |
> **.txt = native |
|
45 |
> EOF |
|
46 |
> printf "first${EOL}second${EOL}third${EOL}" > a.txt |
|
47 |
> hg commit --addremove -m 'checkin' |
|
48 |
> echo |
|
49 |
> cd .. |
|
50 |
> } |
|
11249
0bb67503ad4b
eol: extension for managing file EOLs
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
51 |
|
12419 | 52 |
$ dotest () { |
53 |
> seteol $1 |
|
54 |
> echo "% hg clone repo repo-$1" |
|
55 |
> hg clone --noupdate repo repo-$1 |
|
56 |
> cd repo-$1 |
|
57 |
> cat > .hg/hgrc <<EOF |
|
58 |
> [extensions] |
|
59 |
> eol = |
|
60 |
> [eol] |
|
61 |
> native = $1 |
|
62 |
> EOF |
|
63 |
> hg update |
|
12943
7439ea4146f8
tests: use (esc) instead of other kinds of string escaping
Mads Kiilerich <mads@kiilerich.com>
parents:
12419
diff
changeset
|
64 |
> echo '% a.txt' |
7439ea4146f8
tests: use (esc) instead of other kinds of string escaping
Mads Kiilerich <mads@kiilerich.com>
parents:
12419
diff
changeset
|
65 |
> cat a.txt |
12419 | 66 |
> echo '% hg cat a.txt' |
12943
7439ea4146f8
tests: use (esc) instead of other kinds of string escaping
Mads Kiilerich <mads@kiilerich.com>
parents:
12419
diff
changeset
|
67 |
> hg cat a.txt |
12419 | 68 |
> printf "fourth${EOL}" >> a.txt |
12943
7439ea4146f8
tests: use (esc) instead of other kinds of string escaping
Mads Kiilerich <mads@kiilerich.com>
parents:
12419
diff
changeset
|
69 |
> echo '% a.txt' |
7439ea4146f8
tests: use (esc) instead of other kinds of string escaping
Mads Kiilerich <mads@kiilerich.com>
parents:
12419
diff
changeset
|
70 |
> cat a.txt |
7439ea4146f8
tests: use (esc) instead of other kinds of string escaping
Mads Kiilerich <mads@kiilerich.com>
parents:
12419
diff
changeset
|
71 |
> hg diff |
12419 | 72 |
> python ../switch-eol.py $1 a.txt |
73 |
> echo '% hg diff only reports a single changed line:' |
|
12943
7439ea4146f8
tests: use (esc) instead of other kinds of string escaping
Mads Kiilerich <mads@kiilerich.com>
parents:
12419
diff
changeset
|
74 |
> hg diff |
12419 | 75 |
> echo "% reverting back to $1 format" |
76 |
> hg revert a.txt |
|
12943
7439ea4146f8
tests: use (esc) instead of other kinds of string escaping
Mads Kiilerich <mads@kiilerich.com>
parents:
12419
diff
changeset
|
77 |
> cat a.txt |
12419 | 78 |
> printf "first\r\nsecond\n" > mixed.txt |
79 |
> hg add mixed.txt |
|
80 |
> echo "% hg commit of inconsistent .txt file marked as binary (should work)" |
|
81 |
> hg commit -m 'binary file' |
|
82 |
> echo "% hg commit of inconsistent .txt file marked as native (should fail)" |
|
83 |
> printf "first\nsecond\r\nthird\nfourth\r\n" > a.txt |
|
84 |
> hg commit -m 'inconsistent file' |
|
85 |
> echo "% hg commit --config eol.only-consistent=False (should work)" |
|
86 |
> hg commit --config eol.only-consistent=False -m 'inconsistent file' |
|
87 |
> echo "% hg commit of binary .txt file marked as native (binary files always okay)" |
|
88 |
> printf "first${EOL}\0${EOL}third${EOL}" > a.txt |
|
89 |
> hg commit -m 'binary file' |
|
90 |
> cd .. |
|
91 |
> rm -r repo-$1 |
|
92 |
> } |
|
11249
0bb67503ad4b
eol: extension for managing file EOLs
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
93 |
|
12419 | 94 |
$ makemixedrepo () { |
95 |
> echo |
|
96 |
> echo "# setup $1 repository" |
|
97 |
> hg init mixed |
|
98 |
> cd mixed |
|
99 |
> printf "foo\r\nbar\r\nbaz\r\n" > win.txt |
|
100 |
> printf "foo\nbar\nbaz\n" > unix.txt |
|
101 |
> #printf "foo\r\nbar\nbaz\r\n" > mixed.txt |
|
102 |
> hg commit --addremove -m 'created mixed files' |
|
103 |
> echo "# setting repository-native EOLs to $1" |
|
104 |
> cat > .hgeol <<EOF |
|
105 |
> [repository] |
|
106 |
> native = $1 |
|
107 |
> [patterns] |
|
108 |
> **.txt = native |
|
109 |
> EOF |
|
110 |
> hg commit --addremove -m 'added .hgeol' |
|
111 |
> cd .. |
|
112 |
> } |
|
11249
0bb67503ad4b
eol: extension for managing file EOLs
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
113 |
|
12419 | 114 |
$ testmixed () { |
115 |
> echo |
|
116 |
> echo "% hg clone mixed mixed-$1" |
|
117 |
> hg clone mixed mixed-$1 |
|
118 |
> cd mixed-$1 |
|
119 |
> echo '% hg status (eol extension not yet activated)' |
|
120 |
> hg status |
|
121 |
> cat > .hg/hgrc <<EOF |
|
122 |
> [extensions] |
|
123 |
> eol = |
|
124 |
> [eol] |
|
125 |
> native = $1 |
|
126 |
> EOF |
|
127 |
> echo '% hg status (eol activated)' |
|
128 |
> hg status |
|
129 |
> echo '% hg commit' |
|
130 |
> hg commit -m 'synchronized EOLs' |
|
131 |
> echo '% hg status' |
|
132 |
> hg status |
|
133 |
> cd .. |
|
134 |
> rm -r mixed-$1 |
|
135 |
> } |
|
11249
0bb67503ad4b
eol: extension for managing file EOLs
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
136 |
|
12419 | 137 |
Basic tests |
11249
0bb67503ad4b
eol: extension for managing file EOLs
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
138 |
|
12419 | 139 |
$ makerepo LF |
140 |
% setup LF repository |
|
141 |
adding .hgeol |
|
142 |
adding a.txt |
|
143 |
||
144 |
$ dotest LF |
|
145 |
% hg clone repo repo-LF |
|
146 |
2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
12943
7439ea4146f8
tests: use (esc) instead of other kinds of string escaping
Mads Kiilerich <mads@kiilerich.com>
parents:
12419
diff
changeset
|
147 |
% a.txt |
12419 | 148 |
first |
149 |
second |
|
150 |
third |
|
151 |
% hg cat a.txt |
|
152 |
first |
|
153 |
second |
|
154 |
third |
|
12943
7439ea4146f8
tests: use (esc) instead of other kinds of string escaping
Mads Kiilerich <mads@kiilerich.com>
parents:
12419
diff
changeset
|
155 |
% a.txt |
12419 | 156 |
first |
157 |
second |
|
158 |
third |
|
159 |
fourth |
|
160 |
diff --git a/a.txt b/a.txt |
|
161 |
--- a/a.txt |
|
162 |
+++ b/a.txt |
|
163 |
@@ -1,3 +1,4 @@ |
|
164 |
first |
|
165 |
second |
|
166 |
third |
|
167 |
+fourth |
|
168 |
% switching encoding from '\n' to '\r\n' |
|
169 |
% hg diff only reports a single changed line: |
|
170 |
diff --git a/a.txt b/a.txt |
|
171 |
--- a/a.txt |
|
172 |
+++ b/a.txt |
|
173 |
@@ -1,3 +1,4 @@ |
|
174 |
first |
|
175 |
second |
|
176 |
third |
|
177 |
+fourth |
|
178 |
% reverting back to LF format |
|
179 |
first |
|
180 |
second |
|
181 |
third |
|
182 |
% hg commit of inconsistent .txt file marked as binary (should work) |
|
183 |
% hg commit of inconsistent .txt file marked as native (should fail) |
|
184 |
abort: inconsistent newline style in a.txt |
|
185 |
||
186 |
% hg commit --config eol.only-consistent=False (should work) |
|
187 |
% hg commit of binary .txt file marked as native (binary files always okay) |
|
188 |
$ dotest CRLF |
|
189 |
% hg clone repo repo-CRLF |
|
190 |
2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
12943
7439ea4146f8
tests: use (esc) instead of other kinds of string escaping
Mads Kiilerich <mads@kiilerich.com>
parents:
12419
diff
changeset
|
191 |
% a.txt |
7439ea4146f8
tests: use (esc) instead of other kinds of string escaping
Mads Kiilerich <mads@kiilerich.com>
parents:
12419
diff
changeset
|
192 |
first\r (esc) |
7439ea4146f8
tests: use (esc) instead of other kinds of string escaping
Mads Kiilerich <mads@kiilerich.com>
parents:
12419
diff
changeset
|
193 |
second\r (esc) |
7439ea4146f8
tests: use (esc) instead of other kinds of string escaping
Mads Kiilerich <mads@kiilerich.com>
parents:
12419
diff
changeset
|
194 |
third\r (esc) |
12419 | 195 |
% hg cat a.txt |
196 |
first |
|
197 |
second |
|
198 |
third |
|
12943
7439ea4146f8
tests: use (esc) instead of other kinds of string escaping
Mads Kiilerich <mads@kiilerich.com>
parents:
12419
diff
changeset
|
199 |
% a.txt |
7439ea4146f8
tests: use (esc) instead of other kinds of string escaping
Mads Kiilerich <mads@kiilerich.com>
parents:
12419
diff
changeset
|
200 |
first\r (esc) |
7439ea4146f8
tests: use (esc) instead of other kinds of string escaping
Mads Kiilerich <mads@kiilerich.com>
parents:
12419
diff
changeset
|
201 |
second\r (esc) |
7439ea4146f8
tests: use (esc) instead of other kinds of string escaping
Mads Kiilerich <mads@kiilerich.com>
parents:
12419
diff
changeset
|
202 |
third\r (esc) |
7439ea4146f8
tests: use (esc) instead of other kinds of string escaping
Mads Kiilerich <mads@kiilerich.com>
parents:
12419
diff
changeset
|
203 |
fourth\r (esc) |
12419 | 204 |
diff --git a/a.txt b/a.txt |
205 |
--- a/a.txt |
|
206 |
+++ b/a.txt |
|
207 |
@@ -1,3 +1,4 @@ |
|
208 |
first |
|
209 |
second |
|
210 |
third |
|
211 |
+fourth |
|
212 |
% switching encoding from '\r\n' to '\n' |
|
213 |
% hg diff only reports a single changed line: |
|
214 |
diff --git a/a.txt b/a.txt |
|
215 |
--- a/a.txt |
|
216 |
+++ b/a.txt |
|
217 |
@@ -1,3 +1,4 @@ |
|
218 |
first |
|
219 |
second |
|
220 |
third |
|
221 |
+fourth |
|
222 |
% reverting back to CRLF format |
|
12943
7439ea4146f8
tests: use (esc) instead of other kinds of string escaping
Mads Kiilerich <mads@kiilerich.com>
parents:
12419
diff
changeset
|
223 |
first\r (esc) |
7439ea4146f8
tests: use (esc) instead of other kinds of string escaping
Mads Kiilerich <mads@kiilerich.com>
parents:
12419
diff
changeset
|
224 |
second\r (esc) |
7439ea4146f8
tests: use (esc) instead of other kinds of string escaping
Mads Kiilerich <mads@kiilerich.com>
parents:
12419
diff
changeset
|
225 |
third\r (esc) |
12419 | 226 |
% hg commit of inconsistent .txt file marked as binary (should work) |
227 |
% hg commit of inconsistent .txt file marked as native (should fail) |
|
228 |
abort: inconsistent newline style in a.txt |
|
229 |
||
230 |
% hg commit --config eol.only-consistent=False (should work) |
|
231 |
% hg commit of binary .txt file marked as native (binary files always okay) |
|
232 |
$ rm -r repo |
|
233 |
$ makerepo CRLF |
|
234 |
% setup CRLF repository |
|
235 |
adding .hgeol |
|
236 |
adding a.txt |
|
237 |
||
238 |
$ dotest LF |
|
239 |
% hg clone repo repo-LF |
|
240 |
2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
12943
7439ea4146f8
tests: use (esc) instead of other kinds of string escaping
Mads Kiilerich <mads@kiilerich.com>
parents:
12419
diff
changeset
|
241 |
% a.txt |
12419 | 242 |
first |
243 |
second |
|
244 |
third |
|
245 |
% hg cat a.txt |
|
12943
7439ea4146f8
tests: use (esc) instead of other kinds of string escaping
Mads Kiilerich <mads@kiilerich.com>
parents:
12419
diff
changeset
|
246 |
first\r (esc) |
7439ea4146f8
tests: use (esc) instead of other kinds of string escaping
Mads Kiilerich <mads@kiilerich.com>
parents:
12419
diff
changeset
|
247 |
second\r (esc) |
7439ea4146f8
tests: use (esc) instead of other kinds of string escaping
Mads Kiilerich <mads@kiilerich.com>
parents:
12419
diff
changeset
|
248 |
third\r (esc) |
7439ea4146f8
tests: use (esc) instead of other kinds of string escaping
Mads Kiilerich <mads@kiilerich.com>
parents:
12419
diff
changeset
|
249 |
% a.txt |
12419 | 250 |
first |
251 |
second |
|
252 |
third |
|
253 |
fourth |
|
254 |
diff --git a/a.txt b/a.txt |
|
255 |
--- a/a.txt |
|
256 |
+++ b/a.txt |
|
257 |
@@ -1,3 +1,4 @@ |
|
12943
7439ea4146f8
tests: use (esc) instead of other kinds of string escaping
Mads Kiilerich <mads@kiilerich.com>
parents:
12419
diff
changeset
|
258 |
first\r (esc) |
7439ea4146f8
tests: use (esc) instead of other kinds of string escaping
Mads Kiilerich <mads@kiilerich.com>
parents:
12419
diff
changeset
|
259 |
second\r (esc) |
7439ea4146f8
tests: use (esc) instead of other kinds of string escaping
Mads Kiilerich <mads@kiilerich.com>
parents:
12419
diff
changeset
|
260 |
third\r (esc) |
7439ea4146f8
tests: use (esc) instead of other kinds of string escaping
Mads Kiilerich <mads@kiilerich.com>
parents:
12419
diff
changeset
|
261 |
+fourth\r (esc) |
12419 | 262 |
% switching encoding from '\n' to '\r\n' |
263 |
% hg diff only reports a single changed line: |
|
264 |
diff --git a/a.txt b/a.txt |
|
265 |
--- a/a.txt |
|
266 |
+++ b/a.txt |
|
267 |
@@ -1,3 +1,4 @@ |
|
12943
7439ea4146f8
tests: use (esc) instead of other kinds of string escaping
Mads Kiilerich <mads@kiilerich.com>
parents:
12419
diff
changeset
|
268 |
first\r (esc) |
7439ea4146f8
tests: use (esc) instead of other kinds of string escaping
Mads Kiilerich <mads@kiilerich.com>
parents:
12419
diff
changeset
|
269 |
second\r (esc) |
7439ea4146f8
tests: use (esc) instead of other kinds of string escaping
Mads Kiilerich <mads@kiilerich.com>
parents:
12419
diff
changeset
|
270 |
third\r (esc) |
7439ea4146f8
tests: use (esc) instead of other kinds of string escaping
Mads Kiilerich <mads@kiilerich.com>
parents:
12419
diff
changeset
|
271 |
+fourth\r (esc) |
12419 | 272 |
% reverting back to LF format |
273 |
first |
|
274 |
second |
|
275 |
third |
|
276 |
% hg commit of inconsistent .txt file marked as binary (should work) |
|
277 |
% hg commit of inconsistent .txt file marked as native (should fail) |
|
278 |
abort: inconsistent newline style in a.txt |
|
279 |
||
280 |
% hg commit --config eol.only-consistent=False (should work) |
|
281 |
% hg commit of binary .txt file marked as native (binary files always okay) |
|
282 |
$ dotest CRLF |
|
283 |
% hg clone repo repo-CRLF |
|
284 |
2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
12943
7439ea4146f8
tests: use (esc) instead of other kinds of string escaping
Mads Kiilerich <mads@kiilerich.com>
parents:
12419
diff
changeset
|
285 |
% a.txt |
7439ea4146f8
tests: use (esc) instead of other kinds of string escaping
Mads Kiilerich <mads@kiilerich.com>
parents:
12419
diff
changeset
|
286 |
first\r (esc) |
7439ea4146f8
tests: use (esc) instead of other kinds of string escaping
Mads Kiilerich <mads@kiilerich.com>
parents:
12419
diff
changeset
|
287 |
second\r (esc) |
7439ea4146f8
tests: use (esc) instead of other kinds of string escaping
Mads Kiilerich <mads@kiilerich.com>
parents:
12419
diff
changeset
|
288 |
third\r (esc) |
12419 | 289 |
% hg cat a.txt |
12943
7439ea4146f8
tests: use (esc) instead of other kinds of string escaping
Mads Kiilerich <mads@kiilerich.com>
parents:
12419
diff
changeset
|
290 |
first\r (esc) |
7439ea4146f8
tests: use (esc) instead of other kinds of string escaping
Mads Kiilerich <mads@kiilerich.com>
parents:
12419
diff
changeset
|
291 |
second\r (esc) |
7439ea4146f8
tests: use (esc) instead of other kinds of string escaping
Mads Kiilerich <mads@kiilerich.com>
parents:
12419
diff
changeset
|
292 |
third\r (esc) |
7439ea4146f8
tests: use (esc) instead of other kinds of string escaping
Mads Kiilerich <mads@kiilerich.com>
parents:
12419
diff
changeset
|
293 |
% a.txt |
7439ea4146f8
tests: use (esc) instead of other kinds of string escaping
Mads Kiilerich <mads@kiilerich.com>
parents:
12419
diff
changeset
|
294 |
first\r (esc) |
7439ea4146f8
tests: use (esc) instead of other kinds of string escaping
Mads Kiilerich <mads@kiilerich.com>
parents:
12419
diff
changeset
|
295 |
second\r (esc) |
7439ea4146f8
tests: use (esc) instead of other kinds of string escaping
Mads Kiilerich <mads@kiilerich.com>
parents:
12419
diff
changeset
|
296 |
third\r (esc) |
7439ea4146f8
tests: use (esc) instead of other kinds of string escaping
Mads Kiilerich <mads@kiilerich.com>
parents:
12419
diff
changeset
|
297 |
fourth\r (esc) |
12419 | 298 |
diff --git a/a.txt b/a.txt |
299 |
--- a/a.txt |
|
300 |
+++ b/a.txt |
|
301 |
@@ -1,3 +1,4 @@ |
|
12943
7439ea4146f8
tests: use (esc) instead of other kinds of string escaping
Mads Kiilerich <mads@kiilerich.com>
parents:
12419
diff
changeset
|
302 |
first\r (esc) |
7439ea4146f8
tests: use (esc) instead of other kinds of string escaping
Mads Kiilerich <mads@kiilerich.com>
parents:
12419
diff
changeset
|
303 |
second\r (esc) |
7439ea4146f8
tests: use (esc) instead of other kinds of string escaping
Mads Kiilerich <mads@kiilerich.com>
parents:
12419
diff
changeset
|
304 |
third\r (esc) |
7439ea4146f8
tests: use (esc) instead of other kinds of string escaping
Mads Kiilerich <mads@kiilerich.com>
parents:
12419
diff
changeset
|
305 |
+fourth\r (esc) |
12419 | 306 |
% switching encoding from '\r\n' to '\n' |
307 |
% hg diff only reports a single changed line: |
|
308 |
diff --git a/a.txt b/a.txt |
|
309 |
--- a/a.txt |
|
310 |
+++ b/a.txt |
|
311 |
@@ -1,3 +1,4 @@ |
|
12943
7439ea4146f8
tests: use (esc) instead of other kinds of string escaping
Mads Kiilerich <mads@kiilerich.com>
parents:
12419
diff
changeset
|
312 |
first\r (esc) |
7439ea4146f8
tests: use (esc) instead of other kinds of string escaping
Mads Kiilerich <mads@kiilerich.com>
parents:
12419
diff
changeset
|
313 |
second\r (esc) |
7439ea4146f8
tests: use (esc) instead of other kinds of string escaping
Mads Kiilerich <mads@kiilerich.com>
parents:
12419
diff
changeset
|
314 |
third\r (esc) |
7439ea4146f8
tests: use (esc) instead of other kinds of string escaping
Mads Kiilerich <mads@kiilerich.com>
parents:
12419
diff
changeset
|
315 |
+fourth\r (esc) |
12419 | 316 |
% reverting back to CRLF format |
12943
7439ea4146f8
tests: use (esc) instead of other kinds of string escaping
Mads Kiilerich <mads@kiilerich.com>
parents:
12419
diff
changeset
|
317 |
first\r (esc) |
7439ea4146f8
tests: use (esc) instead of other kinds of string escaping
Mads Kiilerich <mads@kiilerich.com>
parents:
12419
diff
changeset
|
318 |
second\r (esc) |
7439ea4146f8
tests: use (esc) instead of other kinds of string escaping
Mads Kiilerich <mads@kiilerich.com>
parents:
12419
diff
changeset
|
319 |
third\r (esc) |
12419 | 320 |
% hg commit of inconsistent .txt file marked as binary (should work) |
321 |
% hg commit of inconsistent .txt file marked as native (should fail) |
|
322 |
abort: inconsistent newline style in a.txt |
|
323 |
||
324 |
% hg commit --config eol.only-consistent=False (should work) |
|
325 |
% hg commit of binary .txt file marked as native (binary files always okay) |
|
326 |
$ rm -r repo |
|
11249
0bb67503ad4b
eol: extension for managing file EOLs
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
327 |
|
12419 | 328 |
Mixed tests |
11249
0bb67503ad4b
eol: extension for managing file EOLs
Martin Geisler <mg@lazybytes.net>
parents:
diff
changeset
|
329 |
|
12419 | 330 |
$ makemixedrepo LF |
331 |
||
332 |
# setup LF repository |
|
333 |
adding unix.txt |
|
334 |
adding win.txt |
|
335 |
# setting repository-native EOLs to LF |
|
336 |
adding .hgeol |
|
337 |
$ testmixed LF |
|
338 |
||
339 |
% hg clone mixed mixed-LF |
|
340 |
updating to branch default |
|
341 |
3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
342 |
% hg status (eol extension not yet activated) |
|
343 |
% hg status (eol activated) |
|
344 |
M win.txt |
|
345 |
% hg commit |
|
346 |
% hg status |
|
347 |
$ testmixed CRLF |
|
348 |
||
349 |
% hg clone mixed mixed-CRLF |
|
350 |
updating to branch default |
|
351 |
3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
352 |
% hg status (eol extension not yet activated) |
|
353 |
% hg status (eol activated) |
|
354 |
M win.txt |
|
355 |
% hg commit |
|
356 |
% hg status |
|
357 |
$ rm -r mixed |
|
358 |
$ makemixedrepo CRLF |
|
359 |
||
360 |
# setup CRLF repository |
|
361 |
adding unix.txt |
|
362 |
adding win.txt |
|
363 |
# setting repository-native EOLs to CRLF |
|
364 |
adding .hgeol |
|
365 |
$ testmixed LF |
|
366 |
||
367 |
% hg clone mixed mixed-LF |
|
368 |
updating to branch default |
|
369 |
3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
370 |
% hg status (eol extension not yet activated) |
|
371 |
% hg status (eol activated) |
|
372 |
M unix.txt |
|
373 |
% hg commit |
|
374 |
% hg status |
|
375 |
$ testmixed CRLF |
|
376 |
||
377 |
% hg clone mixed mixed-CRLF |
|
378 |
updating to branch default |
|
379 |
3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
380 |
% hg status (eol extension not yet activated) |
|
381 |
% hg status (eol activated) |
|
382 |
M unix.txt |
|
383 |
% hg commit |
|
384 |
% hg status |
|
385 |
$ rm -r mixed |
|
13475
c7bef25ca393
eol: handle LockUnavailable error (issue2569)
Martin Geisler <mg@aragost.com>
parents:
12943
diff
changeset
|
386 |
|
16986
79902f7e27df
tests: convert some hghave unix-permissions to #if
Mads Kiilerich <mads@kiilerich.com>
parents:
16913
diff
changeset
|
387 |
$ echo '[extensions]' >> $HGRCPATH |
79902f7e27df
tests: convert some hghave unix-permissions to #if
Mads Kiilerich <mads@kiilerich.com>
parents:
16913
diff
changeset
|
388 |
$ echo 'eol =' >> $HGRCPATH |
79902f7e27df
tests: convert some hghave unix-permissions to #if
Mads Kiilerich <mads@kiilerich.com>
parents:
16913
diff
changeset
|
389 |
|
79902f7e27df
tests: convert some hghave unix-permissions to #if
Mads Kiilerich <mads@kiilerich.com>
parents:
16913
diff
changeset
|
390 |
#if unix-permissions |
79902f7e27df
tests: convert some hghave unix-permissions to #if
Mads Kiilerich <mads@kiilerich.com>
parents:
16913
diff
changeset
|
391 |
|
13475
c7bef25ca393
eol: handle LockUnavailable error (issue2569)
Martin Geisler <mg@aragost.com>
parents:
12943
diff
changeset
|
392 |
Test issue2569 -- eol extension takes write lock on reading: |
c7bef25ca393
eol: handle LockUnavailable error (issue2569)
Martin Geisler <mg@aragost.com>
parents:
12943
diff
changeset
|
393 |
|
c7bef25ca393
eol: handle LockUnavailable error (issue2569)
Martin Geisler <mg@aragost.com>
parents:
12943
diff
changeset
|
394 |
$ hg init repo |
c7bef25ca393
eol: handle LockUnavailable error (issue2569)
Martin Geisler <mg@aragost.com>
parents:
12943
diff
changeset
|
395 |
$ cd repo |
c7bef25ca393
eol: handle LockUnavailable error (issue2569)
Martin Geisler <mg@aragost.com>
parents:
12943
diff
changeset
|
396 |
$ touch .hgeol |
c7bef25ca393
eol: handle LockUnavailable error (issue2569)
Martin Geisler <mg@aragost.com>
parents:
12943
diff
changeset
|
397 |
$ hg status |
c7bef25ca393
eol: handle LockUnavailable error (issue2569)
Martin Geisler <mg@aragost.com>
parents:
12943
diff
changeset
|
398 |
? .hgeol |
c7bef25ca393
eol: handle LockUnavailable error (issue2569)
Martin Geisler <mg@aragost.com>
parents:
12943
diff
changeset
|
399 |
$ chmod -R -w .hg |
c7bef25ca393
eol: handle LockUnavailable error (issue2569)
Martin Geisler <mg@aragost.com>
parents:
12943
diff
changeset
|
400 |
$ sleep 1 |
c7bef25ca393
eol: handle LockUnavailable error (issue2569)
Martin Geisler <mg@aragost.com>
parents:
12943
diff
changeset
|
401 |
$ touch .hgeol |
c7bef25ca393
eol: handle LockUnavailable error (issue2569)
Martin Geisler <mg@aragost.com>
parents:
12943
diff
changeset
|
402 |
$ hg status --traceback |
c7bef25ca393
eol: handle LockUnavailable error (issue2569)
Martin Geisler <mg@aragost.com>
parents:
12943
diff
changeset
|
403 |
? .hgeol |
13621
c0b0b00f0279
tests: fix permission issue trying to remove test directory
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
13505
diff
changeset
|
404 |
$ chmod -R u+w .hg |
13503
5007ff32f356
eol: test win32text compatible encode/decode filters
Martin Geisler <mg@aragost.com>
parents:
13475
diff
changeset
|
405 |
$ cd .. |
5007ff32f356
eol: test win32text compatible encode/decode filters
Martin Geisler <mg@aragost.com>
parents:
13475
diff
changeset
|
406 |
|
16986
79902f7e27df
tests: convert some hghave unix-permissions to #if
Mads Kiilerich <mads@kiilerich.com>
parents:
16913
diff
changeset
|
407 |
#endif |
79902f7e27df
tests: convert some hghave unix-permissions to #if
Mads Kiilerich <mads@kiilerich.com>
parents:
16913
diff
changeset
|
408 |
|
13503
5007ff32f356
eol: test win32text compatible encode/decode filters
Martin Geisler <mg@aragost.com>
parents:
13475
diff
changeset
|
409 |
Test cleverencode: and cleverdecode: aliases for win32text extension |
5007ff32f356
eol: test win32text compatible encode/decode filters
Martin Geisler <mg@aragost.com>
parents:
13475
diff
changeset
|
410 |
|
23172
e955549cd045
tests: write hgrc of more than two lines by using shell heredoc
Yuya Nishihara <yuya@tcha.org>
parents:
23068
diff
changeset
|
411 |
$ cat <<EOF >> $HGRCPATH |
e955549cd045
tests: write hgrc of more than two lines by using shell heredoc
Yuya Nishihara <yuya@tcha.org>
parents:
23068
diff
changeset
|
412 |
> [encode] |
e955549cd045
tests: write hgrc of more than two lines by using shell heredoc
Yuya Nishihara <yuya@tcha.org>
parents:
23068
diff
changeset
|
413 |
> **.txt = cleverencode: |
e955549cd045
tests: write hgrc of more than two lines by using shell heredoc
Yuya Nishihara <yuya@tcha.org>
parents:
23068
diff
changeset
|
414 |
> [decode] |
e955549cd045
tests: write hgrc of more than two lines by using shell heredoc
Yuya Nishihara <yuya@tcha.org>
parents:
23068
diff
changeset
|
415 |
> **.txt = cleverdecode: |
e955549cd045
tests: write hgrc of more than two lines by using shell heredoc
Yuya Nishihara <yuya@tcha.org>
parents:
23068
diff
changeset
|
416 |
> EOF |
13503
5007ff32f356
eol: test win32text compatible encode/decode filters
Martin Geisler <mg@aragost.com>
parents:
13475
diff
changeset
|
417 |
|
5007ff32f356
eol: test win32text compatible encode/decode filters
Martin Geisler <mg@aragost.com>
parents:
13475
diff
changeset
|
418 |
$ hg init win32compat |
5007ff32f356
eol: test win32text compatible encode/decode filters
Martin Geisler <mg@aragost.com>
parents:
13475
diff
changeset
|
419 |
$ cd win32compat |
5007ff32f356
eol: test win32text compatible encode/decode filters
Martin Geisler <mg@aragost.com>
parents:
13475
diff
changeset
|
420 |
$ printf "foo\r\nbar\r\nbaz\r\n" > win.txt |
5007ff32f356
eol: test win32text compatible encode/decode filters
Martin Geisler <mg@aragost.com>
parents:
13475
diff
changeset
|
421 |
$ printf "foo\nbar\nbaz\n" > unix.txt |
5007ff32f356
eol: test win32text compatible encode/decode filters
Martin Geisler <mg@aragost.com>
parents:
13475
diff
changeset
|
422 |
$ hg add |
5007ff32f356
eol: test win32text compatible encode/decode filters
Martin Geisler <mg@aragost.com>
parents:
13475
diff
changeset
|
423 |
adding unix.txt |
5007ff32f356
eol: test win32text compatible encode/decode filters
Martin Geisler <mg@aragost.com>
parents:
13475
diff
changeset
|
424 |
adding win.txt |
5007ff32f356
eol: test win32text compatible encode/decode filters
Martin Geisler <mg@aragost.com>
parents:
13475
diff
changeset
|
425 |
$ hg commit -m checkin |
5007ff32f356
eol: test win32text compatible encode/decode filters
Martin Geisler <mg@aragost.com>
parents:
13475
diff
changeset
|
426 |
|
5007ff32f356
eol: test win32text compatible encode/decode filters
Martin Geisler <mg@aragost.com>
parents:
13475
diff
changeset
|
427 |
Check that both files have LF line-endings in the repository: |
5007ff32f356
eol: test win32text compatible encode/decode filters
Martin Geisler <mg@aragost.com>
parents:
13475
diff
changeset
|
428 |
|
5007ff32f356
eol: test win32text compatible encode/decode filters
Martin Geisler <mg@aragost.com>
parents:
13475
diff
changeset
|
429 |
$ hg cat win.txt |
5007ff32f356
eol: test win32text compatible encode/decode filters
Martin Geisler <mg@aragost.com>
parents:
13475
diff
changeset
|
430 |
foo |
5007ff32f356
eol: test win32text compatible encode/decode filters
Martin Geisler <mg@aragost.com>
parents:
13475
diff
changeset
|
431 |
bar |
5007ff32f356
eol: test win32text compatible encode/decode filters
Martin Geisler <mg@aragost.com>
parents:
13475
diff
changeset
|
432 |
baz |
5007ff32f356
eol: test win32text compatible encode/decode filters
Martin Geisler <mg@aragost.com>
parents:
13475
diff
changeset
|
433 |
$ hg cat unix.txt |
5007ff32f356
eol: test win32text compatible encode/decode filters
Martin Geisler <mg@aragost.com>
parents:
13475
diff
changeset
|
434 |
foo |
5007ff32f356
eol: test win32text compatible encode/decode filters
Martin Geisler <mg@aragost.com>
parents:
13475
diff
changeset
|
435 |
bar |
5007ff32f356
eol: test win32text compatible encode/decode filters
Martin Geisler <mg@aragost.com>
parents:
13475
diff
changeset
|
436 |
baz |
13505
9b617c56eb65
eol: do not abort on parse error
Martin Geisler <mg@aragost.com>
parents:
13504
diff
changeset
|
437 |
|
9b617c56eb65
eol: do not abort on parse error
Martin Geisler <mg@aragost.com>
parents:
13504
diff
changeset
|
438 |
Test handling of a broken .hgeol file: |
9b617c56eb65
eol: do not abort on parse error
Martin Geisler <mg@aragost.com>
parents:
13504
diff
changeset
|
439 |
|
9b617c56eb65
eol: do not abort on parse error
Martin Geisler <mg@aragost.com>
parents:
13504
diff
changeset
|
440 |
$ touch .hgeol |
9b617c56eb65
eol: do not abort on parse error
Martin Geisler <mg@aragost.com>
parents:
13504
diff
changeset
|
441 |
$ hg add .hgeol |
9b617c56eb65
eol: do not abort on parse error
Martin Geisler <mg@aragost.com>
parents:
13504
diff
changeset
|
442 |
$ hg commit -m 'clean version' |
9b617c56eb65
eol: do not abort on parse error
Martin Geisler <mg@aragost.com>
parents:
13504
diff
changeset
|
443 |
$ echo "bad" > .hgeol |
9b617c56eb65
eol: do not abort on parse error
Martin Geisler <mg@aragost.com>
parents:
13504
diff
changeset
|
444 |
$ hg status |
9b617c56eb65
eol: do not abort on parse error
Martin Geisler <mg@aragost.com>
parents:
13504
diff
changeset
|
445 |
warning: ignoring .hgeol file due to parse error at .hgeol:1: bad |
9b617c56eb65
eol: do not abort on parse error
Martin Geisler <mg@aragost.com>
parents:
13504
diff
changeset
|
446 |
M .hgeol |
9b617c56eb65
eol: do not abort on parse error
Martin Geisler <mg@aragost.com>
parents:
13504
diff
changeset
|
447 |
$ hg revert .hgeol |
9b617c56eb65
eol: do not abort on parse error
Martin Geisler <mg@aragost.com>
parents:
13504
diff
changeset
|
448 |
warning: ignoring .hgeol file due to parse error at .hgeol:1: bad |
9b617c56eb65
eol: do not abort on parse error
Martin Geisler <mg@aragost.com>
parents:
13504
diff
changeset
|
449 |
$ hg status |
9b617c56eb65
eol: do not abort on parse error
Martin Geisler <mg@aragost.com>
parents:
13504
diff
changeset
|
450 |
? .hgeol.orig |
14854
23c2d7d25329
eol: eol.only-consistent can now be specified in .hgeol
Stepan Koltsov <stepancheg@yandex-team.ru>
parents:
13623
diff
changeset
|
451 |
|
23c2d7d25329
eol: eol.only-consistent can now be specified in .hgeol
Stepan Koltsov <stepancheg@yandex-team.ru>
parents:
13623
diff
changeset
|
452 |
Test eol.only-consistent can be specified in .hgeol |
23c2d7d25329
eol: eol.only-consistent can now be specified in .hgeol
Stepan Koltsov <stepancheg@yandex-team.ru>
parents:
13623
diff
changeset
|
453 |
|
23c2d7d25329
eol: eol.only-consistent can now be specified in .hgeol
Stepan Koltsov <stepancheg@yandex-team.ru>
parents:
13623
diff
changeset
|
454 |
$ cd $TESTTMP |
23c2d7d25329
eol: eol.only-consistent can now be specified in .hgeol
Stepan Koltsov <stepancheg@yandex-team.ru>
parents:
13623
diff
changeset
|
455 |
$ hg init only-consistent |
23c2d7d25329
eol: eol.only-consistent can now be specified in .hgeol
Stepan Koltsov <stepancheg@yandex-team.ru>
parents:
13623
diff
changeset
|
456 |
$ cd only-consistent |
23c2d7d25329
eol: eol.only-consistent can now be specified in .hgeol
Stepan Koltsov <stepancheg@yandex-team.ru>
parents:
13623
diff
changeset
|
457 |
$ printf "first\nsecond\r\n" > a.txt |
23c2d7d25329
eol: eol.only-consistent can now be specified in .hgeol
Stepan Koltsov <stepancheg@yandex-team.ru>
parents:
13623
diff
changeset
|
458 |
$ hg add a.txt |
23c2d7d25329
eol: eol.only-consistent can now be specified in .hgeol
Stepan Koltsov <stepancheg@yandex-team.ru>
parents:
13623
diff
changeset
|
459 |
$ cat > .hgeol << EOF |
23c2d7d25329
eol: eol.only-consistent can now be specified in .hgeol
Stepan Koltsov <stepancheg@yandex-team.ru>
parents:
13623
diff
changeset
|
460 |
> [eol] |
23c2d7d25329
eol: eol.only-consistent can now be specified in .hgeol
Stepan Koltsov <stepancheg@yandex-team.ru>
parents:
13623
diff
changeset
|
461 |
> only-consistent = True |
23c2d7d25329
eol: eol.only-consistent can now be specified in .hgeol
Stepan Koltsov <stepancheg@yandex-team.ru>
parents:
13623
diff
changeset
|
462 |
> EOF |
23c2d7d25329
eol: eol.only-consistent can now be specified in .hgeol
Stepan Koltsov <stepancheg@yandex-team.ru>
parents:
13623
diff
changeset
|
463 |
$ hg commit -m 'inconsistent' |
23c2d7d25329
eol: eol.only-consistent can now be specified in .hgeol
Stepan Koltsov <stepancheg@yandex-team.ru>
parents:
13623
diff
changeset
|
464 |
abort: inconsistent newline style in a.txt |
23c2d7d25329
eol: eol.only-consistent can now be specified in .hgeol
Stepan Koltsov <stepancheg@yandex-team.ru>
parents:
13623
diff
changeset
|
465 |
|
23c2d7d25329
eol: eol.only-consistent can now be specified in .hgeol
Stepan Koltsov <stepancheg@yandex-team.ru>
parents:
13623
diff
changeset
|
466 |
[255] |
23c2d7d25329
eol: eol.only-consistent can now be specified in .hgeol
Stepan Koltsov <stepancheg@yandex-team.ru>
parents:
13623
diff
changeset
|
467 |
$ cat > .hgeol << EOF |
23c2d7d25329
eol: eol.only-consistent can now be specified in .hgeol
Stepan Koltsov <stepancheg@yandex-team.ru>
parents:
13623
diff
changeset
|
468 |
> [eol] |
23c2d7d25329
eol: eol.only-consistent can now be specified in .hgeol
Stepan Koltsov <stepancheg@yandex-team.ru>
parents:
13623
diff
changeset
|
469 |
> only-consistent = False |
23c2d7d25329
eol: eol.only-consistent can now be specified in .hgeol
Stepan Koltsov <stepancheg@yandex-team.ru>
parents:
13623
diff
changeset
|
470 |
> EOF |
23c2d7d25329
eol: eol.only-consistent can now be specified in .hgeol
Stepan Koltsov <stepancheg@yandex-team.ru>
parents:
13623
diff
changeset
|
471 |
$ hg commit -m 'consistent' |
23c2d7d25329
eol: eol.only-consistent can now be specified in .hgeol
Stepan Koltsov <stepancheg@yandex-team.ru>
parents:
13623
diff
changeset
|
472 |
|
31099
b44ab288358e
subrepo: run the repo decoders when archiving
Matt Harbison <matt_harbison@yahoo.com>
parents:
23172
diff
changeset
|
473 |
$ hg init subrepo |
b44ab288358e
subrepo: run the repo decoders when archiving
Matt Harbison <matt_harbison@yahoo.com>
parents:
23172
diff
changeset
|
474 |
$ hg -R subrepo pull -qu . |
b44ab288358e
subrepo: run the repo decoders when archiving
Matt Harbison <matt_harbison@yahoo.com>
parents:
23172
diff
changeset
|
475 |
$ echo "subrepo = subrepo" > .hgsub |
b44ab288358e
subrepo: run the repo decoders when archiving
Matt Harbison <matt_harbison@yahoo.com>
parents:
23172
diff
changeset
|
476 |
$ hg ci -Am "add subrepo" |
b44ab288358e
subrepo: run the repo decoders when archiving
Matt Harbison <matt_harbison@yahoo.com>
parents:
23172
diff
changeset
|
477 |
adding .hgeol |
b44ab288358e
subrepo: run the repo decoders when archiving
Matt Harbison <matt_harbison@yahoo.com>
parents:
23172
diff
changeset
|
478 |
adding .hgsub |
b44ab288358e
subrepo: run the repo decoders when archiving
Matt Harbison <matt_harbison@yahoo.com>
parents:
23172
diff
changeset
|
479 |
$ hg archive -S ../archive |
b44ab288358e
subrepo: run the repo decoders when archiving
Matt Harbison <matt_harbison@yahoo.com>
parents:
23172
diff
changeset
|
480 |
$ find ../archive/* | sort |
b44ab288358e
subrepo: run the repo decoders when archiving
Matt Harbison <matt_harbison@yahoo.com>
parents:
23172
diff
changeset
|
481 |
../archive/a.txt |
b44ab288358e
subrepo: run the repo decoders when archiving
Matt Harbison <matt_harbison@yahoo.com>
parents:
23172
diff
changeset
|
482 |
../archive/subrepo |
b44ab288358e
subrepo: run the repo decoders when archiving
Matt Harbison <matt_harbison@yahoo.com>
parents:
23172
diff
changeset
|
483 |
../archive/subrepo/a.txt |
b44ab288358e
subrepo: run the repo decoders when archiving
Matt Harbison <matt_harbison@yahoo.com>
parents:
23172
diff
changeset
|
484 |
$ cat ../archive/a.txt ../archive/subrepo/a.txt |
b44ab288358e
subrepo: run the repo decoders when archiving
Matt Harbison <matt_harbison@yahoo.com>
parents:
23172
diff
changeset
|
485 |
first\r (esc) |
b44ab288358e
subrepo: run the repo decoders when archiving
Matt Harbison <matt_harbison@yahoo.com>
parents:
23172
diff
changeset
|
486 |
second\r (esc) |
b44ab288358e
subrepo: run the repo decoders when archiving
Matt Harbison <matt_harbison@yahoo.com>
parents:
23172
diff
changeset
|
487 |
first\r (esc) |
b44ab288358e
subrepo: run the repo decoders when archiving
Matt Harbison <matt_harbison@yahoo.com>
parents:
23172
diff
changeset
|
488 |
second\r (esc) |
14855
f33579435378
eol: fix missing trailing newlines in comitted files
Stepan Koltsov <stepancheg@yandex-team.ru>
parents:
14854
diff
changeset
|
489 |
|
f33579435378
eol: fix missing trailing newlines in comitted files
Stepan Koltsov <stepancheg@yandex-team.ru>
parents:
14854
diff
changeset
|
490 |
Test trailing newline |
f33579435378
eol: fix missing trailing newlines in comitted files
Stepan Koltsov <stepancheg@yandex-team.ru>
parents:
14854
diff
changeset
|
491 |
|
f33579435378
eol: fix missing trailing newlines in comitted files
Stepan Koltsov <stepancheg@yandex-team.ru>
parents:
14854
diff
changeset
|
492 |
$ cat >> $HGRCPATH <<EOF |
f33579435378
eol: fix missing trailing newlines in comitted files
Stepan Koltsov <stepancheg@yandex-team.ru>
parents:
14854
diff
changeset
|
493 |
> [extensions] |
f33579435378
eol: fix missing trailing newlines in comitted files
Stepan Koltsov <stepancheg@yandex-team.ru>
parents:
14854
diff
changeset
|
494 |
> eol= |
f33579435378
eol: fix missing trailing newlines in comitted files
Stepan Koltsov <stepancheg@yandex-team.ru>
parents:
14854
diff
changeset
|
495 |
> EOF |
f33579435378
eol: fix missing trailing newlines in comitted files
Stepan Koltsov <stepancheg@yandex-team.ru>
parents:
14854
diff
changeset
|
496 |
|
f33579435378
eol: fix missing trailing newlines in comitted files
Stepan Koltsov <stepancheg@yandex-team.ru>
parents:
14854
diff
changeset
|
497 |
setup repository |
f33579435378
eol: fix missing trailing newlines in comitted files
Stepan Koltsov <stepancheg@yandex-team.ru>
parents:
14854
diff
changeset
|
498 |
|
f33579435378
eol: fix missing trailing newlines in comitted files
Stepan Koltsov <stepancheg@yandex-team.ru>
parents:
14854
diff
changeset
|
499 |
$ cd $TESTTMP |
f33579435378
eol: fix missing trailing newlines in comitted files
Stepan Koltsov <stepancheg@yandex-team.ru>
parents:
14854
diff
changeset
|
500 |
$ hg init trailing |
f33579435378
eol: fix missing trailing newlines in comitted files
Stepan Koltsov <stepancheg@yandex-team.ru>
parents:
14854
diff
changeset
|
501 |
$ cd trailing |
f33579435378
eol: fix missing trailing newlines in comitted files
Stepan Koltsov <stepancheg@yandex-team.ru>
parents:
14854
diff
changeset
|
502 |
$ cat > .hgeol <<EOF |
f33579435378
eol: fix missing trailing newlines in comitted files
Stepan Koltsov <stepancheg@yandex-team.ru>
parents:
14854
diff
changeset
|
503 |
> [patterns] |
f33579435378
eol: fix missing trailing newlines in comitted files
Stepan Koltsov <stepancheg@yandex-team.ru>
parents:
14854
diff
changeset
|
504 |
> **.txt = native |
f33579435378
eol: fix missing trailing newlines in comitted files
Stepan Koltsov <stepancheg@yandex-team.ru>
parents:
14854
diff
changeset
|
505 |
> [eol] |
f33579435378
eol: fix missing trailing newlines in comitted files
Stepan Koltsov <stepancheg@yandex-team.ru>
parents:
14854
diff
changeset
|
506 |
> fix-trailing-newline = False |
f33579435378
eol: fix missing trailing newlines in comitted files
Stepan Koltsov <stepancheg@yandex-team.ru>
parents:
14854
diff
changeset
|
507 |
> EOF |
f33579435378
eol: fix missing trailing newlines in comitted files
Stepan Koltsov <stepancheg@yandex-team.ru>
parents:
14854
diff
changeset
|
508 |
|
f33579435378
eol: fix missing trailing newlines in comitted files
Stepan Koltsov <stepancheg@yandex-team.ru>
parents:
14854
diff
changeset
|
509 |
add text without trailing newline |
f33579435378
eol: fix missing trailing newlines in comitted files
Stepan Koltsov <stepancheg@yandex-team.ru>
parents:
14854
diff
changeset
|
510 |
|
f33579435378
eol: fix missing trailing newlines in comitted files
Stepan Koltsov <stepancheg@yandex-team.ru>
parents:
14854
diff
changeset
|
511 |
$ printf "first\nsecond" > a.txt |
f33579435378
eol: fix missing trailing newlines in comitted files
Stepan Koltsov <stepancheg@yandex-team.ru>
parents:
14854
diff
changeset
|
512 |
$ hg commit --addremove -m 'checking in' |
f33579435378
eol: fix missing trailing newlines in comitted files
Stepan Koltsov <stepancheg@yandex-team.ru>
parents:
14854
diff
changeset
|
513 |
adding .hgeol |
f33579435378
eol: fix missing trailing newlines in comitted files
Stepan Koltsov <stepancheg@yandex-team.ru>
parents:
14854
diff
changeset
|
514 |
adding a.txt |
f33579435378
eol: fix missing trailing newlines in comitted files
Stepan Koltsov <stepancheg@yandex-team.ru>
parents:
14854
diff
changeset
|
515 |
$ rm a.txt |
f33579435378
eol: fix missing trailing newlines in comitted files
Stepan Koltsov <stepancheg@yandex-team.ru>
parents:
14854
diff
changeset
|
516 |
$ hg update -C -q |
f33579435378
eol: fix missing trailing newlines in comitted files
Stepan Koltsov <stepancheg@yandex-team.ru>
parents:
14854
diff
changeset
|
517 |
$ cat a.txt |
f33579435378
eol: fix missing trailing newlines in comitted files
Stepan Koltsov <stepancheg@yandex-team.ru>
parents:
14854
diff
changeset
|
518 |
first |
f33579435378
eol: fix missing trailing newlines in comitted files
Stepan Koltsov <stepancheg@yandex-team.ru>
parents:
14854
diff
changeset
|
519 |
second (no-eol) |
f33579435378
eol: fix missing trailing newlines in comitted files
Stepan Koltsov <stepancheg@yandex-team.ru>
parents:
14854
diff
changeset
|
520 |
|
f33579435378
eol: fix missing trailing newlines in comitted files
Stepan Koltsov <stepancheg@yandex-team.ru>
parents:
14854
diff
changeset
|
521 |
$ cat > .hgeol <<EOF |
f33579435378
eol: fix missing trailing newlines in comitted files
Stepan Koltsov <stepancheg@yandex-team.ru>
parents:
14854
diff
changeset
|
522 |
> [patterns] |
f33579435378
eol: fix missing trailing newlines in comitted files
Stepan Koltsov <stepancheg@yandex-team.ru>
parents:
14854
diff
changeset
|
523 |
> **.txt = native |
f33579435378
eol: fix missing trailing newlines in comitted files
Stepan Koltsov <stepancheg@yandex-team.ru>
parents:
14854
diff
changeset
|
524 |
> [eol] |
f33579435378
eol: fix missing trailing newlines in comitted files
Stepan Koltsov <stepancheg@yandex-team.ru>
parents:
14854
diff
changeset
|
525 |
> fix-trailing-newline = True |
f33579435378
eol: fix missing trailing newlines in comitted files
Stepan Koltsov <stepancheg@yandex-team.ru>
parents:
14854
diff
changeset
|
526 |
> EOF |
f33579435378
eol: fix missing trailing newlines in comitted files
Stepan Koltsov <stepancheg@yandex-team.ru>
parents:
14854
diff
changeset
|
527 |
$ printf "third\nfourth" > a.txt |
f33579435378
eol: fix missing trailing newlines in comitted files
Stepan Koltsov <stepancheg@yandex-team.ru>
parents:
14854
diff
changeset
|
528 |
$ hg commit -m 'checking in with newline fix' |
f33579435378
eol: fix missing trailing newlines in comitted files
Stepan Koltsov <stepancheg@yandex-team.ru>
parents:
14854
diff
changeset
|
529 |
$ rm a.txt |
f33579435378
eol: fix missing trailing newlines in comitted files
Stepan Koltsov <stepancheg@yandex-team.ru>
parents:
14854
diff
changeset
|
530 |
$ hg update -C -q |
f33579435378
eol: fix missing trailing newlines in comitted files
Stepan Koltsov <stepancheg@yandex-team.ru>
parents:
14854
diff
changeset
|
531 |
$ cat a.txt |
f33579435378
eol: fix missing trailing newlines in comitted files
Stepan Koltsov <stepancheg@yandex-team.ru>
parents:
14854
diff
changeset
|
532 |
third |
f33579435378
eol: fix missing trailing newlines in comitted files
Stepan Koltsov <stepancheg@yandex-team.ru>
parents:
14854
diff
changeset
|
533 |
fourth |
f33579435378
eol: fix missing trailing newlines in comitted files
Stepan Koltsov <stepancheg@yandex-team.ru>
parents:
14854
diff
changeset
|
534 |
|
f33579435378
eol: fix missing trailing newlines in comitted files
Stepan Koltsov <stepancheg@yandex-team.ru>
parents:
14854
diff
changeset
|
535 |
append a line without trailing newline |
f33579435378
eol: fix missing trailing newlines in comitted files
Stepan Koltsov <stepancheg@yandex-team.ru>
parents:
14854
diff
changeset
|
536 |
|
f33579435378
eol: fix missing trailing newlines in comitted files
Stepan Koltsov <stepancheg@yandex-team.ru>
parents:
14854
diff
changeset
|
537 |
$ printf "fifth" >> a.txt |
f33579435378
eol: fix missing trailing newlines in comitted files
Stepan Koltsov <stepancheg@yandex-team.ru>
parents:
14854
diff
changeset
|
538 |
$ hg commit -m 'adding another line line' |
f33579435378
eol: fix missing trailing newlines in comitted files
Stepan Koltsov <stepancheg@yandex-team.ru>
parents:
14854
diff
changeset
|
539 |
$ rm a.txt |
f33579435378
eol: fix missing trailing newlines in comitted files
Stepan Koltsov <stepancheg@yandex-team.ru>
parents:
14854
diff
changeset
|
540 |
$ hg update -C -q |
f33579435378
eol: fix missing trailing newlines in comitted files
Stepan Koltsov <stepancheg@yandex-team.ru>
parents:
14854
diff
changeset
|
541 |
$ cat a.txt |
f33579435378
eol: fix missing trailing newlines in comitted files
Stepan Koltsov <stepancheg@yandex-team.ru>
parents:
14854
diff
changeset
|
542 |
third |
f33579435378
eol: fix missing trailing newlines in comitted files
Stepan Koltsov <stepancheg@yandex-team.ru>
parents:
14854
diff
changeset
|
543 |
fourth |
f33579435378
eol: fix missing trailing newlines in comitted files
Stepan Koltsov <stepancheg@yandex-team.ru>
parents:
14854
diff
changeset
|
544 |
fifth |
f33579435378
eol: fix missing trailing newlines in comitted files
Stepan Koltsov <stepancheg@yandex-team.ru>
parents:
14854
diff
changeset
|
545 |
|
23068
fb3e63c603e8
eol: fix crash when handling removed files
Mads Kiilerich <madski@unity3d.com>
parents:
16986
diff
changeset
|
546 |
amend of changesets with renamed/deleted files expose new code paths |
fb3e63c603e8
eol: fix crash when handling removed files
Mads Kiilerich <madski@unity3d.com>
parents:
16986
diff
changeset
|
547 |
|
fb3e63c603e8
eol: fix crash when handling removed files
Mads Kiilerich <madski@unity3d.com>
parents:
16986
diff
changeset
|
548 |
$ hg mv a.txt b.txt |
fb3e63c603e8
eol: fix crash when handling removed files
Mads Kiilerich <madski@unity3d.com>
parents:
16986
diff
changeset
|
549 |
$ hg ci --amend -q |
fb3e63c603e8
eol: fix crash when handling removed files
Mads Kiilerich <madski@unity3d.com>
parents:
16986
diff
changeset
|
550 |
$ hg diff -c. |
fb3e63c603e8
eol: fix crash when handling removed files
Mads Kiilerich <madski@unity3d.com>
parents:
16986
diff
changeset
|
551 |
diff --git a/a.txt b/b.txt |
fb3e63c603e8
eol: fix crash when handling removed files
Mads Kiilerich <madski@unity3d.com>
parents:
16986
diff
changeset
|
552 |
rename from a.txt |
fb3e63c603e8
eol: fix crash when handling removed files
Mads Kiilerich <madski@unity3d.com>
parents:
16986
diff
changeset
|
553 |
rename to b.txt |
fb3e63c603e8
eol: fix crash when handling removed files
Mads Kiilerich <madski@unity3d.com>
parents:
16986
diff
changeset
|
554 |
--- a/a.txt |
fb3e63c603e8
eol: fix crash when handling removed files
Mads Kiilerich <madski@unity3d.com>
parents:
16986
diff
changeset
|
555 |
+++ b/b.txt |
fb3e63c603e8
eol: fix crash when handling removed files
Mads Kiilerich <madski@unity3d.com>
parents:
16986
diff
changeset
|
556 |
@@ -1,2 +1,3 @@ |
fb3e63c603e8
eol: fix crash when handling removed files
Mads Kiilerich <madski@unity3d.com>
parents:
16986
diff
changeset
|
557 |
third |
fb3e63c603e8
eol: fix crash when handling removed files
Mads Kiilerich <madski@unity3d.com>
parents:
16986
diff
changeset
|
558 |
fourth |
fb3e63c603e8
eol: fix crash when handling removed files
Mads Kiilerich <madski@unity3d.com>
parents:
16986
diff
changeset
|
559 |
+fifth |
fb3e63c603e8
eol: fix crash when handling removed files
Mads Kiilerich <madski@unity3d.com>
parents:
16986
diff
changeset
|
560 |
|
16913
f2719b387380
tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents:
15443
diff
changeset
|
561 |
$ cd .. |