##// END OF EJS Templates
tests: use $PYTHON in #! so we always use the right Python
Augie Fackler -
r32938:b6776b34 default
parent child Browse files
Show More
@@ -1,661 +1,661 b''
1 $ hg init
1 $ hg init
2
2
3
3
4 committing changes
4 committing changes
5
5
6 $ count=0
6 $ count=0
7 $ echo > a
7 $ echo > a
8 $ while test $count -lt 32 ; do
8 $ while test $count -lt 32 ; do
9 > echo 'a' >> a
9 > echo 'a' >> a
10 > test $count -eq 0 && hg add
10 > test $count -eq 0 && hg add
11 > hg ci -m "msg $count" -d "$count 0"
11 > hg ci -m "msg $count" -d "$count 0"
12 > count=`expr $count + 1`
12 > count=`expr $count + 1`
13 > done
13 > done
14 adding a
14 adding a
15
15
16
16
17 $ hg log
17 $ hg log
18 changeset: 31:58c80a7c8a40
18 changeset: 31:58c80a7c8a40
19 tag: tip
19 tag: tip
20 user: test
20 user: test
21 date: Thu Jan 01 00:00:31 1970 +0000
21 date: Thu Jan 01 00:00:31 1970 +0000
22 summary: msg 31
22 summary: msg 31
23
23
24 changeset: 30:ed2d2f24b11c
24 changeset: 30:ed2d2f24b11c
25 user: test
25 user: test
26 date: Thu Jan 01 00:00:30 1970 +0000
26 date: Thu Jan 01 00:00:30 1970 +0000
27 summary: msg 30
27 summary: msg 30
28
28
29 changeset: 29:b5bd63375ab9
29 changeset: 29:b5bd63375ab9
30 user: test
30 user: test
31 date: Thu Jan 01 00:00:29 1970 +0000
31 date: Thu Jan 01 00:00:29 1970 +0000
32 summary: msg 29
32 summary: msg 29
33
33
34 changeset: 28:8e0c2264c8af
34 changeset: 28:8e0c2264c8af
35 user: test
35 user: test
36 date: Thu Jan 01 00:00:28 1970 +0000
36 date: Thu Jan 01 00:00:28 1970 +0000
37 summary: msg 28
37 summary: msg 28
38
38
39 changeset: 27:288867a866e9
39 changeset: 27:288867a866e9
40 user: test
40 user: test
41 date: Thu Jan 01 00:00:27 1970 +0000
41 date: Thu Jan 01 00:00:27 1970 +0000
42 summary: msg 27
42 summary: msg 27
43
43
44 changeset: 26:3efc6fd51aeb
44 changeset: 26:3efc6fd51aeb
45 user: test
45 user: test
46 date: Thu Jan 01 00:00:26 1970 +0000
46 date: Thu Jan 01 00:00:26 1970 +0000
47 summary: msg 26
47 summary: msg 26
48
48
49 changeset: 25:02a84173a97a
49 changeset: 25:02a84173a97a
50 user: test
50 user: test
51 date: Thu Jan 01 00:00:25 1970 +0000
51 date: Thu Jan 01 00:00:25 1970 +0000
52 summary: msg 25
52 summary: msg 25
53
53
54 changeset: 24:10e0acd3809e
54 changeset: 24:10e0acd3809e
55 user: test
55 user: test
56 date: Thu Jan 01 00:00:24 1970 +0000
56 date: Thu Jan 01 00:00:24 1970 +0000
57 summary: msg 24
57 summary: msg 24
58
58
59 changeset: 23:5ec79163bff4
59 changeset: 23:5ec79163bff4
60 user: test
60 user: test
61 date: Thu Jan 01 00:00:23 1970 +0000
61 date: Thu Jan 01 00:00:23 1970 +0000
62 summary: msg 23
62 summary: msg 23
63
63
64 changeset: 22:06c7993750ce
64 changeset: 22:06c7993750ce
65 user: test
65 user: test
66 date: Thu Jan 01 00:00:22 1970 +0000
66 date: Thu Jan 01 00:00:22 1970 +0000
67 summary: msg 22
67 summary: msg 22
68
68
69 changeset: 21:e5db6aa3fe2a
69 changeset: 21:e5db6aa3fe2a
70 user: test
70 user: test
71 date: Thu Jan 01 00:00:21 1970 +0000
71 date: Thu Jan 01 00:00:21 1970 +0000
72 summary: msg 21
72 summary: msg 21
73
73
74 changeset: 20:7128fb4fdbc9
74 changeset: 20:7128fb4fdbc9
75 user: test
75 user: test
76 date: Thu Jan 01 00:00:20 1970 +0000
76 date: Thu Jan 01 00:00:20 1970 +0000
77 summary: msg 20
77 summary: msg 20
78
78
79 changeset: 19:52798545b482
79 changeset: 19:52798545b482
80 user: test
80 user: test
81 date: Thu Jan 01 00:00:19 1970 +0000
81 date: Thu Jan 01 00:00:19 1970 +0000
82 summary: msg 19
82 summary: msg 19
83
83
84 changeset: 18:86977a90077e
84 changeset: 18:86977a90077e
85 user: test
85 user: test
86 date: Thu Jan 01 00:00:18 1970 +0000
86 date: Thu Jan 01 00:00:18 1970 +0000
87 summary: msg 18
87 summary: msg 18
88
88
89 changeset: 17:03515f4a9080
89 changeset: 17:03515f4a9080
90 user: test
90 user: test
91 date: Thu Jan 01 00:00:17 1970 +0000
91 date: Thu Jan 01 00:00:17 1970 +0000
92 summary: msg 17
92 summary: msg 17
93
93
94 changeset: 16:a2e6ea4973e9
94 changeset: 16:a2e6ea4973e9
95 user: test
95 user: test
96 date: Thu Jan 01 00:00:16 1970 +0000
96 date: Thu Jan 01 00:00:16 1970 +0000
97 summary: msg 16
97 summary: msg 16
98
98
99 changeset: 15:e7fa0811edb0
99 changeset: 15:e7fa0811edb0
100 user: test
100 user: test
101 date: Thu Jan 01 00:00:15 1970 +0000
101 date: Thu Jan 01 00:00:15 1970 +0000
102 summary: msg 15
102 summary: msg 15
103
103
104 changeset: 14:ce8f0998e922
104 changeset: 14:ce8f0998e922
105 user: test
105 user: test
106 date: Thu Jan 01 00:00:14 1970 +0000
106 date: Thu Jan 01 00:00:14 1970 +0000
107 summary: msg 14
107 summary: msg 14
108
108
109 changeset: 13:9d7d07bc967c
109 changeset: 13:9d7d07bc967c
110 user: test
110 user: test
111 date: Thu Jan 01 00:00:13 1970 +0000
111 date: Thu Jan 01 00:00:13 1970 +0000
112 summary: msg 13
112 summary: msg 13
113
113
114 changeset: 12:1941b52820a5
114 changeset: 12:1941b52820a5
115 user: test
115 user: test
116 date: Thu Jan 01 00:00:12 1970 +0000
116 date: Thu Jan 01 00:00:12 1970 +0000
117 summary: msg 12
117 summary: msg 12
118
118
119 changeset: 11:7b4cd9578619
119 changeset: 11:7b4cd9578619
120 user: test
120 user: test
121 date: Thu Jan 01 00:00:11 1970 +0000
121 date: Thu Jan 01 00:00:11 1970 +0000
122 summary: msg 11
122 summary: msg 11
123
123
124 changeset: 10:7c5eff49a6b6
124 changeset: 10:7c5eff49a6b6
125 user: test
125 user: test
126 date: Thu Jan 01 00:00:10 1970 +0000
126 date: Thu Jan 01 00:00:10 1970 +0000
127 summary: msg 10
127 summary: msg 10
128
128
129 changeset: 9:eb44510ef29a
129 changeset: 9:eb44510ef29a
130 user: test
130 user: test
131 date: Thu Jan 01 00:00:09 1970 +0000
131 date: Thu Jan 01 00:00:09 1970 +0000
132 summary: msg 9
132 summary: msg 9
133
133
134 changeset: 8:453eb4dba229
134 changeset: 8:453eb4dba229
135 user: test
135 user: test
136 date: Thu Jan 01 00:00:08 1970 +0000
136 date: Thu Jan 01 00:00:08 1970 +0000
137 summary: msg 8
137 summary: msg 8
138
138
139 changeset: 7:03750880c6b5
139 changeset: 7:03750880c6b5
140 user: test
140 user: test
141 date: Thu Jan 01 00:00:07 1970 +0000
141 date: Thu Jan 01 00:00:07 1970 +0000
142 summary: msg 7
142 summary: msg 7
143
143
144 changeset: 6:a3d5c6fdf0d3
144 changeset: 6:a3d5c6fdf0d3
145 user: test
145 user: test
146 date: Thu Jan 01 00:00:06 1970 +0000
146 date: Thu Jan 01 00:00:06 1970 +0000
147 summary: msg 6
147 summary: msg 6
148
148
149 changeset: 5:7874a09ea728
149 changeset: 5:7874a09ea728
150 user: test
150 user: test
151 date: Thu Jan 01 00:00:05 1970 +0000
151 date: Thu Jan 01 00:00:05 1970 +0000
152 summary: msg 5
152 summary: msg 5
153
153
154 changeset: 4:9b2ba8336a65
154 changeset: 4:9b2ba8336a65
155 user: test
155 user: test
156 date: Thu Jan 01 00:00:04 1970 +0000
156 date: Thu Jan 01 00:00:04 1970 +0000
157 summary: msg 4
157 summary: msg 4
158
158
159 changeset: 3:b53bea5e2fcb
159 changeset: 3:b53bea5e2fcb
160 user: test
160 user: test
161 date: Thu Jan 01 00:00:03 1970 +0000
161 date: Thu Jan 01 00:00:03 1970 +0000
162 summary: msg 3
162 summary: msg 3
163
163
164 changeset: 2:db07c04beaca
164 changeset: 2:db07c04beaca
165 user: test
165 user: test
166 date: Thu Jan 01 00:00:02 1970 +0000
166 date: Thu Jan 01 00:00:02 1970 +0000
167 summary: msg 2
167 summary: msg 2
168
168
169 changeset: 1:5cd978ea5149
169 changeset: 1:5cd978ea5149
170 user: test
170 user: test
171 date: Thu Jan 01 00:00:01 1970 +0000
171 date: Thu Jan 01 00:00:01 1970 +0000
172 summary: msg 1
172 summary: msg 1
173
173
174 changeset: 0:b99c7b9c8e11
174 changeset: 0:b99c7b9c8e11
175 user: test
175 user: test
176 date: Thu Jan 01 00:00:00 1970 +0000
176 date: Thu Jan 01 00:00:00 1970 +0000
177 summary: msg 0
177 summary: msg 0
178
178
179
179
180 $ hg up -C
180 $ hg up -C
181 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
181 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
182
182
183 bisect test
183 bisect test
184
184
185 $ hg bisect -r
185 $ hg bisect -r
186 $ hg bisect -b
186 $ hg bisect -b
187 $ hg summary
187 $ hg summary
188 parent: 31:58c80a7c8a40 tip
188 parent: 31:58c80a7c8a40 tip
189 msg 31
189 msg 31
190 branch: default
190 branch: default
191 commit: (clean)
191 commit: (clean)
192 update: (current)
192 update: (current)
193 phases: 32 draft
193 phases: 32 draft
194 $ hg bisect -g 1
194 $ hg bisect -g 1
195 Testing changeset 16:a2e6ea4973e9 (30 changesets remaining, ~4 tests)
195 Testing changeset 16:a2e6ea4973e9 (30 changesets remaining, ~4 tests)
196 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
196 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
197 $ hg bisect -g
197 $ hg bisect -g
198 Testing changeset 23:5ec79163bff4 (15 changesets remaining, ~3 tests)
198 Testing changeset 23:5ec79163bff4 (15 changesets remaining, ~3 tests)
199 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
199 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
200
200
201 skip
201 skip
202
202
203 $ hg bisect -s
203 $ hg bisect -s
204 Testing changeset 24:10e0acd3809e (15 changesets remaining, ~3 tests)
204 Testing changeset 24:10e0acd3809e (15 changesets remaining, ~3 tests)
205 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
205 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
206 $ hg bisect -g
206 $ hg bisect -g
207 Testing changeset 27:288867a866e9 (7 changesets remaining, ~2 tests)
207 Testing changeset 27:288867a866e9 (7 changesets remaining, ~2 tests)
208 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
208 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
209 $ hg bisect -g
209 $ hg bisect -g
210 Testing changeset 29:b5bd63375ab9 (4 changesets remaining, ~2 tests)
210 Testing changeset 29:b5bd63375ab9 (4 changesets remaining, ~2 tests)
211 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
211 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
212 $ hg bisect -b
212 $ hg bisect -b
213 Testing changeset 28:8e0c2264c8af (2 changesets remaining, ~1 tests)
213 Testing changeset 28:8e0c2264c8af (2 changesets remaining, ~1 tests)
214 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
214 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
215 $ hg bisect -g
215 $ hg bisect -g
216 The first bad revision is:
216 The first bad revision is:
217 changeset: 29:b5bd63375ab9
217 changeset: 29:b5bd63375ab9
218 user: test
218 user: test
219 date: Thu Jan 01 00:00:29 1970 +0000
219 date: Thu Jan 01 00:00:29 1970 +0000
220 summary: msg 29
220 summary: msg 29
221
221
222
222
223 mark revsets instead of single revs
223 mark revsets instead of single revs
224
224
225 $ hg bisect -r
225 $ hg bisect -r
226 $ hg bisect -b "0::3"
226 $ hg bisect -b "0::3"
227 $ hg bisect -s "13::16"
227 $ hg bisect -s "13::16"
228 $ hg bisect -g "26::tip"
228 $ hg bisect -g "26::tip"
229 Testing changeset 12:1941b52820a5 (23 changesets remaining, ~4 tests)
229 Testing changeset 12:1941b52820a5 (23 changesets remaining, ~4 tests)
230 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
230 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
231 $ cat .hg/bisect.state
231 $ cat .hg/bisect.state
232 bad b99c7b9c8e11558adef3fad9af211c58d46f325b
232 bad b99c7b9c8e11558adef3fad9af211c58d46f325b
233 bad 5cd978ea51499179507ee7b6f340d2dbaa401185
233 bad 5cd978ea51499179507ee7b6f340d2dbaa401185
234 bad db07c04beaca44cf24832541e7f4a2346a95275b
234 bad db07c04beaca44cf24832541e7f4a2346a95275b
235 bad b53bea5e2fcb30d3e00bd3409507a5659ce0fd8b
235 bad b53bea5e2fcb30d3e00bd3409507a5659ce0fd8b
236 current 1941b52820a544549596820a8ae006842b0e2c64
236 current 1941b52820a544549596820a8ae006842b0e2c64
237 good 3efc6fd51aeb8594398044c6c846ca59ae021203
237 good 3efc6fd51aeb8594398044c6c846ca59ae021203
238 good 288867a866e9adb7a29880b66936c874b80f4651
238 good 288867a866e9adb7a29880b66936c874b80f4651
239 good 8e0c2264c8af790daf3585ada0669d93dee09c83
239 good 8e0c2264c8af790daf3585ada0669d93dee09c83
240 good b5bd63375ab9a290419f2024b7f4ee9ea7ce90a8
240 good b5bd63375ab9a290419f2024b7f4ee9ea7ce90a8
241 good ed2d2f24b11c368fa8aa0da9f4e1db580abade59
241 good ed2d2f24b11c368fa8aa0da9f4e1db580abade59
242 good 58c80a7c8a4025a94cedaf7b4a4e3124e8909a96
242 good 58c80a7c8a4025a94cedaf7b4a4e3124e8909a96
243 skip 9d7d07bc967ca98ad0600c24953fd289ad5fa991
243 skip 9d7d07bc967ca98ad0600c24953fd289ad5fa991
244 skip ce8f0998e922c179e80819d5066fbe46e2998784
244 skip ce8f0998e922c179e80819d5066fbe46e2998784
245 skip e7fa0811edb063f6319531f0d0a865882138e180
245 skip e7fa0811edb063f6319531f0d0a865882138e180
246 skip a2e6ea4973e9196ddd3386493b0c214b41fd97d3
246 skip a2e6ea4973e9196ddd3386493b0c214b41fd97d3
247
247
248 bisect reverse test
248 bisect reverse test
249
249
250 $ hg bisect -r
250 $ hg bisect -r
251 $ hg bisect -b null
251 $ hg bisect -b null
252 $ hg bisect -g tip
252 $ hg bisect -g tip
253 Testing changeset 15:e7fa0811edb0 (32 changesets remaining, ~5 tests)
253 Testing changeset 15:e7fa0811edb0 (32 changesets remaining, ~5 tests)
254 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
254 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
255 $ hg bisect -g
255 $ hg bisect -g
256 Testing changeset 7:03750880c6b5 (16 changesets remaining, ~4 tests)
256 Testing changeset 7:03750880c6b5 (16 changesets remaining, ~4 tests)
257 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
257 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
258
258
259 skip
259 skip
260
260
261 $ hg bisect -s
261 $ hg bisect -s
262 Testing changeset 6:a3d5c6fdf0d3 (16 changesets remaining, ~4 tests)
262 Testing changeset 6:a3d5c6fdf0d3 (16 changesets remaining, ~4 tests)
263 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
263 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
264 $ hg bisect -g
264 $ hg bisect -g
265 Testing changeset 2:db07c04beaca (7 changesets remaining, ~2 tests)
265 Testing changeset 2:db07c04beaca (7 changesets remaining, ~2 tests)
266 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
266 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
267 $ hg bisect -g
267 $ hg bisect -g
268 Testing changeset 0:b99c7b9c8e11 (3 changesets remaining, ~1 tests)
268 Testing changeset 0:b99c7b9c8e11 (3 changesets remaining, ~1 tests)
269 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
269 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
270 $ hg bisect -b
270 $ hg bisect -b
271 Testing changeset 1:5cd978ea5149 (2 changesets remaining, ~1 tests)
271 Testing changeset 1:5cd978ea5149 (2 changesets remaining, ~1 tests)
272 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
272 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
273 $ hg bisect -g
273 $ hg bisect -g
274 The first good revision is:
274 The first good revision is:
275 changeset: 1:5cd978ea5149
275 changeset: 1:5cd978ea5149
276 user: test
276 user: test
277 date: Thu Jan 01 00:00:01 1970 +0000
277 date: Thu Jan 01 00:00:01 1970 +0000
278 summary: msg 1
278 summary: msg 1
279
279
280
280
281 $ hg bisect -r
281 $ hg bisect -r
282 $ hg bisect -g tip
282 $ hg bisect -g tip
283 $ hg bisect -b tip
283 $ hg bisect -b tip
284 abort: inconsistent state, 31:58c80a7c8a40 is good and bad
284 abort: inconsistent state, 31:58c80a7c8a40 is good and bad
285 [255]
285 [255]
286
286
287 $ hg bisect -r
287 $ hg bisect -r
288 $ hg bisect -g null
288 $ hg bisect -g null
289 $ hg bisect -bU tip
289 $ hg bisect -bU tip
290 Testing changeset 15:e7fa0811edb0 (32 changesets remaining, ~5 tests)
290 Testing changeset 15:e7fa0811edb0 (32 changesets remaining, ~5 tests)
291 $ hg id
291 $ hg id
292 5cd978ea5149
292 5cd978ea5149
293
293
294
294
295 Issue1228: hg bisect crashes when you skip the last rev in bisection
295 Issue1228: hg bisect crashes when you skip the last rev in bisection
296 Issue1182: hg bisect exception
296 Issue1182: hg bisect exception
297
297
298 $ hg bisect -r
298 $ hg bisect -r
299 $ hg bisect -b 4
299 $ hg bisect -b 4
300 $ hg bisect -g 0
300 $ hg bisect -g 0
301 Testing changeset 2:db07c04beaca (4 changesets remaining, ~2 tests)
301 Testing changeset 2:db07c04beaca (4 changesets remaining, ~2 tests)
302 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
302 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
303 $ hg bisect -s
303 $ hg bisect -s
304 Testing changeset 1:5cd978ea5149 (4 changesets remaining, ~2 tests)
304 Testing changeset 1:5cd978ea5149 (4 changesets remaining, ~2 tests)
305 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
305 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
306 $ hg bisect -s
306 $ hg bisect -s
307 Testing changeset 3:b53bea5e2fcb (4 changesets remaining, ~2 tests)
307 Testing changeset 3:b53bea5e2fcb (4 changesets remaining, ~2 tests)
308 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
308 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
309 $ hg bisect -s
309 $ hg bisect -s
310 Due to skipped revisions, the first bad revision could be any of:
310 Due to skipped revisions, the first bad revision could be any of:
311 changeset: 1:5cd978ea5149
311 changeset: 1:5cd978ea5149
312 user: test
312 user: test
313 date: Thu Jan 01 00:00:01 1970 +0000
313 date: Thu Jan 01 00:00:01 1970 +0000
314 summary: msg 1
314 summary: msg 1
315
315
316 changeset: 2:db07c04beaca
316 changeset: 2:db07c04beaca
317 user: test
317 user: test
318 date: Thu Jan 01 00:00:02 1970 +0000
318 date: Thu Jan 01 00:00:02 1970 +0000
319 summary: msg 2
319 summary: msg 2
320
320
321 changeset: 3:b53bea5e2fcb
321 changeset: 3:b53bea5e2fcb
322 user: test
322 user: test
323 date: Thu Jan 01 00:00:03 1970 +0000
323 date: Thu Jan 01 00:00:03 1970 +0000
324 summary: msg 3
324 summary: msg 3
325
325
326 changeset: 4:9b2ba8336a65
326 changeset: 4:9b2ba8336a65
327 user: test
327 user: test
328 date: Thu Jan 01 00:00:04 1970 +0000
328 date: Thu Jan 01 00:00:04 1970 +0000
329 summary: msg 4
329 summary: msg 4
330
330
331
331
332
332
333 reproduce non converging bisect, issue1182
333 reproduce non converging bisect, issue1182
334
334
335 $ hg bisect -r
335 $ hg bisect -r
336 $ hg bisect -g 0
336 $ hg bisect -g 0
337 $ hg bisect -b 2
337 $ hg bisect -b 2
338 Testing changeset 1:5cd978ea5149 (2 changesets remaining, ~1 tests)
338 Testing changeset 1:5cd978ea5149 (2 changesets remaining, ~1 tests)
339 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
339 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
340 $ hg bisect -s
340 $ hg bisect -s
341 Due to skipped revisions, the first bad revision could be any of:
341 Due to skipped revisions, the first bad revision could be any of:
342 changeset: 1:5cd978ea5149
342 changeset: 1:5cd978ea5149
343 user: test
343 user: test
344 date: Thu Jan 01 00:00:01 1970 +0000
344 date: Thu Jan 01 00:00:01 1970 +0000
345 summary: msg 1
345 summary: msg 1
346
346
347 changeset: 2:db07c04beaca
347 changeset: 2:db07c04beaca
348 user: test
348 user: test
349 date: Thu Jan 01 00:00:02 1970 +0000
349 date: Thu Jan 01 00:00:02 1970 +0000
350 summary: msg 2
350 summary: msg 2
351
351
352
352
353
353
354 test no action
354 test no action
355
355
356 $ hg bisect -r
356 $ hg bisect -r
357 $ hg bisect
357 $ hg bisect
358 abort: cannot bisect (no known good revisions)
358 abort: cannot bisect (no known good revisions)
359 [255]
359 [255]
360
360
361
361
362 reproduce AssertionError, issue1445
362 reproduce AssertionError, issue1445
363
363
364 $ hg bisect -r
364 $ hg bisect -r
365 $ hg bisect -b 6
365 $ hg bisect -b 6
366 $ hg bisect -g 0
366 $ hg bisect -g 0
367 Testing changeset 3:b53bea5e2fcb (6 changesets remaining, ~2 tests)
367 Testing changeset 3:b53bea5e2fcb (6 changesets remaining, ~2 tests)
368 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
368 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
369 $ hg bisect -s
369 $ hg bisect -s
370 Testing changeset 2:db07c04beaca (6 changesets remaining, ~2 tests)
370 Testing changeset 2:db07c04beaca (6 changesets remaining, ~2 tests)
371 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
371 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
372 $ hg bisect -s
372 $ hg bisect -s
373 Testing changeset 4:9b2ba8336a65 (6 changesets remaining, ~2 tests)
373 Testing changeset 4:9b2ba8336a65 (6 changesets remaining, ~2 tests)
374 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
374 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
375 $ hg bisect -s
375 $ hg bisect -s
376 Testing changeset 1:5cd978ea5149 (6 changesets remaining, ~2 tests)
376 Testing changeset 1:5cd978ea5149 (6 changesets remaining, ~2 tests)
377 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
377 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
378 $ hg bisect -s
378 $ hg bisect -s
379 Testing changeset 5:7874a09ea728 (6 changesets remaining, ~2 tests)
379 Testing changeset 5:7874a09ea728 (6 changesets remaining, ~2 tests)
380 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
380 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
381 $ hg bisect -g
381 $ hg bisect -g
382 The first bad revision is:
382 The first bad revision is:
383 changeset: 6:a3d5c6fdf0d3
383 changeset: 6:a3d5c6fdf0d3
384 user: test
384 user: test
385 date: Thu Jan 01 00:00:06 1970 +0000
385 date: Thu Jan 01 00:00:06 1970 +0000
386 summary: msg 6
386 summary: msg 6
387
387
388 $ hg log -r "bisect(good)"
388 $ hg log -r "bisect(good)"
389 changeset: 0:b99c7b9c8e11
389 changeset: 0:b99c7b9c8e11
390 user: test
390 user: test
391 date: Thu Jan 01 00:00:00 1970 +0000
391 date: Thu Jan 01 00:00:00 1970 +0000
392 summary: msg 0
392 summary: msg 0
393
393
394 changeset: 5:7874a09ea728
394 changeset: 5:7874a09ea728
395 user: test
395 user: test
396 date: Thu Jan 01 00:00:05 1970 +0000
396 date: Thu Jan 01 00:00:05 1970 +0000
397 summary: msg 5
397 summary: msg 5
398
398
399 $ hg log -r "bisect(bad)"
399 $ hg log -r "bisect(bad)"
400 changeset: 6:a3d5c6fdf0d3
400 changeset: 6:a3d5c6fdf0d3
401 user: test
401 user: test
402 date: Thu Jan 01 00:00:06 1970 +0000
402 date: Thu Jan 01 00:00:06 1970 +0000
403 summary: msg 6
403 summary: msg 6
404
404
405 $ hg log -r "bisect(current)"
405 $ hg log -r "bisect(current)"
406 changeset: 5:7874a09ea728
406 changeset: 5:7874a09ea728
407 user: test
407 user: test
408 date: Thu Jan 01 00:00:05 1970 +0000
408 date: Thu Jan 01 00:00:05 1970 +0000
409 summary: msg 5
409 summary: msg 5
410
410
411 $ hg log -r "bisect(skip)"
411 $ hg log -r "bisect(skip)"
412 changeset: 1:5cd978ea5149
412 changeset: 1:5cd978ea5149
413 user: test
413 user: test
414 date: Thu Jan 01 00:00:01 1970 +0000
414 date: Thu Jan 01 00:00:01 1970 +0000
415 summary: msg 1
415 summary: msg 1
416
416
417 changeset: 2:db07c04beaca
417 changeset: 2:db07c04beaca
418 user: test
418 user: test
419 date: Thu Jan 01 00:00:02 1970 +0000
419 date: Thu Jan 01 00:00:02 1970 +0000
420 summary: msg 2
420 summary: msg 2
421
421
422 changeset: 3:b53bea5e2fcb
422 changeset: 3:b53bea5e2fcb
423 user: test
423 user: test
424 date: Thu Jan 01 00:00:03 1970 +0000
424 date: Thu Jan 01 00:00:03 1970 +0000
425 summary: msg 3
425 summary: msg 3
426
426
427 changeset: 4:9b2ba8336a65
427 changeset: 4:9b2ba8336a65
428 user: test
428 user: test
429 date: Thu Jan 01 00:00:04 1970 +0000
429 date: Thu Jan 01 00:00:04 1970 +0000
430 summary: msg 4
430 summary: msg 4
431
431
432
432
433 test legacy bisected() keyword
433 test legacy bisected() keyword
434
434
435 $ hg log -r "bisected(bad)"
435 $ hg log -r "bisected(bad)"
436 changeset: 6:a3d5c6fdf0d3
436 changeset: 6:a3d5c6fdf0d3
437 user: test
437 user: test
438 date: Thu Jan 01 00:00:06 1970 +0000
438 date: Thu Jan 01 00:00:06 1970 +0000
439 summary: msg 6
439 summary: msg 6
440
440
441
441
442 $ set +e
442 $ set +e
443
443
444 test invalid command
444 test invalid command
445 assuming that the shell returns 127 if command not found ...
445 assuming that the shell returns 127 if command not found ...
446
446
447 $ hg bisect -r
447 $ hg bisect -r
448 $ hg bisect --command 'exit 127'
448 $ hg bisect --command 'exit 127'
449 abort: failed to execute exit 127
449 abort: failed to execute exit 127
450 [255]
450 [255]
451
451
452
452
453 test bisecting command
453 test bisecting command
454
454
455 $ cat > script.py <<EOF
455 $ cat > script.py <<EOF
456 > #!/usr/bin/env python
456 > #!$PYTHON
457 > import sys
457 > import sys
458 > from mercurial import ui, hg
458 > from mercurial import ui, hg
459 > repo = hg.repository(ui.ui.load(), '.')
459 > repo = hg.repository(ui.ui.load(), '.')
460 > if repo['.'].rev() < 6:
460 > if repo['.'].rev() < 6:
461 > sys.exit(1)
461 > sys.exit(1)
462 > EOF
462 > EOF
463 $ chmod +x script.py
463 $ chmod +x script.py
464 $ hg bisect -r
464 $ hg bisect -r
465 $ hg up -qr tip
465 $ hg up -qr tip
466 $ hg bisect --command "python \"$TESTTMP/script.py\" and some parameters"
466 $ hg bisect --command "python \"$TESTTMP/script.py\" and some parameters"
467 changeset 31:58c80a7c8a40: good
467 changeset 31:58c80a7c8a40: good
468 abort: cannot bisect (no known bad revisions)
468 abort: cannot bisect (no known bad revisions)
469 [255]
469 [255]
470 $ hg up -qr 0
470 $ hg up -qr 0
471 $ hg bisect --command "python \"$TESTTMP/script.py\" and some parameters"
471 $ hg bisect --command "python \"$TESTTMP/script.py\" and some parameters"
472 changeset 0:b99c7b9c8e11: bad
472 changeset 0:b99c7b9c8e11: bad
473 changeset 15:e7fa0811edb0: good
473 changeset 15:e7fa0811edb0: good
474 changeset 7:03750880c6b5: good
474 changeset 7:03750880c6b5: good
475 changeset 3:b53bea5e2fcb: bad
475 changeset 3:b53bea5e2fcb: bad
476 changeset 5:7874a09ea728: bad
476 changeset 5:7874a09ea728: bad
477 changeset 6:a3d5c6fdf0d3: good
477 changeset 6:a3d5c6fdf0d3: good
478 The first good revision is:
478 The first good revision is:
479 changeset: 6:a3d5c6fdf0d3
479 changeset: 6:a3d5c6fdf0d3
480 user: test
480 user: test
481 date: Thu Jan 01 00:00:06 1970 +0000
481 date: Thu Jan 01 00:00:06 1970 +0000
482 summary: msg 6
482 summary: msg 6
483
483
484
484
485
485
486 test bisecting via a command without updating the working dir, and
486 test bisecting via a command without updating the working dir, and
487 ensure that the bisect state file is updated before running a test
487 ensure that the bisect state file is updated before running a test
488 command
488 command
489
489
490 $ hg update null
490 $ hg update null
491 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
491 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
492 $ cat > script.sh <<'EOF'
492 $ cat > script.sh <<'EOF'
493 > #!/bin/sh
493 > #!/bin/sh
494 > test -n "$HG_NODE" || (echo HG_NODE missing; exit 127)
494 > test -n "$HG_NODE" || (echo HG_NODE missing; exit 127)
495 > current="`hg log -r \"bisect(current)\" --template {node}`"
495 > current="`hg log -r \"bisect(current)\" --template {node}`"
496 > test "$current" = "$HG_NODE" || (echo current is bad: $current; exit 127)
496 > test "$current" = "$HG_NODE" || (echo current is bad: $current; exit 127)
497 > rev="`hg log -r $HG_NODE --template {rev}`"
497 > rev="`hg log -r $HG_NODE --template {rev}`"
498 > test "$rev" -ge 6
498 > test "$rev" -ge 6
499 > EOF
499 > EOF
500 $ chmod +x script.sh
500 $ chmod +x script.sh
501 $ hg bisect -r
501 $ hg bisect -r
502 $ hg bisect --good tip --noupdate
502 $ hg bisect --good tip --noupdate
503 $ hg bisect --bad 0 --noupdate
503 $ hg bisect --bad 0 --noupdate
504 Testing changeset 15:e7fa0811edb0 (31 changesets remaining, ~4 tests)
504 Testing changeset 15:e7fa0811edb0 (31 changesets remaining, ~4 tests)
505 $ hg bisect --command "sh \"$TESTTMP/script.sh\" and some params" --noupdate
505 $ hg bisect --command "sh \"$TESTTMP/script.sh\" and some params" --noupdate
506 changeset 15:e7fa0811edb0: good
506 changeset 15:e7fa0811edb0: good
507 changeset 7:03750880c6b5: good
507 changeset 7:03750880c6b5: good
508 changeset 3:b53bea5e2fcb: bad
508 changeset 3:b53bea5e2fcb: bad
509 changeset 5:7874a09ea728: bad
509 changeset 5:7874a09ea728: bad
510 changeset 6:a3d5c6fdf0d3: good
510 changeset 6:a3d5c6fdf0d3: good
511 The first good revision is:
511 The first good revision is:
512 changeset: 6:a3d5c6fdf0d3
512 changeset: 6:a3d5c6fdf0d3
513 user: test
513 user: test
514 date: Thu Jan 01 00:00:06 1970 +0000
514 date: Thu Jan 01 00:00:06 1970 +0000
515 summary: msg 6
515 summary: msg 6
516
516
517
517
518 ensure that we still don't have a working dir
518 ensure that we still don't have a working dir
519
519
520 $ hg parents
520 $ hg parents
521
521
522
522
523 test the same case, this time with updating
523 test the same case, this time with updating
524
524
525 $ cat > script.sh <<'EOF'
525 $ cat > script.sh <<'EOF'
526 > #!/bin/sh
526 > #!/bin/sh
527 > test -n "$HG_NODE" || (echo HG_NODE missing; exit 127)
527 > test -n "$HG_NODE" || (echo HG_NODE missing; exit 127)
528 > current="`hg log -r \"bisect(current)\" --template {node}`"
528 > current="`hg log -r \"bisect(current)\" --template {node}`"
529 > test "$current" = "$HG_NODE" || (echo current is bad: $current; exit 127)
529 > test "$current" = "$HG_NODE" || (echo current is bad: $current; exit 127)
530 > rev="`hg log -r . --template {rev}`"
530 > rev="`hg log -r . --template {rev}`"
531 > test "$rev" -ge 6
531 > test "$rev" -ge 6
532 > EOF
532 > EOF
533 $ chmod +x script.sh
533 $ chmod +x script.sh
534 $ hg bisect -r
534 $ hg bisect -r
535 $ hg up -qr tip
535 $ hg up -qr tip
536 $ hg bisect --command "sh \"$TESTTMP/script.sh\" and some params"
536 $ hg bisect --command "sh \"$TESTTMP/script.sh\" and some params"
537 changeset 31:58c80a7c8a40: good
537 changeset 31:58c80a7c8a40: good
538 abort: cannot bisect (no known bad revisions)
538 abort: cannot bisect (no known bad revisions)
539 [255]
539 [255]
540 $ hg up -qr 0
540 $ hg up -qr 0
541 $ hg bisect --command "sh \"$TESTTMP/script.sh\" and some params"
541 $ hg bisect --command "sh \"$TESTTMP/script.sh\" and some params"
542 changeset 0:b99c7b9c8e11: bad
542 changeset 0:b99c7b9c8e11: bad
543 changeset 15:e7fa0811edb0: good
543 changeset 15:e7fa0811edb0: good
544 changeset 7:03750880c6b5: good
544 changeset 7:03750880c6b5: good
545 changeset 3:b53bea5e2fcb: bad
545 changeset 3:b53bea5e2fcb: bad
546 changeset 5:7874a09ea728: bad
546 changeset 5:7874a09ea728: bad
547 changeset 6:a3d5c6fdf0d3: good
547 changeset 6:a3d5c6fdf0d3: good
548 The first good revision is:
548 The first good revision is:
549 changeset: 6:a3d5c6fdf0d3
549 changeset: 6:a3d5c6fdf0d3
550 user: test
550 user: test
551 date: Thu Jan 01 00:00:06 1970 +0000
551 date: Thu Jan 01 00:00:06 1970 +0000
552 summary: msg 6
552 summary: msg 6
553
553
554 $ hg graft -q 15
554 $ hg graft -q 15
555 warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
555 warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
556 abort: unresolved conflicts, can't continue
556 abort: unresolved conflicts, can't continue
557 (use 'hg resolve' and 'hg graft --continue')
557 (use 'hg resolve' and 'hg graft --continue')
558 [255]
558 [255]
559 $ hg bisect --reset
559 $ hg bisect --reset
560 $ hg up -C .
560 $ hg up -C .
561 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
561 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
562
562
563 Check that bisect does not break on obsolete changesets
563 Check that bisect does not break on obsolete changesets
564 =========================================================
564 =========================================================
565
565
566 $ cat >> $HGRCPATH << EOF
566 $ cat >> $HGRCPATH << EOF
567 > [experimental]
567 > [experimental]
568 > evolution=createmarkers
568 > evolution=createmarkers
569 > EOF
569 > EOF
570
570
571 tip is obsolete
571 tip is obsolete
572 ---------------------
572 ---------------------
573
573
574 $ hg debugobsolete `hg id --debug -i -r tip`
574 $ hg debugobsolete `hg id --debug -i -r tip`
575 $ hg bisect --reset
575 $ hg bisect --reset
576 $ hg bisect --good 15
576 $ hg bisect --good 15
577 $ hg bisect --bad 30
577 $ hg bisect --bad 30
578 Testing changeset 22:06c7993750ce (15 changesets remaining, ~3 tests)
578 Testing changeset 22:06c7993750ce (15 changesets remaining, ~3 tests)
579 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
579 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
580 $ hg bisect --command true
580 $ hg bisect --command true
581 changeset 22:06c7993750ce: good
581 changeset 22:06c7993750ce: good
582 changeset 26:3efc6fd51aeb: good
582 changeset 26:3efc6fd51aeb: good
583 changeset 28:8e0c2264c8af: good
583 changeset 28:8e0c2264c8af: good
584 changeset 29:b5bd63375ab9: good
584 changeset 29:b5bd63375ab9: good
585 The first bad revision is:
585 The first bad revision is:
586 changeset: 30:ed2d2f24b11c
586 changeset: 30:ed2d2f24b11c
587 tag: tip
587 tag: tip
588 user: test
588 user: test
589 date: Thu Jan 01 00:00:30 1970 +0000
589 date: Thu Jan 01 00:00:30 1970 +0000
590 summary: msg 30
590 summary: msg 30
591
591
592
592
593 Changeset in the bad:good range is obsolete
593 Changeset in the bad:good range is obsolete
594 ---------------------------------------------
594 ---------------------------------------------
595
595
596 $ hg up 30
596 $ hg up 30
597 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
597 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
598 $ echo 'a' >> a
598 $ echo 'a' >> a
599 $ hg ci -m "msg 32" -d "32 0"
599 $ hg ci -m "msg 32" -d "32 0"
600 $ hg bisect --reset
600 $ hg bisect --reset
601 $ hg bisect --good .
601 $ hg bisect --good .
602 $ hg bisect --bad 25
602 $ hg bisect --bad 25
603 Testing changeset 28:8e0c2264c8af (6 changesets remaining, ~2 tests)
603 Testing changeset 28:8e0c2264c8af (6 changesets remaining, ~2 tests)
604 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
604 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
605 $ hg bisect --command true
605 $ hg bisect --command true
606 changeset 28:8e0c2264c8af: good
606 changeset 28:8e0c2264c8af: good
607 changeset 26:3efc6fd51aeb: good
607 changeset 26:3efc6fd51aeb: good
608 The first good revision is:
608 The first good revision is:
609 changeset: 26:3efc6fd51aeb
609 changeset: 26:3efc6fd51aeb
610 user: test
610 user: test
611 date: Thu Jan 01 00:00:26 1970 +0000
611 date: Thu Jan 01 00:00:26 1970 +0000
612 summary: msg 26
612 summary: msg 26
613
613
614 Test the validation message when exclusive options are used:
614 Test the validation message when exclusive options are used:
615
615
616 $ hg bisect -r
616 $ hg bisect -r
617 $ hg bisect -b -c false
617 $ hg bisect -b -c false
618 abort: --bad and --command are incompatible
618 abort: --bad and --command are incompatible
619 [255]
619 [255]
620 $ hg bisect -b -e
620 $ hg bisect -b -e
621 abort: --bad and --extend are incompatible
621 abort: --bad and --extend are incompatible
622 [255]
622 [255]
623 $ hg bisect -b -g
623 $ hg bisect -b -g
624 abort: --bad and --good are incompatible
624 abort: --bad and --good are incompatible
625 [255]
625 [255]
626 $ hg bisect -b -r
626 $ hg bisect -b -r
627 abort: --bad and --reset are incompatible
627 abort: --bad and --reset are incompatible
628 [255]
628 [255]
629 $ hg bisect -b -s
629 $ hg bisect -b -s
630 abort: --bad and --skip are incompatible
630 abort: --bad and --skip are incompatible
631 [255]
631 [255]
632 $ hg bisect -c false -e
632 $ hg bisect -c false -e
633 abort: --command and --extend are incompatible
633 abort: --command and --extend are incompatible
634 [255]
634 [255]
635 $ hg bisect -c false -g
635 $ hg bisect -c false -g
636 abort: --command and --good are incompatible
636 abort: --command and --good are incompatible
637 [255]
637 [255]
638 $ hg bisect -c false -r
638 $ hg bisect -c false -r
639 abort: --command and --reset are incompatible
639 abort: --command and --reset are incompatible
640 [255]
640 [255]
641 $ hg bisect -c false -s
641 $ hg bisect -c false -s
642 abort: --command and --skip are incompatible
642 abort: --command and --skip are incompatible
643 [255]
643 [255]
644 $ hg bisect -e -g
644 $ hg bisect -e -g
645 abort: --extend and --good are incompatible
645 abort: --extend and --good are incompatible
646 [255]
646 [255]
647 $ hg bisect -e -r
647 $ hg bisect -e -r
648 abort: --extend and --reset are incompatible
648 abort: --extend and --reset are incompatible
649 [255]
649 [255]
650 $ hg bisect -e -s
650 $ hg bisect -e -s
651 abort: --extend and --skip are incompatible
651 abort: --extend and --skip are incompatible
652 [255]
652 [255]
653 $ hg bisect -g -r
653 $ hg bisect -g -r
654 abort: --good and --reset are incompatible
654 abort: --good and --reset are incompatible
655 [255]
655 [255]
656 $ hg bisect -g -s
656 $ hg bisect -g -s
657 abort: --good and --skip are incompatible
657 abort: --good and --skip are incompatible
658 [255]
658 [255]
659 $ hg bisect -r -s
659 $ hg bisect -r -s
660 abort: --reset and --skip are incompatible
660 abort: --reset and --skip are incompatible
661 [255]
661 [255]
@@ -1,436 +1,436 b''
1 $ echo "[extensions]" >> $HGRCPATH
1 $ echo "[extensions]" >> $HGRCPATH
2 $ echo "extdiff=" >> $HGRCPATH
2 $ echo "extdiff=" >> $HGRCPATH
3
3
4 $ hg init a
4 $ hg init a
5 $ cd a
5 $ cd a
6 $ echo a > a
6 $ echo a > a
7 $ echo b > b
7 $ echo b > b
8 $ hg add
8 $ hg add
9 adding a
9 adding a
10 adding b
10 adding b
11
11
12 Should diff cloned directories:
12 Should diff cloned directories:
13
13
14 $ hg extdiff -o -r $opt
14 $ hg extdiff -o -r $opt
15 Only in a: a
15 Only in a: a
16 Only in a: b
16 Only in a: b
17 [1]
17 [1]
18
18
19 $ cat <<EOF >> $HGRCPATH
19 $ cat <<EOF >> $HGRCPATH
20 > [extdiff]
20 > [extdiff]
21 > cmd.falabala = echo
21 > cmd.falabala = echo
22 > opts.falabala = diffing
22 > opts.falabala = diffing
23 > cmd.edspace = echo
23 > cmd.edspace = echo
24 > opts.edspace = "name <user@example.com>"
24 > opts.edspace = "name <user@example.com>"
25 > EOF
25 > EOF
26
26
27 $ hg falabala
27 $ hg falabala
28 diffing a.000000000000 a
28 diffing a.000000000000 a
29 [1]
29 [1]
30
30
31 $ hg help falabala
31 $ hg help falabala
32 hg falabala [OPTION]... [FILE]...
32 hg falabala [OPTION]... [FILE]...
33
33
34 use external program to diff repository (or selected files)
34 use external program to diff repository (or selected files)
35
35
36 Show differences between revisions for the specified files, using the
36 Show differences between revisions for the specified files, using the
37 following program:
37 following program:
38
38
39 'echo'
39 'echo'
40
40
41 When two revision arguments are given, then changes are shown between
41 When two revision arguments are given, then changes are shown between
42 those revisions. If only one revision is specified then that revision is
42 those revisions. If only one revision is specified then that revision is
43 compared to the working directory, and, when no revisions are specified,
43 compared to the working directory, and, when no revisions are specified,
44 the working directory files are compared to its parent.
44 the working directory files are compared to its parent.
45
45
46 options ([+] can be repeated):
46 options ([+] can be repeated):
47
47
48 -o --option OPT [+] pass option to comparison program
48 -o --option OPT [+] pass option to comparison program
49 -r --rev REV [+] revision
49 -r --rev REV [+] revision
50 -c --change REV change made by revision
50 -c --change REV change made by revision
51 --patch compare patches for two revisions
51 --patch compare patches for two revisions
52 -I --include PATTERN [+] include names matching the given patterns
52 -I --include PATTERN [+] include names matching the given patterns
53 -X --exclude PATTERN [+] exclude names matching the given patterns
53 -X --exclude PATTERN [+] exclude names matching the given patterns
54 -S --subrepos recurse into subrepositories
54 -S --subrepos recurse into subrepositories
55
55
56 (some details hidden, use --verbose to show complete help)
56 (some details hidden, use --verbose to show complete help)
57
57
58 $ hg ci -d '0 0' -mtest1
58 $ hg ci -d '0 0' -mtest1
59
59
60 $ echo b >> a
60 $ echo b >> a
61 $ hg ci -d '1 0' -mtest2
61 $ hg ci -d '1 0' -mtest2
62
62
63 Should diff cloned files directly:
63 Should diff cloned files directly:
64
64
65 $ hg falabala -r 0:1
65 $ hg falabala -r 0:1
66 diffing "*\\extdiff.*\\a.8a5febb7f867\\a" "a.34eed99112ab\\a" (glob) (windows !)
66 diffing "*\\extdiff.*\\a.8a5febb7f867\\a" "a.34eed99112ab\\a" (glob) (windows !)
67 diffing */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob) (no-windows !)
67 diffing */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob) (no-windows !)
68 [1]
68 [1]
69
69
70 Specifying an empty revision should abort.
70 Specifying an empty revision should abort.
71
71
72 $ hg extdiff -p diff --patch --rev 'ancestor()' --rev 1
72 $ hg extdiff -p diff --patch --rev 'ancestor()' --rev 1
73 abort: empty revision on one side of range
73 abort: empty revision on one side of range
74 [255]
74 [255]
75
75
76 Test diff during merge:
76 Test diff during merge:
77
77
78 $ hg update -C 0
78 $ hg update -C 0
79 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
79 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
80 $ echo c >> c
80 $ echo c >> c
81 $ hg add c
81 $ hg add c
82 $ hg ci -m "new branch" -d '1 0'
82 $ hg ci -m "new branch" -d '1 0'
83 created new head
83 created new head
84 $ hg merge 1
84 $ hg merge 1
85 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
85 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
86 (branch merge, don't forget to commit)
86 (branch merge, don't forget to commit)
87
87
88 Should diff cloned file against wc file:
88 Should diff cloned file against wc file:
89
89
90 $ hg falabala
90 $ hg falabala
91 diffing "*\\extdiff.*\\a.2a13a4d2da36\\a" "*\\a\\a" (glob) (windows !)
91 diffing "*\\extdiff.*\\a.2a13a4d2da36\\a" "*\\a\\a" (glob) (windows !)
92 diffing */extdiff.*/a.2a13a4d2da36/a */a/a (glob) (no-windows !)
92 diffing */extdiff.*/a.2a13a4d2da36/a */a/a (glob) (no-windows !)
93 [1]
93 [1]
94
94
95
95
96 Test --change option:
96 Test --change option:
97
97
98 $ hg ci -d '2 0' -mtest3
98 $ hg ci -d '2 0' -mtest3
99
99
100 $ hg falabala -c 1
100 $ hg falabala -c 1
101 diffing "*\\extdiff.*\\a.8a5febb7f867\\a" "a.34eed99112ab\\a" (glob) (windows !)
101 diffing "*\\extdiff.*\\a.8a5febb7f867\\a" "a.34eed99112ab\\a" (glob) (windows !)
102 diffing */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob) (no-windows !)
102 diffing */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob) (no-windows !)
103 [1]
103 [1]
104
104
105 Check diff are made from the first parent:
105 Check diff are made from the first parent:
106
106
107 $ hg falabala -c 3 || echo "diff-like tools yield a non-zero exit code"
107 $ hg falabala -c 3 || echo "diff-like tools yield a non-zero exit code"
108 diffing "*\\extdiff.*\\a.2a13a4d2da36\\a" "a.46c0e4daeb72\\a" (glob) (windows !)
108 diffing "*\\extdiff.*\\a.2a13a4d2da36\\a" "a.46c0e4daeb72\\a" (glob) (windows !)
109 diffing */extdiff.*/a.2a13a4d2da36/a a.46c0e4daeb72/a (glob) (no-windows !)
109 diffing */extdiff.*/a.2a13a4d2da36/a a.46c0e4daeb72/a (glob) (no-windows !)
110 diff-like tools yield a non-zero exit code
110 diff-like tools yield a non-zero exit code
111
111
112 issue3153: ensure using extdiff with removed subrepos doesn't crash:
112 issue3153: ensure using extdiff with removed subrepos doesn't crash:
113
113
114 $ hg init suba
114 $ hg init suba
115 $ cd suba
115 $ cd suba
116 $ echo suba > suba
116 $ echo suba > suba
117 $ hg add
117 $ hg add
118 adding suba
118 adding suba
119 $ hg ci -m "adding suba file"
119 $ hg ci -m "adding suba file"
120 $ cd ..
120 $ cd ..
121 $ echo suba=suba > .hgsub
121 $ echo suba=suba > .hgsub
122 $ hg add
122 $ hg add
123 adding .hgsub
123 adding .hgsub
124 $ hg ci -Sm "adding subrepo"
124 $ hg ci -Sm "adding subrepo"
125 $ echo > .hgsub
125 $ echo > .hgsub
126 $ hg ci -m "removing subrepo"
126 $ hg ci -m "removing subrepo"
127 $ hg falabala -r 4 -r 5 -S
127 $ hg falabala -r 4 -r 5 -S
128 diffing a.398e36faf9c6 a.5ab95fb166c4
128 diffing a.398e36faf9c6 a.5ab95fb166c4
129 [1]
129 [1]
130
130
131 issue4463: usage of command line configuration without additional quoting
131 issue4463: usage of command line configuration without additional quoting
132
132
133 $ cat <<EOF >> $HGRCPATH
133 $ cat <<EOF >> $HGRCPATH
134 > [extdiff]
134 > [extdiff]
135 > cmd.4463a = echo
135 > cmd.4463a = echo
136 > opts.4463a = a-naked 'single quoted' "double quoted"
136 > opts.4463a = a-naked 'single quoted' "double quoted"
137 > 4463b = echo b-naked 'single quoted' "double quoted"
137 > 4463b = echo b-naked 'single quoted' "double quoted"
138 > echo =
138 > echo =
139 > EOF
139 > EOF
140 $ hg update -q -C 0
140 $ hg update -q -C 0
141 $ echo a >> a
141 $ echo a >> a
142
142
143 $ hg --debug 4463a | grep '^running'
143 $ hg --debug 4463a | grep '^running'
144 running 'echo a-naked \'single quoted\' "double quoted" "*\\a" "*\\a"' in */extdiff.* (glob) (windows !)
144 running 'echo a-naked \'single quoted\' "double quoted" "*\\a" "*\\a"' in */extdiff.* (glob) (windows !)
145 running 'echo a-naked \'single quoted\' "double quoted" */a $TESTTMP/a/a' in */extdiff.* (glob) (no-windows !)
145 running 'echo a-naked \'single quoted\' "double quoted" */a $TESTTMP/a/a' in */extdiff.* (glob) (no-windows !)
146 $ hg --debug 4463b | grep '^running'
146 $ hg --debug 4463b | grep '^running'
147 running 'echo b-naked \'single quoted\' "double quoted" "*\\a" "*\\a"' in */extdiff.* (glob) (windows !)
147 running 'echo b-naked \'single quoted\' "double quoted" "*\\a" "*\\a"' in */extdiff.* (glob) (windows !)
148 running 'echo b-naked \'single quoted\' "double quoted" */a $TESTTMP/a/a' in */extdiff.* (glob) (no-windows !)
148 running 'echo b-naked \'single quoted\' "double quoted" */a $TESTTMP/a/a' in */extdiff.* (glob) (no-windows !)
149 $ hg --debug echo | grep '^running'
149 $ hg --debug echo | grep '^running'
150 running '*echo* "*\\a" "*\\a"' in */extdiff.* (glob) (windows !)
150 running '*echo* "*\\a" "*\\a"' in */extdiff.* (glob) (windows !)
151 running '*echo */a $TESTTMP/a/a' in */extdiff.* (glob) (no-windows !)
151 running '*echo */a $TESTTMP/a/a' in */extdiff.* (glob) (no-windows !)
152
152
153 (getting options from other than extdiff section)
153 (getting options from other than extdiff section)
154
154
155 $ cat <<EOF >> $HGRCPATH
155 $ cat <<EOF >> $HGRCPATH
156 > [extdiff]
156 > [extdiff]
157 > # using diff-tools diffargs
157 > # using diff-tools diffargs
158 > 4463b2 = echo
158 > 4463b2 = echo
159 > # using merge-tools diffargs
159 > # using merge-tools diffargs
160 > 4463b3 = echo
160 > 4463b3 = echo
161 > # no diffargs
161 > # no diffargs
162 > 4463b4 = echo
162 > 4463b4 = echo
163 > [diff-tools]
163 > [diff-tools]
164 > 4463b2.diffargs = b2-naked 'single quoted' "double quoted"
164 > 4463b2.diffargs = b2-naked 'single quoted' "double quoted"
165 > [merge-tools]
165 > [merge-tools]
166 > 4463b3.diffargs = b3-naked 'single quoted' "double quoted"
166 > 4463b3.diffargs = b3-naked 'single quoted' "double quoted"
167 > EOF
167 > EOF
168
168
169 $ hg --debug 4463b2 | grep '^running'
169 $ hg --debug 4463b2 | grep '^running'
170 running 'echo b2-naked \'single quoted\' "double quoted" "*\\a" "*\\a"' in */extdiff.* (glob) (windows !)
170 running 'echo b2-naked \'single quoted\' "double quoted" "*\\a" "*\\a"' in */extdiff.* (glob) (windows !)
171 running 'echo b2-naked \'single quoted\' "double quoted" */a $TESTTMP/a/a' in */extdiff.* (glob) (no-windows !)
171 running 'echo b2-naked \'single quoted\' "double quoted" */a $TESTTMP/a/a' in */extdiff.* (glob) (no-windows !)
172 $ hg --debug 4463b3 | grep '^running'
172 $ hg --debug 4463b3 | grep '^running'
173 running 'echo b3-naked \'single quoted\' "double quoted" "*\\a" "*\\a"' in */extdiff.* (glob) (windows !)
173 running 'echo b3-naked \'single quoted\' "double quoted" "*\\a" "*\\a"' in */extdiff.* (glob) (windows !)
174 running 'echo b3-naked \'single quoted\' "double quoted" */a $TESTTMP/a/a' in */extdiff.* (glob) (no-windows !)
174 running 'echo b3-naked \'single quoted\' "double quoted" */a $TESTTMP/a/a' in */extdiff.* (glob) (no-windows !)
175 $ hg --debug 4463b4 | grep '^running'
175 $ hg --debug 4463b4 | grep '^running'
176 running 'echo "*\\a" "*\\a"' in */extdiff.* (glob) (windows !)
176 running 'echo "*\\a" "*\\a"' in */extdiff.* (glob) (windows !)
177 running 'echo */a $TESTTMP/a/a' in */extdiff.* (glob) (no-windows !)
177 running 'echo */a $TESTTMP/a/a' in */extdiff.* (glob) (no-windows !)
178 $ hg --debug 4463b4 --option b4-naked --option 'being quoted' | grep '^running'
178 $ hg --debug 4463b4 --option b4-naked --option 'being quoted' | grep '^running'
179 running 'echo b4-naked "being quoted" "*\\a" "*\\a"' in */extdiff.* (glob) (windows !)
179 running 'echo b4-naked "being quoted" "*\\a" "*\\a"' in */extdiff.* (glob) (windows !)
180 running "echo b4-naked 'being quoted' */a $TESTTMP/a/a" in */extdiff.* (glob) (no-windows !)
180 running "echo b4-naked 'being quoted' */a $TESTTMP/a/a" in */extdiff.* (glob) (no-windows !)
181 $ hg --debug extdiff -p echo --option echo-naked --option 'being quoted' | grep '^running'
181 $ hg --debug extdiff -p echo --option echo-naked --option 'being quoted' | grep '^running'
182 running 'echo echo-naked "being quoted" "*\\a" "*\\a"' in */extdiff.* (glob) (windows !)
182 running 'echo echo-naked "being quoted" "*\\a" "*\\a"' in */extdiff.* (glob) (windows !)
183 running "echo echo-naked 'being quoted' */a $TESTTMP/a/a" in */extdiff.* (glob) (no-windows !)
183 running "echo echo-naked 'being quoted' */a $TESTTMP/a/a" in */extdiff.* (glob) (no-windows !)
184
184
185 $ touch 'sp ace'
185 $ touch 'sp ace'
186 $ hg add 'sp ace'
186 $ hg add 'sp ace'
187 $ hg ci -m 'sp ace'
187 $ hg ci -m 'sp ace'
188 created new head
188 created new head
189 $ echo > 'sp ace'
189 $ echo > 'sp ace'
190
190
191 Test pre-72a89cf86fcd backward compatibility with half-baked manual quoting
191 Test pre-72a89cf86fcd backward compatibility with half-baked manual quoting
192
192
193 $ cat <<EOF >> $HGRCPATH
193 $ cat <<EOF >> $HGRCPATH
194 > [extdiff]
194 > [extdiff]
195 > odd =
195 > odd =
196 > [merge-tools]
196 > [merge-tools]
197 > odd.diffargs = --foo='\$clabel' '\$clabel' "--bar=\$clabel" "\$clabel"
197 > odd.diffargs = --foo='\$clabel' '\$clabel' "--bar=\$clabel" "\$clabel"
198 > odd.executable = echo
198 > odd.executable = echo
199 > EOF
199 > EOF
200
200
201 $ hg --debug odd | grep '^running'
201 $ hg --debug odd | grep '^running'
202 running '"*\\echo.exe" --foo="sp ace" "sp ace" --bar="sp ace" "sp ace"' in * (glob) (windows !)
202 running '"*\\echo.exe" --foo="sp ace" "sp ace" --bar="sp ace" "sp ace"' in * (glob) (windows !)
203 running "*/echo --foo='sp ace' 'sp ace' --bar='sp ace' 'sp ace'" in * (glob) (no-windows !)
203 running "*/echo --foo='sp ace' 'sp ace' --bar='sp ace' 'sp ace'" in * (glob) (no-windows !)
204
204
205 Empty argument must be quoted
205 Empty argument must be quoted
206
206
207 $ cat <<EOF >> $HGRCPATH
207 $ cat <<EOF >> $HGRCPATH
208 > [extdiff]
208 > [extdiff]
209 > kdiff3 = echo
209 > kdiff3 = echo
210 > [merge-tools]
210 > [merge-tools]
211 > kdiff3.diffargs=--L1 \$plabel1 --L2 \$clabel \$parent \$child
211 > kdiff3.diffargs=--L1 \$plabel1 --L2 \$clabel \$parent \$child
212 > EOF
212 > EOF
213
213
214 $ hg --debug kdiff3 -r0 | grep '^running'
214 $ hg --debug kdiff3 -r0 | grep '^running'
215 running 'echo --L1 "@0" --L2 "" a.8a5febb7f867 a' in * (glob) (windows !)
215 running 'echo --L1 "@0" --L2 "" a.8a5febb7f867 a' in * (glob) (windows !)
216 running "echo --L1 '@0' --L2 '' a.8a5febb7f867 a" in * (glob) (no-windows !)
216 running "echo --L1 '@0' --L2 '' a.8a5febb7f867 a" in * (glob) (no-windows !)
217
217
218
218
219 Test extdiff of multiple files in tmp dir:
219 Test extdiff of multiple files in tmp dir:
220
220
221 $ hg update -C 0 > /dev/null
221 $ hg update -C 0 > /dev/null
222 $ echo changed > a
222 $ echo changed > a
223 $ echo changed > b
223 $ echo changed > b
224 #if execbit
224 #if execbit
225 $ chmod +x b
225 $ chmod +x b
226 #endif
226 #endif
227
227
228 Diff in working directory, before:
228 Diff in working directory, before:
229
229
230 $ hg diff --git
230 $ hg diff --git
231 diff --git a/a b/a
231 diff --git a/a b/a
232 --- a/a
232 --- a/a
233 +++ b/a
233 +++ b/a
234 @@ -1,1 +1,1 @@
234 @@ -1,1 +1,1 @@
235 -a
235 -a
236 +changed
236 +changed
237 diff --git a/b b/b
237 diff --git a/b b/b
238 old mode 100644 (execbit !)
238 old mode 100644 (execbit !)
239 new mode 100755 (execbit !)
239 new mode 100755 (execbit !)
240 --- a/b
240 --- a/b
241 +++ b/b
241 +++ b/b
242 @@ -1,1 +1,1 @@
242 @@ -1,1 +1,1 @@
243 -b
243 -b
244 +changed
244 +changed
245
245
246
246
247 Edit with extdiff -p:
247 Edit with extdiff -p:
248
248
249 Prepare custom diff/edit tool:
249 Prepare custom diff/edit tool:
250
250
251 $ cat > 'diff tool.py' << EOT
251 $ cat > 'diff tool.py' << EOT
252 > #!/usr/bin/env python
252 > #!$PYTHON
253 > import time
253 > import time
254 > time.sleep(1) # avoid unchanged-timestamp problems
254 > time.sleep(1) # avoid unchanged-timestamp problems
255 > file('a/a', 'ab').write('edited\n')
255 > file('a/a', 'ab').write('edited\n')
256 > file('a/b', 'ab').write('edited\n')
256 > file('a/b', 'ab').write('edited\n')
257 > EOT
257 > EOT
258
258
259 #if execbit
259 #if execbit
260 $ chmod +x 'diff tool.py'
260 $ chmod +x 'diff tool.py'
261 #endif
261 #endif
262
262
263 will change to /tmp/extdiff.TMP and populate directories a.TMP and a
263 will change to /tmp/extdiff.TMP and populate directories a.TMP and a
264 and start tool
264 and start tool
265
265
266 $ hg extdiff -p "`pwd`/diff tool.py"
266 $ hg extdiff -p "`pwd`/diff tool.py"
267 [1]
267 [1]
268
268
269 Diff in working directory, after:
269 Diff in working directory, after:
270
270
271 $ hg diff --git
271 $ hg diff --git
272 diff --git a/a b/a
272 diff --git a/a b/a
273 --- a/a
273 --- a/a
274 +++ b/a
274 +++ b/a
275 @@ -1,1 +1,2 @@
275 @@ -1,1 +1,2 @@
276 -a
276 -a
277 +changed
277 +changed
278 +edited
278 +edited
279 diff --git a/b b/b
279 diff --git a/b b/b
280 old mode 100644 (execbit !)
280 old mode 100644 (execbit !)
281 new mode 100755 (execbit !)
281 new mode 100755 (execbit !)
282 --- a/b
282 --- a/b
283 +++ b/b
283 +++ b/b
284 @@ -1,1 +1,2 @@
284 @@ -1,1 +1,2 @@
285 -b
285 -b
286 +changed
286 +changed
287 +edited
287 +edited
288
288
289 Test extdiff with --option:
289 Test extdiff with --option:
290
290
291 $ hg extdiff -p echo -o this -c 1
291 $ hg extdiff -p echo -o this -c 1
292 this "*\\a.8a5febb7f867\\a" "a.34eed99112ab\\a" (glob) (windows !)
292 this "*\\a.8a5febb7f867\\a" "a.34eed99112ab\\a" (glob) (windows !)
293 this */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob) (no-windows !)
293 this */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob) (no-windows !)
294 [1]
294 [1]
295
295
296 $ hg falabala -o this -c 1
296 $ hg falabala -o this -c 1
297 diffing this "*\\a.8a5febb7f867\\a" "a.34eed99112ab\\a" (glob) (windows !)
297 diffing this "*\\a.8a5febb7f867\\a" "a.34eed99112ab\\a" (glob) (windows !)
298 diffing this */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob) (no-windows !)
298 diffing this */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob) (no-windows !)
299 [1]
299 [1]
300
300
301 Test extdiff's handling of options with spaces in them:
301 Test extdiff's handling of options with spaces in them:
302
302
303 $ hg edspace -c 1
303 $ hg edspace -c 1
304 "name <user@example.com>" "*\\a.8a5febb7f867\\a" "a.34eed99112ab\\a" (glob) (windows !)
304 "name <user@example.com>" "*\\a.8a5febb7f867\\a" "a.34eed99112ab\\a" (glob) (windows !)
305 name <user@example.com> */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob) (no-windows !)
305 name <user@example.com> */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob) (no-windows !)
306 [1]
306 [1]
307
307
308 $ hg extdiff -p echo -o "name <user@example.com>" -c 1
308 $ hg extdiff -p echo -o "name <user@example.com>" -c 1
309 "name <user@example.com>" "*\\a.8a5febb7f867\\a" "a.34eed99112ab\\a" (glob) (windows !)
309 "name <user@example.com>" "*\\a.8a5febb7f867\\a" "a.34eed99112ab\\a" (glob) (windows !)
310 name <user@example.com> */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob) (no-windows !)
310 name <user@example.com> */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob) (no-windows !)
311 [1]
311 [1]
312
312
313 Test with revsets:
313 Test with revsets:
314
314
315 $ hg extdif -p echo -c "rev(1)"
315 $ hg extdif -p echo -c "rev(1)"
316 "*\\a.8a5febb7f867\\a" "a.34eed99112ab\\a" (glob) (windows !)
316 "*\\a.8a5febb7f867\\a" "a.34eed99112ab\\a" (glob) (windows !)
317 */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob) (no-windows !)
317 */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob) (no-windows !)
318 [1]
318 [1]
319
319
320 $ hg extdif -p echo -r "0::1"
320 $ hg extdif -p echo -r "0::1"
321 "*\\a.8a5febb7f867\\a" "a.34eed99112ab\\a" (glob) (windows !)
321 "*\\a.8a5febb7f867\\a" "a.34eed99112ab\\a" (glob) (windows !)
322 */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob) (no-windows !)
322 */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob) (no-windows !)
323 [1]
323 [1]
324
324
325 Fallback to merge-tools.tool.executable|regkey
325 Fallback to merge-tools.tool.executable|regkey
326 $ mkdir dir
326 $ mkdir dir
327 $ cat > 'dir/tool.sh' << 'EOF'
327 $ cat > 'dir/tool.sh' << 'EOF'
328 > #!/bin/sh
328 > #!/bin/sh
329 > # Mimic a tool that syncs all attrs, including mtime
329 > # Mimic a tool that syncs all attrs, including mtime
330 > cp $1/a $2/a
330 > cp $1/a $2/a
331 > touch -r $1/a $2/a
331 > touch -r $1/a $2/a
332 > chmod +x $2/a
332 > chmod +x $2/a
333 > echo "** custom diff **"
333 > echo "** custom diff **"
334 > EOF
334 > EOF
335 #if execbit
335 #if execbit
336 $ chmod +x dir/tool.sh
336 $ chmod +x dir/tool.sh
337 #endif
337 #endif
338
338
339 Windows can't run *.sh directly, so create a shim executable that can be.
339 Windows can't run *.sh directly, so create a shim executable that can be.
340 Without something executable, the next hg command will try to run `tl` instead
340 Without something executable, the next hg command will try to run `tl` instead
341 of $tool (and fail).
341 of $tool (and fail).
342 #if windows
342 #if windows
343 $ cat > dir/tool.bat <<EOF
343 $ cat > dir/tool.bat <<EOF
344 > @sh -c "`pwd`/dir/tool.sh %1 %2"
344 > @sh -c "`pwd`/dir/tool.sh %1 %2"
345 > EOF
345 > EOF
346 $ tool=`pwd`/dir/tool.bat
346 $ tool=`pwd`/dir/tool.bat
347 #else
347 #else
348 $ tool=`pwd`/dir/tool.sh
348 $ tool=`pwd`/dir/tool.sh
349 #endif
349 #endif
350
350
351 $ cat a
351 $ cat a
352 changed
352 changed
353 edited
353 edited
354 $ hg --debug tl --config extdiff.tl= --config merge-tools.tl.executable=$tool
354 $ hg --debug tl --config extdiff.tl= --config merge-tools.tl.executable=$tool
355 making snapshot of 2 files from rev * (glob)
355 making snapshot of 2 files from rev * (glob)
356 a
356 a
357 b
357 b
358 making snapshot of 2 files from working directory
358 making snapshot of 2 files from working directory
359 a
359 a
360 b
360 b
361 running '$TESTTMP/a/dir/tool.bat a.* a' in */extdiff.* (glob) (windows !)
361 running '$TESTTMP/a/dir/tool.bat a.* a' in */extdiff.* (glob) (windows !)
362 running '$TESTTMP/a/dir/tool.sh a.* a' in */extdiff.* (glob) (no-windows !)
362 running '$TESTTMP/a/dir/tool.sh a.* a' in */extdiff.* (glob) (no-windows !)
363 ** custom diff **
363 ** custom diff **
364 file changed while diffing. Overwriting: $TESTTMP/a/a (src: */extdiff.*/a/a) (glob)
364 file changed while diffing. Overwriting: $TESTTMP/a/a (src: */extdiff.*/a/a) (glob)
365 cleaning up temp directory
365 cleaning up temp directory
366 [1]
366 [1]
367 $ cat a
367 $ cat a
368 a
368 a
369
369
370 #if execbit
370 #if execbit
371 $ [ -x a ]
371 $ [ -x a ]
372
372
373 $ cat > 'dir/tool.sh' << 'EOF'
373 $ cat > 'dir/tool.sh' << 'EOF'
374 > #!/bin/sh
374 > #!/bin/sh
375 > chmod -x $2/a
375 > chmod -x $2/a
376 > echo "** custom diff **"
376 > echo "** custom diff **"
377 > EOF
377 > EOF
378
378
379 $ hg --debug tl --config extdiff.tl= --config merge-tools.tl.executable=$tool
379 $ hg --debug tl --config extdiff.tl= --config merge-tools.tl.executable=$tool
380 making snapshot of 2 files from rev * (glob)
380 making snapshot of 2 files from rev * (glob)
381 a
381 a
382 b
382 b
383 making snapshot of 2 files from working directory
383 making snapshot of 2 files from working directory
384 a
384 a
385 b
385 b
386 running '$TESTTMP/a/dir/tool.sh a.* a' in */extdiff.* (glob)
386 running '$TESTTMP/a/dir/tool.sh a.* a' in */extdiff.* (glob)
387 ** custom diff **
387 ** custom diff **
388 file changed while diffing. Overwriting: $TESTTMP/a/a (src: */extdiff.*/a/a) (glob)
388 file changed while diffing. Overwriting: $TESTTMP/a/a (src: */extdiff.*/a/a) (glob)
389 cleaning up temp directory
389 cleaning up temp directory
390 [1]
390 [1]
391
391
392 $ [ -x a ]
392 $ [ -x a ]
393 [1]
393 [1]
394 #endif
394 #endif
395
395
396 $ cd ..
396 $ cd ..
397
397
398 #if symlink
398 #if symlink
399
399
400 Test symlinks handling (issue1909)
400 Test symlinks handling (issue1909)
401
401
402 $ hg init testsymlinks
402 $ hg init testsymlinks
403 $ cd testsymlinks
403 $ cd testsymlinks
404 $ echo a > a
404 $ echo a > a
405 $ hg ci -Am adda
405 $ hg ci -Am adda
406 adding a
406 adding a
407 $ echo a >> a
407 $ echo a >> a
408 $ ln -s missing linka
408 $ ln -s missing linka
409 $ hg add linka
409 $ hg add linka
410 $ hg falabala -r 0 --traceback
410 $ hg falabala -r 0 --traceback
411 diffing testsymlinks.07f494440405 testsymlinks
411 diffing testsymlinks.07f494440405 testsymlinks
412 [1]
412 [1]
413 $ cd ..
413 $ cd ..
414
414
415 #endif
415 #endif
416
416
417 Test handling of non-ASCII paths in generated docstrings (issue5301)
417 Test handling of non-ASCII paths in generated docstrings (issue5301)
418
418
419 >>> open("u", "w").write("\xa5\xa5")
419 >>> open("u", "w").write("\xa5\xa5")
420 $ U=`cat u`
420 $ U=`cat u`
421
421
422 $ HGPLAIN=1 hg --config hgext.extdiff= --config extdiff.cmd.td=hi help -k xyzzy
422 $ HGPLAIN=1 hg --config hgext.extdiff= --config extdiff.cmd.td=hi help -k xyzzy
423 abort: no matches
423 abort: no matches
424 (try 'hg help' for a list of topics)
424 (try 'hg help' for a list of topics)
425 [255]
425 [255]
426
426
427 $ HGPLAIN=1 hg --config hgext.extdiff= --config extdiff.cmd.td=hi help td > /dev/null
427 $ HGPLAIN=1 hg --config hgext.extdiff= --config extdiff.cmd.td=hi help td > /dev/null
428
428
429 $ LC_MESSAGES=ja_JP.UTF-8 hg --config hgext.extdiff= --config extdiff.cmd.td=$U help -k xyzzy
429 $ LC_MESSAGES=ja_JP.UTF-8 hg --config hgext.extdiff= --config extdiff.cmd.td=$U help -k xyzzy
430 abort: no matches
430 abort: no matches
431 (try 'hg help' for a list of topics)
431 (try 'hg help' for a list of topics)
432 [255]
432 [255]
433
433
434 $ LC_MESSAGES=ja_JP.UTF-8 hg --config hgext.extdiff= --config extdiff.cmd.td=$U help td \
434 $ LC_MESSAGES=ja_JP.UTF-8 hg --config hgext.extdiff= --config extdiff.cmd.td=$U help td \
435 > | grep "^ '"
435 > | grep "^ '"
436 '\xa5\xa5'
436 '\xa5\xa5'
@@ -1,1659 +1,1659 b''
1 Test basic extension support
1 Test basic extension support
2
2
3 $ cat > foobar.py <<EOF
3 $ cat > foobar.py <<EOF
4 > import os
4 > import os
5 > from mercurial import commands, registrar
5 > from mercurial import commands, registrar
6 > cmdtable = {}
6 > cmdtable = {}
7 > command = registrar.command(cmdtable)
7 > command = registrar.command(cmdtable)
8 > def uisetup(ui):
8 > def uisetup(ui):
9 > ui.write("uisetup called\\n")
9 > ui.write("uisetup called\\n")
10 > ui.flush()
10 > ui.flush()
11 > def reposetup(ui, repo):
11 > def reposetup(ui, repo):
12 > ui.write("reposetup called for %s\\n" % os.path.basename(repo.root))
12 > ui.write("reposetup called for %s\\n" % os.path.basename(repo.root))
13 > ui.write("ui %s= repo.ui\\n" % (ui == repo.ui and "=" or "!"))
13 > ui.write("ui %s= repo.ui\\n" % (ui == repo.ui and "=" or "!"))
14 > ui.flush()
14 > ui.flush()
15 > @command('foo', [], 'hg foo')
15 > @command('foo', [], 'hg foo')
16 > def foo(ui, *args, **kwargs):
16 > def foo(ui, *args, **kwargs):
17 > ui.write("Foo\\n")
17 > ui.write("Foo\\n")
18 > @command('bar', [], 'hg bar', norepo=True)
18 > @command('bar', [], 'hg bar', norepo=True)
19 > def bar(ui, *args, **kwargs):
19 > def bar(ui, *args, **kwargs):
20 > ui.write("Bar\\n")
20 > ui.write("Bar\\n")
21 > EOF
21 > EOF
22 $ abspath=`pwd`/foobar.py
22 $ abspath=`pwd`/foobar.py
23
23
24 $ mkdir barfoo
24 $ mkdir barfoo
25 $ cp foobar.py barfoo/__init__.py
25 $ cp foobar.py barfoo/__init__.py
26 $ barfoopath=`pwd`/barfoo
26 $ barfoopath=`pwd`/barfoo
27
27
28 $ hg init a
28 $ hg init a
29 $ cd a
29 $ cd a
30 $ echo foo > file
30 $ echo foo > file
31 $ hg add file
31 $ hg add file
32 $ hg commit -m 'add file'
32 $ hg commit -m 'add file'
33
33
34 $ echo '[extensions]' >> $HGRCPATH
34 $ echo '[extensions]' >> $HGRCPATH
35 $ echo "foobar = $abspath" >> $HGRCPATH
35 $ echo "foobar = $abspath" >> $HGRCPATH
36 $ hg foo
36 $ hg foo
37 uisetup called
37 uisetup called
38 reposetup called for a
38 reposetup called for a
39 ui == repo.ui
39 ui == repo.ui
40 Foo
40 Foo
41
41
42 $ cd ..
42 $ cd ..
43 $ hg clone a b
43 $ hg clone a b
44 uisetup called
44 uisetup called
45 reposetup called for a
45 reposetup called for a
46 ui == repo.ui
46 ui == repo.ui
47 reposetup called for b
47 reposetup called for b
48 ui == repo.ui
48 ui == repo.ui
49 updating to branch default
49 updating to branch default
50 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
50 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
51
51
52 $ hg bar
52 $ hg bar
53 uisetup called
53 uisetup called
54 Bar
54 Bar
55 $ echo 'foobar = !' >> $HGRCPATH
55 $ echo 'foobar = !' >> $HGRCPATH
56
56
57 module/__init__.py-style
57 module/__init__.py-style
58
58
59 $ echo "barfoo = $barfoopath" >> $HGRCPATH
59 $ echo "barfoo = $barfoopath" >> $HGRCPATH
60 $ cd a
60 $ cd a
61 $ hg foo
61 $ hg foo
62 uisetup called
62 uisetup called
63 reposetup called for a
63 reposetup called for a
64 ui == repo.ui
64 ui == repo.ui
65 Foo
65 Foo
66 $ echo 'barfoo = !' >> $HGRCPATH
66 $ echo 'barfoo = !' >> $HGRCPATH
67
67
68 Check that extensions are loaded in phases:
68 Check that extensions are loaded in phases:
69
69
70 $ cat > foo.py <<EOF
70 $ cat > foo.py <<EOF
71 > import os
71 > import os
72 > name = os.path.basename(__file__).rsplit('.', 1)[0]
72 > name = os.path.basename(__file__).rsplit('.', 1)[0]
73 > print "1) %s imported" % name
73 > print "1) %s imported" % name
74 > def uisetup(ui):
74 > def uisetup(ui):
75 > print "2) %s uisetup" % name
75 > print "2) %s uisetup" % name
76 > def extsetup():
76 > def extsetup():
77 > print "3) %s extsetup" % name
77 > print "3) %s extsetup" % name
78 > def reposetup(ui, repo):
78 > def reposetup(ui, repo):
79 > print "4) %s reposetup" % name
79 > print "4) %s reposetup" % name
80 > EOF
80 > EOF
81
81
82 $ cp foo.py bar.py
82 $ cp foo.py bar.py
83 $ echo 'foo = foo.py' >> $HGRCPATH
83 $ echo 'foo = foo.py' >> $HGRCPATH
84 $ echo 'bar = bar.py' >> $HGRCPATH
84 $ echo 'bar = bar.py' >> $HGRCPATH
85
85
86 Command with no output, we just want to see the extensions loaded:
86 Command with no output, we just want to see the extensions loaded:
87
87
88 $ hg paths
88 $ hg paths
89 1) foo imported
89 1) foo imported
90 1) bar imported
90 1) bar imported
91 2) foo uisetup
91 2) foo uisetup
92 2) bar uisetup
92 2) bar uisetup
93 3) foo extsetup
93 3) foo extsetup
94 3) bar extsetup
94 3) bar extsetup
95 4) foo reposetup
95 4) foo reposetup
96 4) bar reposetup
96 4) bar reposetup
97
97
98 Check hgweb's load order:
98 Check hgweb's load order:
99
99
100 $ cat > hgweb.cgi <<EOF
100 $ cat > hgweb.cgi <<EOF
101 > #!/usr/bin/env python
101 > #!$PYTHON
102 > from mercurial import demandimport; demandimport.enable()
102 > from mercurial import demandimport; demandimport.enable()
103 > from mercurial.hgweb import hgweb
103 > from mercurial.hgweb import hgweb
104 > from mercurial.hgweb import wsgicgi
104 > from mercurial.hgweb import wsgicgi
105 > application = hgweb('.', 'test repo')
105 > application = hgweb('.', 'test repo')
106 > wsgicgi.launch(application)
106 > wsgicgi.launch(application)
107 > EOF
107 > EOF
108
108
109 $ REQUEST_METHOD='GET' PATH_INFO='/' SCRIPT_NAME='' QUERY_STRING='' \
109 $ REQUEST_METHOD='GET' PATH_INFO='/' SCRIPT_NAME='' QUERY_STRING='' \
110 > SERVER_PORT='80' SERVER_NAME='localhost' python hgweb.cgi \
110 > SERVER_PORT='80' SERVER_NAME='localhost' python hgweb.cgi \
111 > | grep '^[0-9]) ' # ignores HTML output
111 > | grep '^[0-9]) ' # ignores HTML output
112 1) foo imported
112 1) foo imported
113 1) bar imported
113 1) bar imported
114 2) foo uisetup
114 2) foo uisetup
115 2) bar uisetup
115 2) bar uisetup
116 3) foo extsetup
116 3) foo extsetup
117 3) bar extsetup
117 3) bar extsetup
118 4) foo reposetup
118 4) foo reposetup
119 4) bar reposetup
119 4) bar reposetup
120
120
121 $ echo 'foo = !' >> $HGRCPATH
121 $ echo 'foo = !' >> $HGRCPATH
122 $ echo 'bar = !' >> $HGRCPATH
122 $ echo 'bar = !' >> $HGRCPATH
123
123
124 Check "from __future__ import absolute_import" support for external libraries
124 Check "from __future__ import absolute_import" support for external libraries
125
125
126 #if windows
126 #if windows
127 $ PATHSEP=";"
127 $ PATHSEP=";"
128 #else
128 #else
129 $ PATHSEP=":"
129 $ PATHSEP=":"
130 #endif
130 #endif
131 $ export PATHSEP
131 $ export PATHSEP
132
132
133 $ mkdir $TESTTMP/libroot
133 $ mkdir $TESTTMP/libroot
134 $ echo "s = 'libroot/ambig.py'" > $TESTTMP/libroot/ambig.py
134 $ echo "s = 'libroot/ambig.py'" > $TESTTMP/libroot/ambig.py
135 $ mkdir $TESTTMP/libroot/mod
135 $ mkdir $TESTTMP/libroot/mod
136 $ touch $TESTTMP/libroot/mod/__init__.py
136 $ touch $TESTTMP/libroot/mod/__init__.py
137 $ echo "s = 'libroot/mod/ambig.py'" > $TESTTMP/libroot/mod/ambig.py
137 $ echo "s = 'libroot/mod/ambig.py'" > $TESTTMP/libroot/mod/ambig.py
138
138
139 #if absimport
139 #if absimport
140 $ cat > $TESTTMP/libroot/mod/ambigabs.py <<EOF
140 $ cat > $TESTTMP/libroot/mod/ambigabs.py <<EOF
141 > from __future__ import absolute_import
141 > from __future__ import absolute_import
142 > import ambig # should load "libroot/ambig.py"
142 > import ambig # should load "libroot/ambig.py"
143 > s = ambig.s
143 > s = ambig.s
144 > EOF
144 > EOF
145 $ cat > loadabs.py <<EOF
145 $ cat > loadabs.py <<EOF
146 > import mod.ambigabs as ambigabs
146 > import mod.ambigabs as ambigabs
147 > def extsetup():
147 > def extsetup():
148 > print 'ambigabs.s=%s' % ambigabs.s
148 > print 'ambigabs.s=%s' % ambigabs.s
149 > EOF
149 > EOF
150 $ (PYTHONPATH=${PYTHONPATH}${PATHSEP}${TESTTMP}/libroot; hg --config extensions.loadabs=loadabs.py root)
150 $ (PYTHONPATH=${PYTHONPATH}${PATHSEP}${TESTTMP}/libroot; hg --config extensions.loadabs=loadabs.py root)
151 ambigabs.s=libroot/ambig.py
151 ambigabs.s=libroot/ambig.py
152 $TESTTMP/a (glob)
152 $TESTTMP/a (glob)
153 #endif
153 #endif
154
154
155 #if no-py3k
155 #if no-py3k
156 $ cat > $TESTTMP/libroot/mod/ambigrel.py <<EOF
156 $ cat > $TESTTMP/libroot/mod/ambigrel.py <<EOF
157 > import ambig # should load "libroot/mod/ambig.py"
157 > import ambig # should load "libroot/mod/ambig.py"
158 > s = ambig.s
158 > s = ambig.s
159 > EOF
159 > EOF
160 $ cat > loadrel.py <<EOF
160 $ cat > loadrel.py <<EOF
161 > import mod.ambigrel as ambigrel
161 > import mod.ambigrel as ambigrel
162 > def extsetup():
162 > def extsetup():
163 > print 'ambigrel.s=%s' % ambigrel.s
163 > print 'ambigrel.s=%s' % ambigrel.s
164 > EOF
164 > EOF
165 $ (PYTHONPATH=${PYTHONPATH}${PATHSEP}${TESTTMP}/libroot; hg --config extensions.loadrel=loadrel.py root)
165 $ (PYTHONPATH=${PYTHONPATH}${PATHSEP}${TESTTMP}/libroot; hg --config extensions.loadrel=loadrel.py root)
166 ambigrel.s=libroot/mod/ambig.py
166 ambigrel.s=libroot/mod/ambig.py
167 $TESTTMP/a (glob)
167 $TESTTMP/a (glob)
168 #endif
168 #endif
169
169
170 Check absolute/relative import of extension specific modules
170 Check absolute/relative import of extension specific modules
171
171
172 $ mkdir $TESTTMP/extroot
172 $ mkdir $TESTTMP/extroot
173 $ cat > $TESTTMP/extroot/bar.py <<EOF
173 $ cat > $TESTTMP/extroot/bar.py <<EOF
174 > s = 'this is extroot.bar'
174 > s = 'this is extroot.bar'
175 > EOF
175 > EOF
176 $ mkdir $TESTTMP/extroot/sub1
176 $ mkdir $TESTTMP/extroot/sub1
177 $ cat > $TESTTMP/extroot/sub1/__init__.py <<EOF
177 $ cat > $TESTTMP/extroot/sub1/__init__.py <<EOF
178 > s = 'this is extroot.sub1.__init__'
178 > s = 'this is extroot.sub1.__init__'
179 > EOF
179 > EOF
180 $ cat > $TESTTMP/extroot/sub1/baz.py <<EOF
180 $ cat > $TESTTMP/extroot/sub1/baz.py <<EOF
181 > s = 'this is extroot.sub1.baz'
181 > s = 'this is extroot.sub1.baz'
182 > EOF
182 > EOF
183 $ cat > $TESTTMP/extroot/__init__.py <<EOF
183 $ cat > $TESTTMP/extroot/__init__.py <<EOF
184 > s = 'this is extroot.__init__'
184 > s = 'this is extroot.__init__'
185 > import foo
185 > import foo
186 > def extsetup(ui):
186 > def extsetup(ui):
187 > ui.write('(extroot) ', foo.func(), '\n')
187 > ui.write('(extroot) ', foo.func(), '\n')
188 > ui.flush()
188 > ui.flush()
189 > EOF
189 > EOF
190
190
191 $ cat > $TESTTMP/extroot/foo.py <<EOF
191 $ cat > $TESTTMP/extroot/foo.py <<EOF
192 > # test absolute import
192 > # test absolute import
193 > buf = []
193 > buf = []
194 > def func():
194 > def func():
195 > # "not locals" case
195 > # "not locals" case
196 > import extroot.bar
196 > import extroot.bar
197 > buf.append('import extroot.bar in func(): %s' % extroot.bar.s)
197 > buf.append('import extroot.bar in func(): %s' % extroot.bar.s)
198 > return '\n(extroot) '.join(buf)
198 > return '\n(extroot) '.join(buf)
199 > # "fromlist == ('*',)" case
199 > # "fromlist == ('*',)" case
200 > from extroot.bar import *
200 > from extroot.bar import *
201 > buf.append('from extroot.bar import *: %s' % s)
201 > buf.append('from extroot.bar import *: %s' % s)
202 > # "not fromlist" and "if '.' in name" case
202 > # "not fromlist" and "if '.' in name" case
203 > import extroot.sub1.baz
203 > import extroot.sub1.baz
204 > buf.append('import extroot.sub1.baz: %s' % extroot.sub1.baz.s)
204 > buf.append('import extroot.sub1.baz: %s' % extroot.sub1.baz.s)
205 > # "not fromlist" and NOT "if '.' in name" case
205 > # "not fromlist" and NOT "if '.' in name" case
206 > import extroot
206 > import extroot
207 > buf.append('import extroot: %s' % extroot.s)
207 > buf.append('import extroot: %s' % extroot.s)
208 > # NOT "not fromlist" and NOT "level != -1" case
208 > # NOT "not fromlist" and NOT "level != -1" case
209 > from extroot.bar import s
209 > from extroot.bar import s
210 > buf.append('from extroot.bar import s: %s' % s)
210 > buf.append('from extroot.bar import s: %s' % s)
211 > EOF
211 > EOF
212 $ (PYTHONPATH=${PYTHONPATH}${PATHSEP}${TESTTMP}; hg --config extensions.extroot=$TESTTMP/extroot root)
212 $ (PYTHONPATH=${PYTHONPATH}${PATHSEP}${TESTTMP}; hg --config extensions.extroot=$TESTTMP/extroot root)
213 (extroot) from extroot.bar import *: this is extroot.bar
213 (extroot) from extroot.bar import *: this is extroot.bar
214 (extroot) import extroot.sub1.baz: this is extroot.sub1.baz
214 (extroot) import extroot.sub1.baz: this is extroot.sub1.baz
215 (extroot) import extroot: this is extroot.__init__
215 (extroot) import extroot: this is extroot.__init__
216 (extroot) from extroot.bar import s: this is extroot.bar
216 (extroot) from extroot.bar import s: this is extroot.bar
217 (extroot) import extroot.bar in func(): this is extroot.bar
217 (extroot) import extroot.bar in func(): this is extroot.bar
218 $TESTTMP/a (glob)
218 $TESTTMP/a (glob)
219
219
220 #if no-py3k
220 #if no-py3k
221 $ rm "$TESTTMP"/extroot/foo.*
221 $ rm "$TESTTMP"/extroot/foo.*
222 $ cat > $TESTTMP/extroot/foo.py <<EOF
222 $ cat > $TESTTMP/extroot/foo.py <<EOF
223 > # test relative import
223 > # test relative import
224 > buf = []
224 > buf = []
225 > def func():
225 > def func():
226 > # "not locals" case
226 > # "not locals" case
227 > import bar
227 > import bar
228 > buf.append('import bar in func(): %s' % bar.s)
228 > buf.append('import bar in func(): %s' % bar.s)
229 > return '\n(extroot) '.join(buf)
229 > return '\n(extroot) '.join(buf)
230 > # "fromlist == ('*',)" case
230 > # "fromlist == ('*',)" case
231 > from bar import *
231 > from bar import *
232 > buf.append('from bar import *: %s' % s)
232 > buf.append('from bar import *: %s' % s)
233 > # "not fromlist" and "if '.' in name" case
233 > # "not fromlist" and "if '.' in name" case
234 > import sub1.baz
234 > import sub1.baz
235 > buf.append('import sub1.baz: %s' % sub1.baz.s)
235 > buf.append('import sub1.baz: %s' % sub1.baz.s)
236 > # "not fromlist" and NOT "if '.' in name" case
236 > # "not fromlist" and NOT "if '.' in name" case
237 > import sub1
237 > import sub1
238 > buf.append('import sub1: %s' % sub1.s)
238 > buf.append('import sub1: %s' % sub1.s)
239 > # NOT "not fromlist" and NOT "level != -1" case
239 > # NOT "not fromlist" and NOT "level != -1" case
240 > from bar import s
240 > from bar import s
241 > buf.append('from bar import s: %s' % s)
241 > buf.append('from bar import s: %s' % s)
242 > EOF
242 > EOF
243 $ hg --config extensions.extroot=$TESTTMP/extroot root
243 $ hg --config extensions.extroot=$TESTTMP/extroot root
244 (extroot) from bar import *: this is extroot.bar
244 (extroot) from bar import *: this is extroot.bar
245 (extroot) import sub1.baz: this is extroot.sub1.baz
245 (extroot) import sub1.baz: this is extroot.sub1.baz
246 (extroot) import sub1: this is extroot.sub1.__init__
246 (extroot) import sub1: this is extroot.sub1.__init__
247 (extroot) from bar import s: this is extroot.bar
247 (extroot) from bar import s: this is extroot.bar
248 (extroot) import bar in func(): this is extroot.bar
248 (extroot) import bar in func(): this is extroot.bar
249 $TESTTMP/a (glob)
249 $TESTTMP/a (glob)
250 #endif
250 #endif
251
251
252 #if demandimport absimport
252 #if demandimport absimport
253
253
254 Examine whether module loading is delayed until actual referring, even
254 Examine whether module loading is delayed until actual referring, even
255 though module is imported with "absolute_import" feature.
255 though module is imported with "absolute_import" feature.
256
256
257 Files below in each packages are used for described purpose:
257 Files below in each packages are used for described purpose:
258
258
259 - "called": examine whether "from MODULE import ATTR" works correctly
259 - "called": examine whether "from MODULE import ATTR" works correctly
260 - "unused": examine whether loading is delayed correctly
260 - "unused": examine whether loading is delayed correctly
261 - "used": examine whether "from PACKAGE import MODULE" works correctly
261 - "used": examine whether "from PACKAGE import MODULE" works correctly
262
262
263 Package hierarchy is needed to examine whether demand importing works
263 Package hierarchy is needed to examine whether demand importing works
264 as expected for "from SUB.PACK.AGE import MODULE".
264 as expected for "from SUB.PACK.AGE import MODULE".
265
265
266 Setup "external library" to be imported with "absolute_import"
266 Setup "external library" to be imported with "absolute_import"
267 feature.
267 feature.
268
268
269 $ mkdir -p $TESTTMP/extlibroot/lsub1/lsub2
269 $ mkdir -p $TESTTMP/extlibroot/lsub1/lsub2
270 $ touch $TESTTMP/extlibroot/__init__.py
270 $ touch $TESTTMP/extlibroot/__init__.py
271 $ touch $TESTTMP/extlibroot/lsub1/__init__.py
271 $ touch $TESTTMP/extlibroot/lsub1/__init__.py
272 $ touch $TESTTMP/extlibroot/lsub1/lsub2/__init__.py
272 $ touch $TESTTMP/extlibroot/lsub1/lsub2/__init__.py
273
273
274 $ cat > $TESTTMP/extlibroot/lsub1/lsub2/called.py <<EOF
274 $ cat > $TESTTMP/extlibroot/lsub1/lsub2/called.py <<EOF
275 > def func():
275 > def func():
276 > return "this is extlibroot.lsub1.lsub2.called.func()"
276 > return "this is extlibroot.lsub1.lsub2.called.func()"
277 > EOF
277 > EOF
278 $ cat > $TESTTMP/extlibroot/lsub1/lsub2/unused.py <<EOF
278 $ cat > $TESTTMP/extlibroot/lsub1/lsub2/unused.py <<EOF
279 > raise Exception("extlibroot.lsub1.lsub2.unused is loaded unintentionally")
279 > raise Exception("extlibroot.lsub1.lsub2.unused is loaded unintentionally")
280 > EOF
280 > EOF
281 $ cat > $TESTTMP/extlibroot/lsub1/lsub2/used.py <<EOF
281 $ cat > $TESTTMP/extlibroot/lsub1/lsub2/used.py <<EOF
282 > detail = "this is extlibroot.lsub1.lsub2.used"
282 > detail = "this is extlibroot.lsub1.lsub2.used"
283 > EOF
283 > EOF
284
284
285 Setup sub-package of "external library", which causes instantiation of
285 Setup sub-package of "external library", which causes instantiation of
286 demandmod in "recurse down the module chain" code path. Relative
286 demandmod in "recurse down the module chain" code path. Relative
287 importing with "absolute_import" feature isn't tested, because "level
287 importing with "absolute_import" feature isn't tested, because "level
288 >=1 " doesn't cause instantiation of demandmod.
288 >=1 " doesn't cause instantiation of demandmod.
289
289
290 $ mkdir -p $TESTTMP/extlibroot/recursedown/abs
290 $ mkdir -p $TESTTMP/extlibroot/recursedown/abs
291 $ cat > $TESTTMP/extlibroot/recursedown/abs/used.py <<EOF
291 $ cat > $TESTTMP/extlibroot/recursedown/abs/used.py <<EOF
292 > detail = "this is extlibroot.recursedown.abs.used"
292 > detail = "this is extlibroot.recursedown.abs.used"
293 > EOF
293 > EOF
294 $ cat > $TESTTMP/extlibroot/recursedown/abs/__init__.py <<EOF
294 $ cat > $TESTTMP/extlibroot/recursedown/abs/__init__.py <<EOF
295 > from __future__ import absolute_import
295 > from __future__ import absolute_import
296 > from extlibroot.recursedown.abs.used import detail
296 > from extlibroot.recursedown.abs.used import detail
297 > EOF
297 > EOF
298
298
299 $ mkdir -p $TESTTMP/extlibroot/recursedown/legacy
299 $ mkdir -p $TESTTMP/extlibroot/recursedown/legacy
300 $ cat > $TESTTMP/extlibroot/recursedown/legacy/used.py <<EOF
300 $ cat > $TESTTMP/extlibroot/recursedown/legacy/used.py <<EOF
301 > detail = "this is extlibroot.recursedown.legacy.used"
301 > detail = "this is extlibroot.recursedown.legacy.used"
302 > EOF
302 > EOF
303 $ cat > $TESTTMP/extlibroot/recursedown/legacy/__init__.py <<EOF
303 $ cat > $TESTTMP/extlibroot/recursedown/legacy/__init__.py <<EOF
304 > # legacy style (level == -1) import
304 > # legacy style (level == -1) import
305 > from extlibroot.recursedown.legacy.used import detail
305 > from extlibroot.recursedown.legacy.used import detail
306 > EOF
306 > EOF
307
307
308 $ cat > $TESTTMP/extlibroot/recursedown/__init__.py <<EOF
308 $ cat > $TESTTMP/extlibroot/recursedown/__init__.py <<EOF
309 > from __future__ import absolute_import
309 > from __future__ import absolute_import
310 > from extlibroot.recursedown.abs import detail as absdetail
310 > from extlibroot.recursedown.abs import detail as absdetail
311 > from .legacy import detail as legacydetail
311 > from .legacy import detail as legacydetail
312 > EOF
312 > EOF
313
313
314 Setup extension local modules to be imported with "absolute_import"
314 Setup extension local modules to be imported with "absolute_import"
315 feature.
315 feature.
316
316
317 $ mkdir -p $TESTTMP/absextroot/xsub1/xsub2
317 $ mkdir -p $TESTTMP/absextroot/xsub1/xsub2
318 $ touch $TESTTMP/absextroot/xsub1/__init__.py
318 $ touch $TESTTMP/absextroot/xsub1/__init__.py
319 $ touch $TESTTMP/absextroot/xsub1/xsub2/__init__.py
319 $ touch $TESTTMP/absextroot/xsub1/xsub2/__init__.py
320
320
321 $ cat > $TESTTMP/absextroot/xsub1/xsub2/called.py <<EOF
321 $ cat > $TESTTMP/absextroot/xsub1/xsub2/called.py <<EOF
322 > def func():
322 > def func():
323 > return "this is absextroot.xsub1.xsub2.called.func()"
323 > return "this is absextroot.xsub1.xsub2.called.func()"
324 > EOF
324 > EOF
325 $ cat > $TESTTMP/absextroot/xsub1/xsub2/unused.py <<EOF
325 $ cat > $TESTTMP/absextroot/xsub1/xsub2/unused.py <<EOF
326 > raise Exception("absextroot.xsub1.xsub2.unused is loaded unintentionally")
326 > raise Exception("absextroot.xsub1.xsub2.unused is loaded unintentionally")
327 > EOF
327 > EOF
328 $ cat > $TESTTMP/absextroot/xsub1/xsub2/used.py <<EOF
328 $ cat > $TESTTMP/absextroot/xsub1/xsub2/used.py <<EOF
329 > detail = "this is absextroot.xsub1.xsub2.used"
329 > detail = "this is absextroot.xsub1.xsub2.used"
330 > EOF
330 > EOF
331
331
332 Setup extension local modules to examine whether demand importing
332 Setup extension local modules to examine whether demand importing
333 works as expected in "level > 1" case.
333 works as expected in "level > 1" case.
334
334
335 $ cat > $TESTTMP/absextroot/relimportee.py <<EOF
335 $ cat > $TESTTMP/absextroot/relimportee.py <<EOF
336 > detail = "this is absextroot.relimportee"
336 > detail = "this is absextroot.relimportee"
337 > EOF
337 > EOF
338 $ cat > $TESTTMP/absextroot/xsub1/xsub2/relimporter.py <<EOF
338 $ cat > $TESTTMP/absextroot/xsub1/xsub2/relimporter.py <<EOF
339 > from __future__ import absolute_import
339 > from __future__ import absolute_import
340 > from ... import relimportee
340 > from ... import relimportee
341 > detail = "this relimporter imports %r" % (relimportee.detail)
341 > detail = "this relimporter imports %r" % (relimportee.detail)
342 > EOF
342 > EOF
343
343
344 Setup modules, which actually import extension local modules at
344 Setup modules, which actually import extension local modules at
345 runtime.
345 runtime.
346
346
347 $ cat > $TESTTMP/absextroot/absolute.py << EOF
347 $ cat > $TESTTMP/absextroot/absolute.py << EOF
348 > from __future__ import absolute_import
348 > from __future__ import absolute_import
349 >
349 >
350 > # import extension local modules absolutely (level = 0)
350 > # import extension local modules absolutely (level = 0)
351 > from absextroot.xsub1.xsub2 import used, unused
351 > from absextroot.xsub1.xsub2 import used, unused
352 > from absextroot.xsub1.xsub2.called import func
352 > from absextroot.xsub1.xsub2.called import func
353 >
353 >
354 > def getresult():
354 > def getresult():
355 > result = []
355 > result = []
356 > result.append(used.detail)
356 > result.append(used.detail)
357 > result.append(func())
357 > result.append(func())
358 > return result
358 > return result
359 > EOF
359 > EOF
360
360
361 $ cat > $TESTTMP/absextroot/relative.py << EOF
361 $ cat > $TESTTMP/absextroot/relative.py << EOF
362 > from __future__ import absolute_import
362 > from __future__ import absolute_import
363 >
363 >
364 > # import extension local modules relatively (level == 1)
364 > # import extension local modules relatively (level == 1)
365 > from .xsub1.xsub2 import used, unused
365 > from .xsub1.xsub2 import used, unused
366 > from .xsub1.xsub2.called import func
366 > from .xsub1.xsub2.called import func
367 >
367 >
368 > # import a module, which implies "importing with level > 1"
368 > # import a module, which implies "importing with level > 1"
369 > from .xsub1.xsub2 import relimporter
369 > from .xsub1.xsub2 import relimporter
370 >
370 >
371 > def getresult():
371 > def getresult():
372 > result = []
372 > result = []
373 > result.append(used.detail)
373 > result.append(used.detail)
374 > result.append(func())
374 > result.append(func())
375 > result.append(relimporter.detail)
375 > result.append(relimporter.detail)
376 > return result
376 > return result
377 > EOF
377 > EOF
378
378
379 Setup main procedure of extension.
379 Setup main procedure of extension.
380
380
381 $ cat > $TESTTMP/absextroot/__init__.py <<EOF
381 $ cat > $TESTTMP/absextroot/__init__.py <<EOF
382 > from __future__ import absolute_import
382 > from __future__ import absolute_import
383 > from mercurial import registrar
383 > from mercurial import registrar
384 > cmdtable = {}
384 > cmdtable = {}
385 > command = registrar.command(cmdtable)
385 > command = registrar.command(cmdtable)
386 >
386 >
387 > # "absolute" and "relative" shouldn't be imported before actual
387 > # "absolute" and "relative" shouldn't be imported before actual
388 > # command execution, because (1) they import same modules, and (2)
388 > # command execution, because (1) they import same modules, and (2)
389 > # preceding import (= instantiate "demandmod" object instead of
389 > # preceding import (= instantiate "demandmod" object instead of
390 > # real "module" object) might hide problem of succeeding import.
390 > # real "module" object) might hide problem of succeeding import.
391 >
391 >
392 > @command('showabsolute', [], norepo=True)
392 > @command('showabsolute', [], norepo=True)
393 > def showabsolute(ui, *args, **opts):
393 > def showabsolute(ui, *args, **opts):
394 > from absextroot import absolute
394 > from absextroot import absolute
395 > ui.write('ABS: %s\n' % '\nABS: '.join(absolute.getresult()))
395 > ui.write('ABS: %s\n' % '\nABS: '.join(absolute.getresult()))
396 >
396 >
397 > @command('showrelative', [], norepo=True)
397 > @command('showrelative', [], norepo=True)
398 > def showrelative(ui, *args, **opts):
398 > def showrelative(ui, *args, **opts):
399 > from . import relative
399 > from . import relative
400 > ui.write('REL: %s\n' % '\nREL: '.join(relative.getresult()))
400 > ui.write('REL: %s\n' % '\nREL: '.join(relative.getresult()))
401 >
401 >
402 > # import modules from external library
402 > # import modules from external library
403 > from extlibroot.lsub1.lsub2 import used as lused, unused as lunused
403 > from extlibroot.lsub1.lsub2 import used as lused, unused as lunused
404 > from extlibroot.lsub1.lsub2.called import func as lfunc
404 > from extlibroot.lsub1.lsub2.called import func as lfunc
405 > from extlibroot.recursedown import absdetail, legacydetail
405 > from extlibroot.recursedown import absdetail, legacydetail
406 >
406 >
407 > def uisetup(ui):
407 > def uisetup(ui):
408 > result = []
408 > result = []
409 > result.append(lused.detail)
409 > result.append(lused.detail)
410 > result.append(lfunc())
410 > result.append(lfunc())
411 > result.append(absdetail)
411 > result.append(absdetail)
412 > result.append(legacydetail)
412 > result.append(legacydetail)
413 > ui.write('LIB: %s\n' % '\nLIB: '.join(result))
413 > ui.write('LIB: %s\n' % '\nLIB: '.join(result))
414 > EOF
414 > EOF
415
415
416 Examine module importing.
416 Examine module importing.
417
417
418 $ (PYTHONPATH=${PYTHONPATH}${PATHSEP}${TESTTMP}; hg --config extensions.absextroot=$TESTTMP/absextroot showabsolute)
418 $ (PYTHONPATH=${PYTHONPATH}${PATHSEP}${TESTTMP}; hg --config extensions.absextroot=$TESTTMP/absextroot showabsolute)
419 LIB: this is extlibroot.lsub1.lsub2.used
419 LIB: this is extlibroot.lsub1.lsub2.used
420 LIB: this is extlibroot.lsub1.lsub2.called.func()
420 LIB: this is extlibroot.lsub1.lsub2.called.func()
421 LIB: this is extlibroot.recursedown.abs.used
421 LIB: this is extlibroot.recursedown.abs.used
422 LIB: this is extlibroot.recursedown.legacy.used
422 LIB: this is extlibroot.recursedown.legacy.used
423 ABS: this is absextroot.xsub1.xsub2.used
423 ABS: this is absextroot.xsub1.xsub2.used
424 ABS: this is absextroot.xsub1.xsub2.called.func()
424 ABS: this is absextroot.xsub1.xsub2.called.func()
425
425
426 $ (PYTHONPATH=${PYTHONPATH}${PATHSEP}${TESTTMP}; hg --config extensions.absextroot=$TESTTMP/absextroot showrelative)
426 $ (PYTHONPATH=${PYTHONPATH}${PATHSEP}${TESTTMP}; hg --config extensions.absextroot=$TESTTMP/absextroot showrelative)
427 LIB: this is extlibroot.lsub1.lsub2.used
427 LIB: this is extlibroot.lsub1.lsub2.used
428 LIB: this is extlibroot.lsub1.lsub2.called.func()
428 LIB: this is extlibroot.lsub1.lsub2.called.func()
429 LIB: this is extlibroot.recursedown.abs.used
429 LIB: this is extlibroot.recursedown.abs.used
430 LIB: this is extlibroot.recursedown.legacy.used
430 LIB: this is extlibroot.recursedown.legacy.used
431 REL: this is absextroot.xsub1.xsub2.used
431 REL: this is absextroot.xsub1.xsub2.used
432 REL: this is absextroot.xsub1.xsub2.called.func()
432 REL: this is absextroot.xsub1.xsub2.called.func()
433 REL: this relimporter imports 'this is absextroot.relimportee'
433 REL: this relimporter imports 'this is absextroot.relimportee'
434
434
435 Examine whether sub-module is imported relatively as expected.
435 Examine whether sub-module is imported relatively as expected.
436
436
437 See also issue5208 for detail about example case on Python 3.x.
437 See also issue5208 for detail about example case on Python 3.x.
438
438
439 $ f -q $TESTTMP/extlibroot/lsub1/lsub2/notexist.py
439 $ f -q $TESTTMP/extlibroot/lsub1/lsub2/notexist.py
440 $TESTTMP/extlibroot/lsub1/lsub2/notexist.py: file not found
440 $TESTTMP/extlibroot/lsub1/lsub2/notexist.py: file not found
441
441
442 $ cat > $TESTTMP/notexist.py <<EOF
442 $ cat > $TESTTMP/notexist.py <<EOF
443 > text = 'notexist.py at root is loaded unintentionally\n'
443 > text = 'notexist.py at root is loaded unintentionally\n'
444 > EOF
444 > EOF
445
445
446 $ cat > $TESTTMP/checkrelativity.py <<EOF
446 $ cat > $TESTTMP/checkrelativity.py <<EOF
447 > from mercurial import registrar
447 > from mercurial import registrar
448 > cmdtable = {}
448 > cmdtable = {}
449 > command = registrar.command(cmdtable)
449 > command = registrar.command(cmdtable)
450 >
450 >
451 > # demand import avoids failure of importing notexist here
451 > # demand import avoids failure of importing notexist here
452 > import extlibroot.lsub1.lsub2.notexist
452 > import extlibroot.lsub1.lsub2.notexist
453 >
453 >
454 > @command('checkrelativity', [], norepo=True)
454 > @command('checkrelativity', [], norepo=True)
455 > def checkrelativity(ui, *args, **opts):
455 > def checkrelativity(ui, *args, **opts):
456 > try:
456 > try:
457 > ui.write(extlibroot.lsub1.lsub2.notexist.text)
457 > ui.write(extlibroot.lsub1.lsub2.notexist.text)
458 > return 1 # unintentional success
458 > return 1 # unintentional success
459 > except ImportError:
459 > except ImportError:
460 > pass # intentional failure
460 > pass # intentional failure
461 > EOF
461 > EOF
462
462
463 $ (PYTHONPATH=${PYTHONPATH}${PATHSEP}${TESTTMP}; hg --config extensions.checkrelativity=$TESTTMP/checkrelativity.py checkrelativity)
463 $ (PYTHONPATH=${PYTHONPATH}${PATHSEP}${TESTTMP}; hg --config extensions.checkrelativity=$TESTTMP/checkrelativity.py checkrelativity)
464
464
465 #endif
465 #endif
466
466
467 $ cd ..
467 $ cd ..
468
468
469 hide outer repo
469 hide outer repo
470 $ hg init
470 $ hg init
471
471
472 $ cat > empty.py <<EOF
472 $ cat > empty.py <<EOF
473 > '''empty cmdtable
473 > '''empty cmdtable
474 > '''
474 > '''
475 > cmdtable = {}
475 > cmdtable = {}
476 > EOF
476 > EOF
477 $ emptypath=`pwd`/empty.py
477 $ emptypath=`pwd`/empty.py
478 $ echo "empty = $emptypath" >> $HGRCPATH
478 $ echo "empty = $emptypath" >> $HGRCPATH
479 $ hg help empty
479 $ hg help empty
480 empty extension - empty cmdtable
480 empty extension - empty cmdtable
481
481
482 no commands defined
482 no commands defined
483
483
484
484
485 $ echo 'empty = !' >> $HGRCPATH
485 $ echo 'empty = !' >> $HGRCPATH
486
486
487 $ cat > debugextension.py <<EOF
487 $ cat > debugextension.py <<EOF
488 > '''only debugcommands
488 > '''only debugcommands
489 > '''
489 > '''
490 > from mercurial import registrar
490 > from mercurial import registrar
491 > cmdtable = {}
491 > cmdtable = {}
492 > command = registrar.command(cmdtable)
492 > command = registrar.command(cmdtable)
493 > @command('debugfoobar', [], 'hg debugfoobar')
493 > @command('debugfoobar', [], 'hg debugfoobar')
494 > def debugfoobar(ui, repo, *args, **opts):
494 > def debugfoobar(ui, repo, *args, **opts):
495 > "yet another debug command"
495 > "yet another debug command"
496 > pass
496 > pass
497 > @command('foo', [], 'hg foo')
497 > @command('foo', [], 'hg foo')
498 > def foo(ui, repo, *args, **opts):
498 > def foo(ui, repo, *args, **opts):
499 > """yet another foo command
499 > """yet another foo command
500 > This command has been DEPRECATED since forever.
500 > This command has been DEPRECATED since forever.
501 > """
501 > """
502 > pass
502 > pass
503 > EOF
503 > EOF
504 $ debugpath=`pwd`/debugextension.py
504 $ debugpath=`pwd`/debugextension.py
505 $ echo "debugextension = $debugpath" >> $HGRCPATH
505 $ echo "debugextension = $debugpath" >> $HGRCPATH
506
506
507 $ hg help debugextension
507 $ hg help debugextension
508 hg debugextensions
508 hg debugextensions
509
509
510 show information about active extensions
510 show information about active extensions
511
511
512 options:
512 options:
513
513
514 (some details hidden, use --verbose to show complete help)
514 (some details hidden, use --verbose to show complete help)
515
515
516
516
517 $ hg --verbose help debugextension
517 $ hg --verbose help debugextension
518 hg debugextensions
518 hg debugextensions
519
519
520 show information about active extensions
520 show information about active extensions
521
521
522 options:
522 options:
523
523
524 -T --template TEMPLATE display with template (EXPERIMENTAL)
524 -T --template TEMPLATE display with template (EXPERIMENTAL)
525
525
526 global options ([+] can be repeated):
526 global options ([+] can be repeated):
527
527
528 -R --repository REPO repository root directory or name of overlay bundle
528 -R --repository REPO repository root directory or name of overlay bundle
529 file
529 file
530 --cwd DIR change working directory
530 --cwd DIR change working directory
531 -y --noninteractive do not prompt, automatically pick the first choice for
531 -y --noninteractive do not prompt, automatically pick the first choice for
532 all prompts
532 all prompts
533 -q --quiet suppress output
533 -q --quiet suppress output
534 -v --verbose enable additional output
534 -v --verbose enable additional output
535 --color TYPE when to colorize (boolean, always, auto, never, or
535 --color TYPE when to colorize (boolean, always, auto, never, or
536 debug)
536 debug)
537 --config CONFIG [+] set/override config option (use 'section.name=value')
537 --config CONFIG [+] set/override config option (use 'section.name=value')
538 --debug enable debugging output
538 --debug enable debugging output
539 --debugger start debugger
539 --debugger start debugger
540 --encoding ENCODE set the charset encoding (default: ascii)
540 --encoding ENCODE set the charset encoding (default: ascii)
541 --encodingmode MODE set the charset encoding mode (default: strict)
541 --encodingmode MODE set the charset encoding mode (default: strict)
542 --traceback always print a traceback on exception
542 --traceback always print a traceback on exception
543 --time time how long the command takes
543 --time time how long the command takes
544 --profile print command execution profile
544 --profile print command execution profile
545 --version output version information and exit
545 --version output version information and exit
546 -h --help display help and exit
546 -h --help display help and exit
547 --hidden consider hidden changesets
547 --hidden consider hidden changesets
548 --pager TYPE when to paginate (boolean, always, auto, or never)
548 --pager TYPE when to paginate (boolean, always, auto, or never)
549 (default: auto)
549 (default: auto)
550
550
551
551
552
552
553
553
554
554
555
555
556 $ hg --debug help debugextension
556 $ hg --debug help debugextension
557 hg debugextensions
557 hg debugextensions
558
558
559 show information about active extensions
559 show information about active extensions
560
560
561 options:
561 options:
562
562
563 -T --template TEMPLATE display with template (EXPERIMENTAL)
563 -T --template TEMPLATE display with template (EXPERIMENTAL)
564
564
565 global options ([+] can be repeated):
565 global options ([+] can be repeated):
566
566
567 -R --repository REPO repository root directory or name of overlay bundle
567 -R --repository REPO repository root directory or name of overlay bundle
568 file
568 file
569 --cwd DIR change working directory
569 --cwd DIR change working directory
570 -y --noninteractive do not prompt, automatically pick the first choice for
570 -y --noninteractive do not prompt, automatically pick the first choice for
571 all prompts
571 all prompts
572 -q --quiet suppress output
572 -q --quiet suppress output
573 -v --verbose enable additional output
573 -v --verbose enable additional output
574 --color TYPE when to colorize (boolean, always, auto, never, or
574 --color TYPE when to colorize (boolean, always, auto, never, or
575 debug)
575 debug)
576 --config CONFIG [+] set/override config option (use 'section.name=value')
576 --config CONFIG [+] set/override config option (use 'section.name=value')
577 --debug enable debugging output
577 --debug enable debugging output
578 --debugger start debugger
578 --debugger start debugger
579 --encoding ENCODE set the charset encoding (default: ascii)
579 --encoding ENCODE set the charset encoding (default: ascii)
580 --encodingmode MODE set the charset encoding mode (default: strict)
580 --encodingmode MODE set the charset encoding mode (default: strict)
581 --traceback always print a traceback on exception
581 --traceback always print a traceback on exception
582 --time time how long the command takes
582 --time time how long the command takes
583 --profile print command execution profile
583 --profile print command execution profile
584 --version output version information and exit
584 --version output version information and exit
585 -h --help display help and exit
585 -h --help display help and exit
586 --hidden consider hidden changesets
586 --hidden consider hidden changesets
587 --pager TYPE when to paginate (boolean, always, auto, or never)
587 --pager TYPE when to paginate (boolean, always, auto, or never)
588 (default: auto)
588 (default: auto)
589
589
590
590
591
591
592
592
593
593
594 $ echo 'debugextension = !' >> $HGRCPATH
594 $ echo 'debugextension = !' >> $HGRCPATH
595
595
596 Asking for help about a deprecated extension should do something useful:
596 Asking for help about a deprecated extension should do something useful:
597
597
598 $ hg help glog
598 $ hg help glog
599 'glog' is provided by the following extension:
599 'glog' is provided by the following extension:
600
600
601 graphlog command to view revision graphs from a shell (DEPRECATED)
601 graphlog command to view revision graphs from a shell (DEPRECATED)
602
602
603 (use 'hg help extensions' for information on enabling extensions)
603 (use 'hg help extensions' for information on enabling extensions)
604
604
605 Extension module help vs command help:
605 Extension module help vs command help:
606
606
607 $ echo 'extdiff =' >> $HGRCPATH
607 $ echo 'extdiff =' >> $HGRCPATH
608 $ hg help extdiff
608 $ hg help extdiff
609 hg extdiff [OPT]... [FILE]...
609 hg extdiff [OPT]... [FILE]...
610
610
611 use external program to diff repository (or selected files)
611 use external program to diff repository (or selected files)
612
612
613 Show differences between revisions for the specified files, using an
613 Show differences between revisions for the specified files, using an
614 external program. The default program used is diff, with default options
614 external program. The default program used is diff, with default options
615 "-Npru".
615 "-Npru".
616
616
617 To select a different program, use the -p/--program option. The program
617 To select a different program, use the -p/--program option. The program
618 will be passed the names of two directories to compare. To pass additional
618 will be passed the names of two directories to compare. To pass additional
619 options to the program, use -o/--option. These will be passed before the
619 options to the program, use -o/--option. These will be passed before the
620 names of the directories to compare.
620 names of the directories to compare.
621
621
622 When two revision arguments are given, then changes are shown between
622 When two revision arguments are given, then changes are shown between
623 those revisions. If only one revision is specified then that revision is
623 those revisions. If only one revision is specified then that revision is
624 compared to the working directory, and, when no revisions are specified,
624 compared to the working directory, and, when no revisions are specified,
625 the working directory files are compared to its parent.
625 the working directory files are compared to its parent.
626
626
627 (use 'hg help -e extdiff' to show help for the extdiff extension)
627 (use 'hg help -e extdiff' to show help for the extdiff extension)
628
628
629 options ([+] can be repeated):
629 options ([+] can be repeated):
630
630
631 -p --program CMD comparison program to run
631 -p --program CMD comparison program to run
632 -o --option OPT [+] pass option to comparison program
632 -o --option OPT [+] pass option to comparison program
633 -r --rev REV [+] revision
633 -r --rev REV [+] revision
634 -c --change REV change made by revision
634 -c --change REV change made by revision
635 --patch compare patches for two revisions
635 --patch compare patches for two revisions
636 -I --include PATTERN [+] include names matching the given patterns
636 -I --include PATTERN [+] include names matching the given patterns
637 -X --exclude PATTERN [+] exclude names matching the given patterns
637 -X --exclude PATTERN [+] exclude names matching the given patterns
638 -S --subrepos recurse into subrepositories
638 -S --subrepos recurse into subrepositories
639
639
640 (some details hidden, use --verbose to show complete help)
640 (some details hidden, use --verbose to show complete help)
641
641
642
642
643
643
644
644
645
645
646
646
647
647
648
648
649
649
650
650
651 $ hg help --extension extdiff
651 $ hg help --extension extdiff
652 extdiff extension - command to allow external programs to compare revisions
652 extdiff extension - command to allow external programs to compare revisions
653
653
654 The extdiff Mercurial extension allows you to use external programs to compare
654 The extdiff Mercurial extension allows you to use external programs to compare
655 revisions, or revision with working directory. The external diff programs are
655 revisions, or revision with working directory. The external diff programs are
656 called with a configurable set of options and two non-option arguments: paths
656 called with a configurable set of options and two non-option arguments: paths
657 to directories containing snapshots of files to compare.
657 to directories containing snapshots of files to compare.
658
658
659 The extdiff extension also allows you to configure new diff commands, so you
659 The extdiff extension also allows you to configure new diff commands, so you
660 do not need to type 'hg extdiff -p kdiff3' always.
660 do not need to type 'hg extdiff -p kdiff3' always.
661
661
662 [extdiff]
662 [extdiff]
663 # add new command that runs GNU diff(1) in 'context diff' mode
663 # add new command that runs GNU diff(1) in 'context diff' mode
664 cdiff = gdiff -Nprc5
664 cdiff = gdiff -Nprc5
665 ## or the old way:
665 ## or the old way:
666 #cmd.cdiff = gdiff
666 #cmd.cdiff = gdiff
667 #opts.cdiff = -Nprc5
667 #opts.cdiff = -Nprc5
668
668
669 # add new command called meld, runs meld (no need to name twice). If
669 # add new command called meld, runs meld (no need to name twice). If
670 # the meld executable is not available, the meld tool in [merge-tools]
670 # the meld executable is not available, the meld tool in [merge-tools]
671 # will be used, if available
671 # will be used, if available
672 meld =
672 meld =
673
673
674 # add new command called vimdiff, runs gvimdiff with DirDiff plugin
674 # add new command called vimdiff, runs gvimdiff with DirDiff plugin
675 # (see http://www.vim.org/scripts/script.php?script_id=102) Non
675 # (see http://www.vim.org/scripts/script.php?script_id=102) Non
676 # English user, be sure to put "let g:DirDiffDynamicDiffText = 1" in
676 # English user, be sure to put "let g:DirDiffDynamicDiffText = 1" in
677 # your .vimrc
677 # your .vimrc
678 vimdiff = gvim -f "+next" \
678 vimdiff = gvim -f "+next" \
679 "+execute 'DirDiff' fnameescape(argv(0)) fnameescape(argv(1))"
679 "+execute 'DirDiff' fnameescape(argv(0)) fnameescape(argv(1))"
680
680
681 Tool arguments can include variables that are expanded at runtime:
681 Tool arguments can include variables that are expanded at runtime:
682
682
683 $parent1, $plabel1 - filename, descriptive label of first parent
683 $parent1, $plabel1 - filename, descriptive label of first parent
684 $child, $clabel - filename, descriptive label of child revision
684 $child, $clabel - filename, descriptive label of child revision
685 $parent2, $plabel2 - filename, descriptive label of second parent
685 $parent2, $plabel2 - filename, descriptive label of second parent
686 $root - repository root
686 $root - repository root
687 $parent is an alias for $parent1.
687 $parent is an alias for $parent1.
688
688
689 The extdiff extension will look in your [diff-tools] and [merge-tools]
689 The extdiff extension will look in your [diff-tools] and [merge-tools]
690 sections for diff tool arguments, when none are specified in [extdiff].
690 sections for diff tool arguments, when none are specified in [extdiff].
691
691
692 [extdiff]
692 [extdiff]
693 kdiff3 =
693 kdiff3 =
694
694
695 [diff-tools]
695 [diff-tools]
696 kdiff3.diffargs=--L1 '$plabel1' --L2 '$clabel' $parent $child
696 kdiff3.diffargs=--L1 '$plabel1' --L2 '$clabel' $parent $child
697
697
698 You can use -I/-X and list of file or directory names like normal 'hg diff'
698 You can use -I/-X and list of file or directory names like normal 'hg diff'
699 command. The extdiff extension makes snapshots of only needed files, so
699 command. The extdiff extension makes snapshots of only needed files, so
700 running the external diff program will actually be pretty fast (at least
700 running the external diff program will actually be pretty fast (at least
701 faster than having to compare the entire tree).
701 faster than having to compare the entire tree).
702
702
703 list of commands:
703 list of commands:
704
704
705 extdiff use external program to diff repository (or selected files)
705 extdiff use external program to diff repository (or selected files)
706
706
707 (use 'hg help -v -e extdiff' to show built-in aliases and global options)
707 (use 'hg help -v -e extdiff' to show built-in aliases and global options)
708
708
709
709
710
710
711
711
712
712
713
713
714
714
715
715
716
716
717
717
718
718
719
719
720
720
721
721
722
722
723
723
724 $ echo 'extdiff = !' >> $HGRCPATH
724 $ echo 'extdiff = !' >> $HGRCPATH
725
725
726 Test help topic with same name as extension
726 Test help topic with same name as extension
727
727
728 $ cat > multirevs.py <<EOF
728 $ cat > multirevs.py <<EOF
729 > from mercurial import commands, registrar
729 > from mercurial import commands, registrar
730 > cmdtable = {}
730 > cmdtable = {}
731 > command = registrar.command(cmdtable)
731 > command = registrar.command(cmdtable)
732 > """multirevs extension
732 > """multirevs extension
733 > Big multi-line module docstring."""
733 > Big multi-line module docstring."""
734 > @command('multirevs', [], 'ARG', norepo=True)
734 > @command('multirevs', [], 'ARG', norepo=True)
735 > def multirevs(ui, repo, arg, *args, **opts):
735 > def multirevs(ui, repo, arg, *args, **opts):
736 > """multirevs command"""
736 > """multirevs command"""
737 > pass
737 > pass
738 > EOF
738 > EOF
739 $ echo "multirevs = multirevs.py" >> $HGRCPATH
739 $ echo "multirevs = multirevs.py" >> $HGRCPATH
740
740
741 $ hg help multirevs | tail
741 $ hg help multirevs | tail
742 bookmark (this works because the last revision of the revset is used):
742 bookmark (this works because the last revision of the revset is used):
743
743
744 hg update :@
744 hg update :@
745
745
746 - Show diff between tags 1.3 and 1.5 (this works because the first and the
746 - Show diff between tags 1.3 and 1.5 (this works because the first and the
747 last revisions of the revset are used):
747 last revisions of the revset are used):
748
748
749 hg diff -r 1.3::1.5
749 hg diff -r 1.3::1.5
750
750
751 use 'hg help -c multirevs' to see help for the multirevs command
751 use 'hg help -c multirevs' to see help for the multirevs command
752
752
753
753
754
754
755
755
756
756
757
757
758 $ hg help -c multirevs
758 $ hg help -c multirevs
759 hg multirevs ARG
759 hg multirevs ARG
760
760
761 multirevs command
761 multirevs command
762
762
763 (some details hidden, use --verbose to show complete help)
763 (some details hidden, use --verbose to show complete help)
764
764
765
765
766
766
767 $ hg multirevs
767 $ hg multirevs
768 hg multirevs: invalid arguments
768 hg multirevs: invalid arguments
769 hg multirevs ARG
769 hg multirevs ARG
770
770
771 multirevs command
771 multirevs command
772
772
773 (use 'hg multirevs -h' to show more help)
773 (use 'hg multirevs -h' to show more help)
774 [255]
774 [255]
775
775
776
776
777
777
778 $ echo "multirevs = !" >> $HGRCPATH
778 $ echo "multirevs = !" >> $HGRCPATH
779
779
780 Issue811: Problem loading extensions twice (by site and by user)
780 Issue811: Problem loading extensions twice (by site and by user)
781
781
782 $ cat <<EOF >> $HGRCPATH
782 $ cat <<EOF >> $HGRCPATH
783 > mq =
783 > mq =
784 > strip =
784 > strip =
785 > hgext.mq =
785 > hgext.mq =
786 > hgext/mq =
786 > hgext/mq =
787 > EOF
787 > EOF
788
788
789 Show extensions:
789 Show extensions:
790 (note that mq force load strip, also checking it's not loaded twice)
790 (note that mq force load strip, also checking it's not loaded twice)
791
791
792 $ hg debugextensions
792 $ hg debugextensions
793 mq
793 mq
794 strip
794 strip
795
795
796 For extensions, which name matches one of its commands, help
796 For extensions, which name matches one of its commands, help
797 message should ask '-v -e' to get list of built-in aliases
797 message should ask '-v -e' to get list of built-in aliases
798 along with extension help itself
798 along with extension help itself
799
799
800 $ mkdir $TESTTMP/d
800 $ mkdir $TESTTMP/d
801 $ cat > $TESTTMP/d/dodo.py <<EOF
801 $ cat > $TESTTMP/d/dodo.py <<EOF
802 > """
802 > """
803 > This is an awesome 'dodo' extension. It does nothing and
803 > This is an awesome 'dodo' extension. It does nothing and
804 > writes 'Foo foo'
804 > writes 'Foo foo'
805 > """
805 > """
806 > from mercurial import commands, registrar
806 > from mercurial import commands, registrar
807 > cmdtable = {}
807 > cmdtable = {}
808 > command = registrar.command(cmdtable)
808 > command = registrar.command(cmdtable)
809 > @command('dodo', [], 'hg dodo')
809 > @command('dodo', [], 'hg dodo')
810 > def dodo(ui, *args, **kwargs):
810 > def dodo(ui, *args, **kwargs):
811 > """Does nothing"""
811 > """Does nothing"""
812 > ui.write("I do nothing. Yay\\n")
812 > ui.write("I do nothing. Yay\\n")
813 > @command('foofoo', [], 'hg foofoo')
813 > @command('foofoo', [], 'hg foofoo')
814 > def foofoo(ui, *args, **kwargs):
814 > def foofoo(ui, *args, **kwargs):
815 > """Writes 'Foo foo'"""
815 > """Writes 'Foo foo'"""
816 > ui.write("Foo foo\\n")
816 > ui.write("Foo foo\\n")
817 > EOF
817 > EOF
818 $ dodopath=$TESTTMP/d/dodo.py
818 $ dodopath=$TESTTMP/d/dodo.py
819
819
820 $ echo "dodo = $dodopath" >> $HGRCPATH
820 $ echo "dodo = $dodopath" >> $HGRCPATH
821
821
822 Make sure that user is asked to enter '-v -e' to get list of built-in aliases
822 Make sure that user is asked to enter '-v -e' to get list of built-in aliases
823 $ hg help -e dodo
823 $ hg help -e dodo
824 dodo extension -
824 dodo extension -
825
825
826 This is an awesome 'dodo' extension. It does nothing and writes 'Foo foo'
826 This is an awesome 'dodo' extension. It does nothing and writes 'Foo foo'
827
827
828 list of commands:
828 list of commands:
829
829
830 dodo Does nothing
830 dodo Does nothing
831 foofoo Writes 'Foo foo'
831 foofoo Writes 'Foo foo'
832
832
833 (use 'hg help -v -e dodo' to show built-in aliases and global options)
833 (use 'hg help -v -e dodo' to show built-in aliases and global options)
834
834
835 Make sure that '-v -e' prints list of built-in aliases along with
835 Make sure that '-v -e' prints list of built-in aliases along with
836 extension help itself
836 extension help itself
837 $ hg help -v -e dodo
837 $ hg help -v -e dodo
838 dodo extension -
838 dodo extension -
839
839
840 This is an awesome 'dodo' extension. It does nothing and writes 'Foo foo'
840 This is an awesome 'dodo' extension. It does nothing and writes 'Foo foo'
841
841
842 list of commands:
842 list of commands:
843
843
844 dodo Does nothing
844 dodo Does nothing
845 foofoo Writes 'Foo foo'
845 foofoo Writes 'Foo foo'
846
846
847 global options ([+] can be repeated):
847 global options ([+] can be repeated):
848
848
849 -R --repository REPO repository root directory or name of overlay bundle
849 -R --repository REPO repository root directory or name of overlay bundle
850 file
850 file
851 --cwd DIR change working directory
851 --cwd DIR change working directory
852 -y --noninteractive do not prompt, automatically pick the first choice for
852 -y --noninteractive do not prompt, automatically pick the first choice for
853 all prompts
853 all prompts
854 -q --quiet suppress output
854 -q --quiet suppress output
855 -v --verbose enable additional output
855 -v --verbose enable additional output
856 --color TYPE when to colorize (boolean, always, auto, never, or
856 --color TYPE when to colorize (boolean, always, auto, never, or
857 debug)
857 debug)
858 --config CONFIG [+] set/override config option (use 'section.name=value')
858 --config CONFIG [+] set/override config option (use 'section.name=value')
859 --debug enable debugging output
859 --debug enable debugging output
860 --debugger start debugger
860 --debugger start debugger
861 --encoding ENCODE set the charset encoding (default: ascii)
861 --encoding ENCODE set the charset encoding (default: ascii)
862 --encodingmode MODE set the charset encoding mode (default: strict)
862 --encodingmode MODE set the charset encoding mode (default: strict)
863 --traceback always print a traceback on exception
863 --traceback always print a traceback on exception
864 --time time how long the command takes
864 --time time how long the command takes
865 --profile print command execution profile
865 --profile print command execution profile
866 --version output version information and exit
866 --version output version information and exit
867 -h --help display help and exit
867 -h --help display help and exit
868 --hidden consider hidden changesets
868 --hidden consider hidden changesets
869 --pager TYPE when to paginate (boolean, always, auto, or never)
869 --pager TYPE when to paginate (boolean, always, auto, or never)
870 (default: auto)
870 (default: auto)
871
871
872 Make sure that single '-v' option shows help and built-ins only for 'dodo' command
872 Make sure that single '-v' option shows help and built-ins only for 'dodo' command
873 $ hg help -v dodo
873 $ hg help -v dodo
874 hg dodo
874 hg dodo
875
875
876 Does nothing
876 Does nothing
877
877
878 (use 'hg help -e dodo' to show help for the dodo extension)
878 (use 'hg help -e dodo' to show help for the dodo extension)
879
879
880 options:
880 options:
881
881
882 --mq operate on patch repository
882 --mq operate on patch repository
883
883
884 global options ([+] can be repeated):
884 global options ([+] can be repeated):
885
885
886 -R --repository REPO repository root directory or name of overlay bundle
886 -R --repository REPO repository root directory or name of overlay bundle
887 file
887 file
888 --cwd DIR change working directory
888 --cwd DIR change working directory
889 -y --noninteractive do not prompt, automatically pick the first choice for
889 -y --noninteractive do not prompt, automatically pick the first choice for
890 all prompts
890 all prompts
891 -q --quiet suppress output
891 -q --quiet suppress output
892 -v --verbose enable additional output
892 -v --verbose enable additional output
893 --color TYPE when to colorize (boolean, always, auto, never, or
893 --color TYPE when to colorize (boolean, always, auto, never, or
894 debug)
894 debug)
895 --config CONFIG [+] set/override config option (use 'section.name=value')
895 --config CONFIG [+] set/override config option (use 'section.name=value')
896 --debug enable debugging output
896 --debug enable debugging output
897 --debugger start debugger
897 --debugger start debugger
898 --encoding ENCODE set the charset encoding (default: ascii)
898 --encoding ENCODE set the charset encoding (default: ascii)
899 --encodingmode MODE set the charset encoding mode (default: strict)
899 --encodingmode MODE set the charset encoding mode (default: strict)
900 --traceback always print a traceback on exception
900 --traceback always print a traceback on exception
901 --time time how long the command takes
901 --time time how long the command takes
902 --profile print command execution profile
902 --profile print command execution profile
903 --version output version information and exit
903 --version output version information and exit
904 -h --help display help and exit
904 -h --help display help and exit
905 --hidden consider hidden changesets
905 --hidden consider hidden changesets
906 --pager TYPE when to paginate (boolean, always, auto, or never)
906 --pager TYPE when to paginate (boolean, always, auto, or never)
907 (default: auto)
907 (default: auto)
908
908
909 In case when extension name doesn't match any of its commands,
909 In case when extension name doesn't match any of its commands,
910 help message should ask for '-v' to get list of built-in aliases
910 help message should ask for '-v' to get list of built-in aliases
911 along with extension help
911 along with extension help
912 $ cat > $TESTTMP/d/dudu.py <<EOF
912 $ cat > $TESTTMP/d/dudu.py <<EOF
913 > """
913 > """
914 > This is an awesome 'dudu' extension. It does something and
914 > This is an awesome 'dudu' extension. It does something and
915 > also writes 'Beep beep'
915 > also writes 'Beep beep'
916 > """
916 > """
917 > from mercurial import commands, registrar
917 > from mercurial import commands, registrar
918 > cmdtable = {}
918 > cmdtable = {}
919 > command = registrar.command(cmdtable)
919 > command = registrar.command(cmdtable)
920 > @command('something', [], 'hg something')
920 > @command('something', [], 'hg something')
921 > def something(ui, *args, **kwargs):
921 > def something(ui, *args, **kwargs):
922 > """Does something"""
922 > """Does something"""
923 > ui.write("I do something. Yaaay\\n")
923 > ui.write("I do something. Yaaay\\n")
924 > @command('beep', [], 'hg beep')
924 > @command('beep', [], 'hg beep')
925 > def beep(ui, *args, **kwargs):
925 > def beep(ui, *args, **kwargs):
926 > """Writes 'Beep beep'"""
926 > """Writes 'Beep beep'"""
927 > ui.write("Beep beep\\n")
927 > ui.write("Beep beep\\n")
928 > EOF
928 > EOF
929 $ dudupath=$TESTTMP/d/dudu.py
929 $ dudupath=$TESTTMP/d/dudu.py
930
930
931 $ echo "dudu = $dudupath" >> $HGRCPATH
931 $ echo "dudu = $dudupath" >> $HGRCPATH
932
932
933 $ hg help -e dudu
933 $ hg help -e dudu
934 dudu extension -
934 dudu extension -
935
935
936 This is an awesome 'dudu' extension. It does something and also writes 'Beep
936 This is an awesome 'dudu' extension. It does something and also writes 'Beep
937 beep'
937 beep'
938
938
939 list of commands:
939 list of commands:
940
940
941 beep Writes 'Beep beep'
941 beep Writes 'Beep beep'
942 something Does something
942 something Does something
943
943
944 (use 'hg help -v dudu' to show built-in aliases and global options)
944 (use 'hg help -v dudu' to show built-in aliases and global options)
945
945
946 In case when extension name doesn't match any of its commands,
946 In case when extension name doesn't match any of its commands,
947 help options '-v' and '-v -e' should be equivalent
947 help options '-v' and '-v -e' should be equivalent
948 $ hg help -v dudu
948 $ hg help -v dudu
949 dudu extension -
949 dudu extension -
950
950
951 This is an awesome 'dudu' extension. It does something and also writes 'Beep
951 This is an awesome 'dudu' extension. It does something and also writes 'Beep
952 beep'
952 beep'
953
953
954 list of commands:
954 list of commands:
955
955
956 beep Writes 'Beep beep'
956 beep Writes 'Beep beep'
957 something Does something
957 something Does something
958
958
959 global options ([+] can be repeated):
959 global options ([+] can be repeated):
960
960
961 -R --repository REPO repository root directory or name of overlay bundle
961 -R --repository REPO repository root directory or name of overlay bundle
962 file
962 file
963 --cwd DIR change working directory
963 --cwd DIR change working directory
964 -y --noninteractive do not prompt, automatically pick the first choice for
964 -y --noninteractive do not prompt, automatically pick the first choice for
965 all prompts
965 all prompts
966 -q --quiet suppress output
966 -q --quiet suppress output
967 -v --verbose enable additional output
967 -v --verbose enable additional output
968 --color TYPE when to colorize (boolean, always, auto, never, or
968 --color TYPE when to colorize (boolean, always, auto, never, or
969 debug)
969 debug)
970 --config CONFIG [+] set/override config option (use 'section.name=value')
970 --config CONFIG [+] set/override config option (use 'section.name=value')
971 --debug enable debugging output
971 --debug enable debugging output
972 --debugger start debugger
972 --debugger start debugger
973 --encoding ENCODE set the charset encoding (default: ascii)
973 --encoding ENCODE set the charset encoding (default: ascii)
974 --encodingmode MODE set the charset encoding mode (default: strict)
974 --encodingmode MODE set the charset encoding mode (default: strict)
975 --traceback always print a traceback on exception
975 --traceback always print a traceback on exception
976 --time time how long the command takes
976 --time time how long the command takes
977 --profile print command execution profile
977 --profile print command execution profile
978 --version output version information and exit
978 --version output version information and exit
979 -h --help display help and exit
979 -h --help display help and exit
980 --hidden consider hidden changesets
980 --hidden consider hidden changesets
981 --pager TYPE when to paginate (boolean, always, auto, or never)
981 --pager TYPE when to paginate (boolean, always, auto, or never)
982 (default: auto)
982 (default: auto)
983
983
984 $ hg help -v -e dudu
984 $ hg help -v -e dudu
985 dudu extension -
985 dudu extension -
986
986
987 This is an awesome 'dudu' extension. It does something and also writes 'Beep
987 This is an awesome 'dudu' extension. It does something and also writes 'Beep
988 beep'
988 beep'
989
989
990 list of commands:
990 list of commands:
991
991
992 beep Writes 'Beep beep'
992 beep Writes 'Beep beep'
993 something Does something
993 something Does something
994
994
995 global options ([+] can be repeated):
995 global options ([+] can be repeated):
996
996
997 -R --repository REPO repository root directory or name of overlay bundle
997 -R --repository REPO repository root directory or name of overlay bundle
998 file
998 file
999 --cwd DIR change working directory
999 --cwd DIR change working directory
1000 -y --noninteractive do not prompt, automatically pick the first choice for
1000 -y --noninteractive do not prompt, automatically pick the first choice for
1001 all prompts
1001 all prompts
1002 -q --quiet suppress output
1002 -q --quiet suppress output
1003 -v --verbose enable additional output
1003 -v --verbose enable additional output
1004 --color TYPE when to colorize (boolean, always, auto, never, or
1004 --color TYPE when to colorize (boolean, always, auto, never, or
1005 debug)
1005 debug)
1006 --config CONFIG [+] set/override config option (use 'section.name=value')
1006 --config CONFIG [+] set/override config option (use 'section.name=value')
1007 --debug enable debugging output
1007 --debug enable debugging output
1008 --debugger start debugger
1008 --debugger start debugger
1009 --encoding ENCODE set the charset encoding (default: ascii)
1009 --encoding ENCODE set the charset encoding (default: ascii)
1010 --encodingmode MODE set the charset encoding mode (default: strict)
1010 --encodingmode MODE set the charset encoding mode (default: strict)
1011 --traceback always print a traceback on exception
1011 --traceback always print a traceback on exception
1012 --time time how long the command takes
1012 --time time how long the command takes
1013 --profile print command execution profile
1013 --profile print command execution profile
1014 --version output version information and exit
1014 --version output version information and exit
1015 -h --help display help and exit
1015 -h --help display help and exit
1016 --hidden consider hidden changesets
1016 --hidden consider hidden changesets
1017 --pager TYPE when to paginate (boolean, always, auto, or never)
1017 --pager TYPE when to paginate (boolean, always, auto, or never)
1018 (default: auto)
1018 (default: auto)
1019
1019
1020 Disabled extension commands:
1020 Disabled extension commands:
1021
1021
1022 $ ORGHGRCPATH=$HGRCPATH
1022 $ ORGHGRCPATH=$HGRCPATH
1023 $ HGRCPATH=
1023 $ HGRCPATH=
1024 $ export HGRCPATH
1024 $ export HGRCPATH
1025 $ hg help email
1025 $ hg help email
1026 'email' is provided by the following extension:
1026 'email' is provided by the following extension:
1027
1027
1028 patchbomb command to send changesets as (a series of) patch emails
1028 patchbomb command to send changesets as (a series of) patch emails
1029
1029
1030 (use 'hg help extensions' for information on enabling extensions)
1030 (use 'hg help extensions' for information on enabling extensions)
1031
1031
1032
1032
1033 $ hg qdel
1033 $ hg qdel
1034 hg: unknown command 'qdel'
1034 hg: unknown command 'qdel'
1035 'qdelete' is provided by the following extension:
1035 'qdelete' is provided by the following extension:
1036
1036
1037 mq manage a stack of patches
1037 mq manage a stack of patches
1038
1038
1039 (use 'hg help extensions' for information on enabling extensions)
1039 (use 'hg help extensions' for information on enabling extensions)
1040 [255]
1040 [255]
1041
1041
1042
1042
1043 $ hg churn
1043 $ hg churn
1044 hg: unknown command 'churn'
1044 hg: unknown command 'churn'
1045 'churn' is provided by the following extension:
1045 'churn' is provided by the following extension:
1046
1046
1047 churn command to display statistics about repository history
1047 churn command to display statistics about repository history
1048
1048
1049 (use 'hg help extensions' for information on enabling extensions)
1049 (use 'hg help extensions' for information on enabling extensions)
1050 [255]
1050 [255]
1051
1051
1052
1052
1053
1053
1054 Disabled extensions:
1054 Disabled extensions:
1055
1055
1056 $ hg help churn
1056 $ hg help churn
1057 churn extension - command to display statistics about repository history
1057 churn extension - command to display statistics about repository history
1058
1058
1059 (use 'hg help extensions' for information on enabling extensions)
1059 (use 'hg help extensions' for information on enabling extensions)
1060
1060
1061 $ hg help patchbomb
1061 $ hg help patchbomb
1062 patchbomb extension - command to send changesets as (a series of) patch emails
1062 patchbomb extension - command to send changesets as (a series of) patch emails
1063
1063
1064 The series is started off with a "[PATCH 0 of N]" introduction, which
1064 The series is started off with a "[PATCH 0 of N]" introduction, which
1065 describes the series as a whole.
1065 describes the series as a whole.
1066
1066
1067 Each patch email has a Subject line of "[PATCH M of N] ...", using the first
1067 Each patch email has a Subject line of "[PATCH M of N] ...", using the first
1068 line of the changeset description as the subject text. The message contains
1068 line of the changeset description as the subject text. The message contains
1069 two or three body parts:
1069 two or three body parts:
1070
1070
1071 - The changeset description.
1071 - The changeset description.
1072 - [Optional] The result of running diffstat on the patch.
1072 - [Optional] The result of running diffstat on the patch.
1073 - The patch itself, as generated by 'hg export'.
1073 - The patch itself, as generated by 'hg export'.
1074
1074
1075 Each message refers to the first in the series using the In-Reply-To and
1075 Each message refers to the first in the series using the In-Reply-To and
1076 References headers, so they will show up as a sequence in threaded mail and
1076 References headers, so they will show up as a sequence in threaded mail and
1077 news readers, and in mail archives.
1077 news readers, and in mail archives.
1078
1078
1079 To configure other defaults, add a section like this to your configuration
1079 To configure other defaults, add a section like this to your configuration
1080 file:
1080 file:
1081
1081
1082 [email]
1082 [email]
1083 from = My Name <my@email>
1083 from = My Name <my@email>
1084 to = recipient1, recipient2, ...
1084 to = recipient1, recipient2, ...
1085 cc = cc1, cc2, ...
1085 cc = cc1, cc2, ...
1086 bcc = bcc1, bcc2, ...
1086 bcc = bcc1, bcc2, ...
1087 reply-to = address1, address2, ...
1087 reply-to = address1, address2, ...
1088
1088
1089 Use "[patchbomb]" as configuration section name if you need to override global
1089 Use "[patchbomb]" as configuration section name if you need to override global
1090 "[email]" address settings.
1090 "[email]" address settings.
1091
1091
1092 Then you can use the 'hg email' command to mail a series of changesets as a
1092 Then you can use the 'hg email' command to mail a series of changesets as a
1093 patchbomb.
1093 patchbomb.
1094
1094
1095 You can also either configure the method option in the email section to be a
1095 You can also either configure the method option in the email section to be a
1096 sendmail compatible mailer or fill out the [smtp] section so that the
1096 sendmail compatible mailer or fill out the [smtp] section so that the
1097 patchbomb extension can automatically send patchbombs directly from the
1097 patchbomb extension can automatically send patchbombs directly from the
1098 commandline. See the [email] and [smtp] sections in hgrc(5) for details.
1098 commandline. See the [email] and [smtp] sections in hgrc(5) for details.
1099
1099
1100 By default, 'hg email' will prompt for a "To" or "CC" header if you do not
1100 By default, 'hg email' will prompt for a "To" or "CC" header if you do not
1101 supply one via configuration or the command line. You can override this to
1101 supply one via configuration or the command line. You can override this to
1102 never prompt by configuring an empty value:
1102 never prompt by configuring an empty value:
1103
1103
1104 [email]
1104 [email]
1105 cc =
1105 cc =
1106
1106
1107 You can control the default inclusion of an introduction message with the
1107 You can control the default inclusion of an introduction message with the
1108 "patchbomb.intro" configuration option. The configuration is always
1108 "patchbomb.intro" configuration option. The configuration is always
1109 overwritten by command line flags like --intro and --desc:
1109 overwritten by command line flags like --intro and --desc:
1110
1110
1111 [patchbomb]
1111 [patchbomb]
1112 intro=auto # include introduction message if more than 1 patch (default)
1112 intro=auto # include introduction message if more than 1 patch (default)
1113 intro=never # never include an introduction message
1113 intro=never # never include an introduction message
1114 intro=always # always include an introduction message
1114 intro=always # always include an introduction message
1115
1115
1116 You can specify a template for flags to be added in subject prefixes. Flags
1116 You can specify a template for flags to be added in subject prefixes. Flags
1117 specified by --flag option are exported as "{flags}" keyword:
1117 specified by --flag option are exported as "{flags}" keyword:
1118
1118
1119 [patchbomb]
1119 [patchbomb]
1120 flagtemplate = "{separate(' ',
1120 flagtemplate = "{separate(' ',
1121 ifeq(branch, 'default', '', branch|upper),
1121 ifeq(branch, 'default', '', branch|upper),
1122 flags)}"
1122 flags)}"
1123
1123
1124 You can set patchbomb to always ask for confirmation by setting
1124 You can set patchbomb to always ask for confirmation by setting
1125 "patchbomb.confirm" to true.
1125 "patchbomb.confirm" to true.
1126
1126
1127 (use 'hg help extensions' for information on enabling extensions)
1127 (use 'hg help extensions' for information on enabling extensions)
1128
1128
1129
1129
1130 Broken disabled extension and command:
1130 Broken disabled extension and command:
1131
1131
1132 $ mkdir hgext
1132 $ mkdir hgext
1133 $ echo > hgext/__init__.py
1133 $ echo > hgext/__init__.py
1134 $ cat > hgext/broken.py <<EOF
1134 $ cat > hgext/broken.py <<EOF
1135 > "broken extension'
1135 > "broken extension'
1136 > EOF
1136 > EOF
1137 $ cat > path.py <<EOF
1137 $ cat > path.py <<EOF
1138 > import os, sys
1138 > import os, sys
1139 > sys.path.insert(0, os.environ['HGEXTPATH'])
1139 > sys.path.insert(0, os.environ['HGEXTPATH'])
1140 > EOF
1140 > EOF
1141 $ HGEXTPATH=`pwd`
1141 $ HGEXTPATH=`pwd`
1142 $ export HGEXTPATH
1142 $ export HGEXTPATH
1143
1143
1144 $ hg --config extensions.path=./path.py help broken
1144 $ hg --config extensions.path=./path.py help broken
1145 broken extension - (no help text available)
1145 broken extension - (no help text available)
1146
1146
1147 (use 'hg help extensions' for information on enabling extensions)
1147 (use 'hg help extensions' for information on enabling extensions)
1148
1148
1149
1149
1150 $ cat > hgext/forest.py <<EOF
1150 $ cat > hgext/forest.py <<EOF
1151 > cmdtable = None
1151 > cmdtable = None
1152 > EOF
1152 > EOF
1153 $ hg --config extensions.path=./path.py help foo > /dev/null
1153 $ hg --config extensions.path=./path.py help foo > /dev/null
1154 warning: error finding commands in $TESTTMP/hgext/forest.py (glob)
1154 warning: error finding commands in $TESTTMP/hgext/forest.py (glob)
1155 abort: no such help topic: foo
1155 abort: no such help topic: foo
1156 (try 'hg help --keyword foo')
1156 (try 'hg help --keyword foo')
1157 [255]
1157 [255]
1158
1158
1159 $ cat > throw.py <<EOF
1159 $ cat > throw.py <<EOF
1160 > from mercurial import commands, registrar, util
1160 > from mercurial import commands, registrar, util
1161 > cmdtable = {}
1161 > cmdtable = {}
1162 > command = registrar.command(cmdtable)
1162 > command = registrar.command(cmdtable)
1163 > class Bogon(Exception): pass
1163 > class Bogon(Exception): pass
1164 > @command('throw', [], 'hg throw', norepo=True)
1164 > @command('throw', [], 'hg throw', norepo=True)
1165 > def throw(ui, **opts):
1165 > def throw(ui, **opts):
1166 > """throws an exception"""
1166 > """throws an exception"""
1167 > raise Bogon()
1167 > raise Bogon()
1168 > EOF
1168 > EOF
1169
1169
1170 No declared supported version, extension complains:
1170 No declared supported version, extension complains:
1171 $ hg --config extensions.throw=throw.py throw 2>&1 | egrep '^\*\*'
1171 $ hg --config extensions.throw=throw.py throw 2>&1 | egrep '^\*\*'
1172 ** Unknown exception encountered with possibly-broken third-party extension throw
1172 ** Unknown exception encountered with possibly-broken third-party extension throw
1173 ** which supports versions unknown of Mercurial.
1173 ** which supports versions unknown of Mercurial.
1174 ** Please disable throw and try your action again.
1174 ** Please disable throw and try your action again.
1175 ** If that fixes the bug please report it to the extension author.
1175 ** If that fixes the bug please report it to the extension author.
1176 ** Python * (glob)
1176 ** Python * (glob)
1177 ** Mercurial Distributed SCM * (glob)
1177 ** Mercurial Distributed SCM * (glob)
1178 ** Extensions loaded: throw
1178 ** Extensions loaded: throw
1179
1179
1180 empty declaration of supported version, extension complains:
1180 empty declaration of supported version, extension complains:
1181 $ echo "testedwith = ''" >> throw.py
1181 $ echo "testedwith = ''" >> throw.py
1182 $ hg --config extensions.throw=throw.py throw 2>&1 | egrep '^\*\*'
1182 $ hg --config extensions.throw=throw.py throw 2>&1 | egrep '^\*\*'
1183 ** Unknown exception encountered with possibly-broken third-party extension throw
1183 ** Unknown exception encountered with possibly-broken third-party extension throw
1184 ** which supports versions unknown of Mercurial.
1184 ** which supports versions unknown of Mercurial.
1185 ** Please disable throw and try your action again.
1185 ** Please disable throw and try your action again.
1186 ** If that fixes the bug please report it to the extension author.
1186 ** If that fixes the bug please report it to the extension author.
1187 ** Python * (glob)
1187 ** Python * (glob)
1188 ** Mercurial Distributed SCM (*) (glob)
1188 ** Mercurial Distributed SCM (*) (glob)
1189 ** Extensions loaded: throw
1189 ** Extensions loaded: throw
1190
1190
1191 If the extension specifies a buglink, show that:
1191 If the extension specifies a buglink, show that:
1192 $ echo 'buglink = "http://example.com/bts"' >> throw.py
1192 $ echo 'buglink = "http://example.com/bts"' >> throw.py
1193 $ rm -f throw.pyc throw.pyo
1193 $ rm -f throw.pyc throw.pyo
1194 $ hg --config extensions.throw=throw.py throw 2>&1 | egrep '^\*\*'
1194 $ hg --config extensions.throw=throw.py throw 2>&1 | egrep '^\*\*'
1195 ** Unknown exception encountered with possibly-broken third-party extension throw
1195 ** Unknown exception encountered with possibly-broken third-party extension throw
1196 ** which supports versions unknown of Mercurial.
1196 ** which supports versions unknown of Mercurial.
1197 ** Please disable throw and try your action again.
1197 ** Please disable throw and try your action again.
1198 ** If that fixes the bug please report it to http://example.com/bts
1198 ** If that fixes the bug please report it to http://example.com/bts
1199 ** Python * (glob)
1199 ** Python * (glob)
1200 ** Mercurial Distributed SCM (*) (glob)
1200 ** Mercurial Distributed SCM (*) (glob)
1201 ** Extensions loaded: throw
1201 ** Extensions loaded: throw
1202
1202
1203 If the extensions declare outdated versions, accuse the older extension first:
1203 If the extensions declare outdated versions, accuse the older extension first:
1204 $ echo "from mercurial import util" >> older.py
1204 $ echo "from mercurial import util" >> older.py
1205 $ echo "util.version = lambda:'2.2'" >> older.py
1205 $ echo "util.version = lambda:'2.2'" >> older.py
1206 $ echo "testedwith = '1.9.3'" >> older.py
1206 $ echo "testedwith = '1.9.3'" >> older.py
1207 $ echo "testedwith = '2.1.1'" >> throw.py
1207 $ echo "testedwith = '2.1.1'" >> throw.py
1208 $ rm -f throw.pyc throw.pyo
1208 $ rm -f throw.pyc throw.pyo
1209 $ hg --config extensions.throw=throw.py --config extensions.older=older.py \
1209 $ hg --config extensions.throw=throw.py --config extensions.older=older.py \
1210 > throw 2>&1 | egrep '^\*\*'
1210 > throw 2>&1 | egrep '^\*\*'
1211 ** Unknown exception encountered with possibly-broken third-party extension older
1211 ** Unknown exception encountered with possibly-broken third-party extension older
1212 ** which supports versions 1.9 of Mercurial.
1212 ** which supports versions 1.9 of Mercurial.
1213 ** Please disable older and try your action again.
1213 ** Please disable older and try your action again.
1214 ** If that fixes the bug please report it to the extension author.
1214 ** If that fixes the bug please report it to the extension author.
1215 ** Python * (glob)
1215 ** Python * (glob)
1216 ** Mercurial Distributed SCM (version 2.2)
1216 ** Mercurial Distributed SCM (version 2.2)
1217 ** Extensions loaded: throw, older
1217 ** Extensions loaded: throw, older
1218
1218
1219 One extension only tested with older, one only with newer versions:
1219 One extension only tested with older, one only with newer versions:
1220 $ echo "util.version = lambda:'2.1'" >> older.py
1220 $ echo "util.version = lambda:'2.1'" >> older.py
1221 $ rm -f older.pyc older.pyo
1221 $ rm -f older.pyc older.pyo
1222 $ hg --config extensions.throw=throw.py --config extensions.older=older.py \
1222 $ hg --config extensions.throw=throw.py --config extensions.older=older.py \
1223 > throw 2>&1 | egrep '^\*\*'
1223 > throw 2>&1 | egrep '^\*\*'
1224 ** Unknown exception encountered with possibly-broken third-party extension older
1224 ** Unknown exception encountered with possibly-broken third-party extension older
1225 ** which supports versions 1.9 of Mercurial.
1225 ** which supports versions 1.9 of Mercurial.
1226 ** Please disable older and try your action again.
1226 ** Please disable older and try your action again.
1227 ** If that fixes the bug please report it to the extension author.
1227 ** If that fixes the bug please report it to the extension author.
1228 ** Python * (glob)
1228 ** Python * (glob)
1229 ** Mercurial Distributed SCM (version 2.1)
1229 ** Mercurial Distributed SCM (version 2.1)
1230 ** Extensions loaded: throw, older
1230 ** Extensions loaded: throw, older
1231
1231
1232 Older extension is tested with current version, the other only with newer:
1232 Older extension is tested with current version, the other only with newer:
1233 $ echo "util.version = lambda:'1.9.3'" >> older.py
1233 $ echo "util.version = lambda:'1.9.3'" >> older.py
1234 $ rm -f older.pyc older.pyo
1234 $ rm -f older.pyc older.pyo
1235 $ hg --config extensions.throw=throw.py --config extensions.older=older.py \
1235 $ hg --config extensions.throw=throw.py --config extensions.older=older.py \
1236 > throw 2>&1 | egrep '^\*\*'
1236 > throw 2>&1 | egrep '^\*\*'
1237 ** Unknown exception encountered with possibly-broken third-party extension throw
1237 ** Unknown exception encountered with possibly-broken third-party extension throw
1238 ** which supports versions 2.1 of Mercurial.
1238 ** which supports versions 2.1 of Mercurial.
1239 ** Please disable throw and try your action again.
1239 ** Please disable throw and try your action again.
1240 ** If that fixes the bug please report it to http://example.com/bts
1240 ** If that fixes the bug please report it to http://example.com/bts
1241 ** Python * (glob)
1241 ** Python * (glob)
1242 ** Mercurial Distributed SCM (version 1.9.3)
1242 ** Mercurial Distributed SCM (version 1.9.3)
1243 ** Extensions loaded: throw, older
1243 ** Extensions loaded: throw, older
1244
1244
1245 Ability to point to a different point
1245 Ability to point to a different point
1246 $ hg --config extensions.throw=throw.py --config extensions.older=older.py \
1246 $ hg --config extensions.throw=throw.py --config extensions.older=older.py \
1247 > --config ui.supportcontact='Your Local Goat Lenders' throw 2>&1 | egrep '^\*\*'
1247 > --config ui.supportcontact='Your Local Goat Lenders' throw 2>&1 | egrep '^\*\*'
1248 ** unknown exception encountered, please report by visiting
1248 ** unknown exception encountered, please report by visiting
1249 ** Your Local Goat Lenders
1249 ** Your Local Goat Lenders
1250 ** Python * (glob)
1250 ** Python * (glob)
1251 ** Mercurial Distributed SCM (*) (glob)
1251 ** Mercurial Distributed SCM (*) (glob)
1252 ** Extensions loaded: throw, older
1252 ** Extensions loaded: throw, older
1253
1253
1254 Declare the version as supporting this hg version, show regular bts link:
1254 Declare the version as supporting this hg version, show regular bts link:
1255 $ hgver=`hg debuginstall -T '{hgver}'`
1255 $ hgver=`hg debuginstall -T '{hgver}'`
1256 $ echo 'testedwith = """'"$hgver"'"""' >> throw.py
1256 $ echo 'testedwith = """'"$hgver"'"""' >> throw.py
1257 $ if [ -z "$hgver" ]; then
1257 $ if [ -z "$hgver" ]; then
1258 > echo "unable to fetch a mercurial version. Make sure __version__ is correct";
1258 > echo "unable to fetch a mercurial version. Make sure __version__ is correct";
1259 > fi
1259 > fi
1260 $ rm -f throw.pyc throw.pyo
1260 $ rm -f throw.pyc throw.pyo
1261 $ hg --config extensions.throw=throw.py throw 2>&1 | egrep '^\*\*'
1261 $ hg --config extensions.throw=throw.py throw 2>&1 | egrep '^\*\*'
1262 ** unknown exception encountered, please report by visiting
1262 ** unknown exception encountered, please report by visiting
1263 ** https://mercurial-scm.org/wiki/BugTracker
1263 ** https://mercurial-scm.org/wiki/BugTracker
1264 ** Python * (glob)
1264 ** Python * (glob)
1265 ** Mercurial Distributed SCM (*) (glob)
1265 ** Mercurial Distributed SCM (*) (glob)
1266 ** Extensions loaded: throw
1266 ** Extensions loaded: throw
1267
1267
1268 Patch version is ignored during compatibility check
1268 Patch version is ignored during compatibility check
1269 $ echo "testedwith = '3.2'" >> throw.py
1269 $ echo "testedwith = '3.2'" >> throw.py
1270 $ echo "util.version = lambda:'3.2.2'" >> throw.py
1270 $ echo "util.version = lambda:'3.2.2'" >> throw.py
1271 $ rm -f throw.pyc throw.pyo
1271 $ rm -f throw.pyc throw.pyo
1272 $ hg --config extensions.throw=throw.py throw 2>&1 | egrep '^\*\*'
1272 $ hg --config extensions.throw=throw.py throw 2>&1 | egrep '^\*\*'
1273 ** unknown exception encountered, please report by visiting
1273 ** unknown exception encountered, please report by visiting
1274 ** https://mercurial-scm.org/wiki/BugTracker
1274 ** https://mercurial-scm.org/wiki/BugTracker
1275 ** Python * (glob)
1275 ** Python * (glob)
1276 ** Mercurial Distributed SCM (*) (glob)
1276 ** Mercurial Distributed SCM (*) (glob)
1277 ** Extensions loaded: throw
1277 ** Extensions loaded: throw
1278
1278
1279 Test version number support in 'hg version':
1279 Test version number support in 'hg version':
1280 $ echo '__version__ = (1, 2, 3)' >> throw.py
1280 $ echo '__version__ = (1, 2, 3)' >> throw.py
1281 $ rm -f throw.pyc throw.pyo
1281 $ rm -f throw.pyc throw.pyo
1282 $ hg version -v
1282 $ hg version -v
1283 Mercurial Distributed SCM (version *) (glob)
1283 Mercurial Distributed SCM (version *) (glob)
1284 (see https://mercurial-scm.org for more information)
1284 (see https://mercurial-scm.org for more information)
1285
1285
1286 Copyright (C) 2005-* Matt Mackall and others (glob)
1286 Copyright (C) 2005-* Matt Mackall and others (glob)
1287 This is free software; see the source for copying conditions. There is NO
1287 This is free software; see the source for copying conditions. There is NO
1288 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
1288 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
1289
1289
1290 Enabled extensions:
1290 Enabled extensions:
1291
1291
1292
1292
1293 $ hg version -v --config extensions.throw=throw.py
1293 $ hg version -v --config extensions.throw=throw.py
1294 Mercurial Distributed SCM (version *) (glob)
1294 Mercurial Distributed SCM (version *) (glob)
1295 (see https://mercurial-scm.org for more information)
1295 (see https://mercurial-scm.org for more information)
1296
1296
1297 Copyright (C) 2005-* Matt Mackall and others (glob)
1297 Copyright (C) 2005-* Matt Mackall and others (glob)
1298 This is free software; see the source for copying conditions. There is NO
1298 This is free software; see the source for copying conditions. There is NO
1299 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
1299 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
1300
1300
1301 Enabled extensions:
1301 Enabled extensions:
1302
1302
1303 throw external 1.2.3
1303 throw external 1.2.3
1304 $ echo 'getversion = lambda: "1.twentythree"' >> throw.py
1304 $ echo 'getversion = lambda: "1.twentythree"' >> throw.py
1305 $ rm -f throw.pyc throw.pyo
1305 $ rm -f throw.pyc throw.pyo
1306 $ hg version -v --config extensions.throw=throw.py --config extensions.strip=
1306 $ hg version -v --config extensions.throw=throw.py --config extensions.strip=
1307 Mercurial Distributed SCM (version *) (glob)
1307 Mercurial Distributed SCM (version *) (glob)
1308 (see https://mercurial-scm.org for more information)
1308 (see https://mercurial-scm.org for more information)
1309
1309
1310 Copyright (C) 2005-* Matt Mackall and others (glob)
1310 Copyright (C) 2005-* Matt Mackall and others (glob)
1311 This is free software; see the source for copying conditions. There is NO
1311 This is free software; see the source for copying conditions. There is NO
1312 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
1312 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
1313
1313
1314 Enabled extensions:
1314 Enabled extensions:
1315
1315
1316 throw external 1.twentythree
1316 throw external 1.twentythree
1317 strip internal
1317 strip internal
1318
1318
1319 $ hg version -q --config extensions.throw=throw.py
1319 $ hg version -q --config extensions.throw=throw.py
1320 Mercurial Distributed SCM (version *) (glob)
1320 Mercurial Distributed SCM (version *) (glob)
1321
1321
1322 Test JSON output of version:
1322 Test JSON output of version:
1323
1323
1324 $ hg version -Tjson
1324 $ hg version -Tjson
1325 [
1325 [
1326 {
1326 {
1327 "extensions": [],
1327 "extensions": [],
1328 "ver": "*" (glob)
1328 "ver": "*" (glob)
1329 }
1329 }
1330 ]
1330 ]
1331
1331
1332 $ hg version --config extensions.throw=throw.py -Tjson
1332 $ hg version --config extensions.throw=throw.py -Tjson
1333 [
1333 [
1334 {
1334 {
1335 "extensions": [{"bundled": false, "name": "throw", "ver": "1.twentythree"}],
1335 "extensions": [{"bundled": false, "name": "throw", "ver": "1.twentythree"}],
1336 "ver": "3.2.2"
1336 "ver": "3.2.2"
1337 }
1337 }
1338 ]
1338 ]
1339
1339
1340 $ hg version --config extensions.strip= -Tjson
1340 $ hg version --config extensions.strip= -Tjson
1341 [
1341 [
1342 {
1342 {
1343 "extensions": [{"bundled": true, "name": "strip", "ver": null}],
1343 "extensions": [{"bundled": true, "name": "strip", "ver": null}],
1344 "ver": "*" (glob)
1344 "ver": "*" (glob)
1345 }
1345 }
1346 ]
1346 ]
1347
1347
1348 Test template output of version:
1348 Test template output of version:
1349
1349
1350 $ hg version --config extensions.throw=throw.py --config extensions.strip= \
1350 $ hg version --config extensions.throw=throw.py --config extensions.strip= \
1351 > -T'{extensions % "{name} {pad(ver, 16)} ({if(bundled, "internal", "external")})\n"}'
1351 > -T'{extensions % "{name} {pad(ver, 16)} ({if(bundled, "internal", "external")})\n"}'
1352 throw 1.twentythree (external)
1352 throw 1.twentythree (external)
1353 strip (internal)
1353 strip (internal)
1354
1354
1355 Refuse to load extensions with minimum version requirements
1355 Refuse to load extensions with minimum version requirements
1356
1356
1357 $ cat > minversion1.py << EOF
1357 $ cat > minversion1.py << EOF
1358 > from mercurial import util
1358 > from mercurial import util
1359 > util.version = lambda: '3.5.2'
1359 > util.version = lambda: '3.5.2'
1360 > minimumhgversion = '3.6'
1360 > minimumhgversion = '3.6'
1361 > EOF
1361 > EOF
1362 $ hg --config extensions.minversion=minversion1.py version
1362 $ hg --config extensions.minversion=minversion1.py version
1363 (third party extension minversion requires version 3.6 or newer of Mercurial; disabling)
1363 (third party extension minversion requires version 3.6 or newer of Mercurial; disabling)
1364 Mercurial Distributed SCM (version 3.5.2)
1364 Mercurial Distributed SCM (version 3.5.2)
1365 (see https://mercurial-scm.org for more information)
1365 (see https://mercurial-scm.org for more information)
1366
1366
1367 Copyright (C) 2005-* Matt Mackall and others (glob)
1367 Copyright (C) 2005-* Matt Mackall and others (glob)
1368 This is free software; see the source for copying conditions. There is NO
1368 This is free software; see the source for copying conditions. There is NO
1369 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
1369 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
1370
1370
1371 $ cat > minversion2.py << EOF
1371 $ cat > minversion2.py << EOF
1372 > from mercurial import util
1372 > from mercurial import util
1373 > util.version = lambda: '3.6'
1373 > util.version = lambda: '3.6'
1374 > minimumhgversion = '3.7'
1374 > minimumhgversion = '3.7'
1375 > EOF
1375 > EOF
1376 $ hg --config extensions.minversion=minversion2.py version 2>&1 | egrep '\(third'
1376 $ hg --config extensions.minversion=minversion2.py version 2>&1 | egrep '\(third'
1377 (third party extension minversion requires version 3.7 or newer of Mercurial; disabling)
1377 (third party extension minversion requires version 3.7 or newer of Mercurial; disabling)
1378
1378
1379 Can load version that is only off by point release
1379 Can load version that is only off by point release
1380
1380
1381 $ cat > minversion2.py << EOF
1381 $ cat > minversion2.py << EOF
1382 > from mercurial import util
1382 > from mercurial import util
1383 > util.version = lambda: '3.6.1'
1383 > util.version = lambda: '3.6.1'
1384 > minimumhgversion = '3.6'
1384 > minimumhgversion = '3.6'
1385 > EOF
1385 > EOF
1386 $ hg --config extensions.minversion=minversion3.py version 2>&1 | egrep '\(third'
1386 $ hg --config extensions.minversion=minversion3.py version 2>&1 | egrep '\(third'
1387 [1]
1387 [1]
1388
1388
1389 Can load minimum version identical to current
1389 Can load minimum version identical to current
1390
1390
1391 $ cat > minversion3.py << EOF
1391 $ cat > minversion3.py << EOF
1392 > from mercurial import util
1392 > from mercurial import util
1393 > util.version = lambda: '3.5'
1393 > util.version = lambda: '3.5'
1394 > minimumhgversion = '3.5'
1394 > minimumhgversion = '3.5'
1395 > EOF
1395 > EOF
1396 $ hg --config extensions.minversion=minversion3.py version 2>&1 | egrep '\(third'
1396 $ hg --config extensions.minversion=minversion3.py version 2>&1 | egrep '\(third'
1397 [1]
1397 [1]
1398
1398
1399 Restore HGRCPATH
1399 Restore HGRCPATH
1400
1400
1401 $ HGRCPATH=$ORGHGRCPATH
1401 $ HGRCPATH=$ORGHGRCPATH
1402 $ export HGRCPATH
1402 $ export HGRCPATH
1403
1403
1404 Commands handling multiple repositories at a time should invoke only
1404 Commands handling multiple repositories at a time should invoke only
1405 "reposetup()" of extensions enabling in the target repository.
1405 "reposetup()" of extensions enabling in the target repository.
1406
1406
1407 $ mkdir reposetup-test
1407 $ mkdir reposetup-test
1408 $ cd reposetup-test
1408 $ cd reposetup-test
1409
1409
1410 $ cat > $TESTTMP/reposetuptest.py <<EOF
1410 $ cat > $TESTTMP/reposetuptest.py <<EOF
1411 > from mercurial import extensions
1411 > from mercurial import extensions
1412 > def reposetup(ui, repo):
1412 > def reposetup(ui, repo):
1413 > ui.write('reposetup() for %s\n' % (repo.root))
1413 > ui.write('reposetup() for %s\n' % (repo.root))
1414 > ui.flush()
1414 > ui.flush()
1415 > EOF
1415 > EOF
1416 $ hg init src
1416 $ hg init src
1417 $ echo a > src/a
1417 $ echo a > src/a
1418 $ hg -R src commit -Am '#0 at src/a'
1418 $ hg -R src commit -Am '#0 at src/a'
1419 adding a
1419 adding a
1420 $ echo '[extensions]' >> src/.hg/hgrc
1420 $ echo '[extensions]' >> src/.hg/hgrc
1421 $ echo '# enable extension locally' >> src/.hg/hgrc
1421 $ echo '# enable extension locally' >> src/.hg/hgrc
1422 $ echo "reposetuptest = $TESTTMP/reposetuptest.py" >> src/.hg/hgrc
1422 $ echo "reposetuptest = $TESTTMP/reposetuptest.py" >> src/.hg/hgrc
1423 $ hg -R src status
1423 $ hg -R src status
1424 reposetup() for $TESTTMP/reposetup-test/src (glob)
1424 reposetup() for $TESTTMP/reposetup-test/src (glob)
1425
1425
1426 $ hg clone -U src clone-dst1
1426 $ hg clone -U src clone-dst1
1427 reposetup() for $TESTTMP/reposetup-test/src (glob)
1427 reposetup() for $TESTTMP/reposetup-test/src (glob)
1428 $ hg init push-dst1
1428 $ hg init push-dst1
1429 $ hg -q -R src push push-dst1
1429 $ hg -q -R src push push-dst1
1430 reposetup() for $TESTTMP/reposetup-test/src (glob)
1430 reposetup() for $TESTTMP/reposetup-test/src (glob)
1431 $ hg init pull-src1
1431 $ hg init pull-src1
1432 $ hg -q -R pull-src1 pull src
1432 $ hg -q -R pull-src1 pull src
1433 reposetup() for $TESTTMP/reposetup-test/src (glob)
1433 reposetup() for $TESTTMP/reposetup-test/src (glob)
1434
1434
1435 $ cat <<EOF >> $HGRCPATH
1435 $ cat <<EOF >> $HGRCPATH
1436 > [extensions]
1436 > [extensions]
1437 > # disable extension globally and explicitly
1437 > # disable extension globally and explicitly
1438 > reposetuptest = !
1438 > reposetuptest = !
1439 > EOF
1439 > EOF
1440 $ hg clone -U src clone-dst2
1440 $ hg clone -U src clone-dst2
1441 reposetup() for $TESTTMP/reposetup-test/src (glob)
1441 reposetup() for $TESTTMP/reposetup-test/src (glob)
1442 $ hg init push-dst2
1442 $ hg init push-dst2
1443 $ hg -q -R src push push-dst2
1443 $ hg -q -R src push push-dst2
1444 reposetup() for $TESTTMP/reposetup-test/src (glob)
1444 reposetup() for $TESTTMP/reposetup-test/src (glob)
1445 $ hg init pull-src2
1445 $ hg init pull-src2
1446 $ hg -q -R pull-src2 pull src
1446 $ hg -q -R pull-src2 pull src
1447 reposetup() for $TESTTMP/reposetup-test/src (glob)
1447 reposetup() for $TESTTMP/reposetup-test/src (glob)
1448
1448
1449 $ cat <<EOF >> $HGRCPATH
1449 $ cat <<EOF >> $HGRCPATH
1450 > [extensions]
1450 > [extensions]
1451 > # enable extension globally
1451 > # enable extension globally
1452 > reposetuptest = $TESTTMP/reposetuptest.py
1452 > reposetuptest = $TESTTMP/reposetuptest.py
1453 > EOF
1453 > EOF
1454 $ hg clone -U src clone-dst3
1454 $ hg clone -U src clone-dst3
1455 reposetup() for $TESTTMP/reposetup-test/src (glob)
1455 reposetup() for $TESTTMP/reposetup-test/src (glob)
1456 reposetup() for $TESTTMP/reposetup-test/clone-dst3 (glob)
1456 reposetup() for $TESTTMP/reposetup-test/clone-dst3 (glob)
1457 $ hg init push-dst3
1457 $ hg init push-dst3
1458 reposetup() for $TESTTMP/reposetup-test/push-dst3 (glob)
1458 reposetup() for $TESTTMP/reposetup-test/push-dst3 (glob)
1459 $ hg -q -R src push push-dst3
1459 $ hg -q -R src push push-dst3
1460 reposetup() for $TESTTMP/reposetup-test/src (glob)
1460 reposetup() for $TESTTMP/reposetup-test/src (glob)
1461 reposetup() for $TESTTMP/reposetup-test/push-dst3 (glob)
1461 reposetup() for $TESTTMP/reposetup-test/push-dst3 (glob)
1462 $ hg init pull-src3
1462 $ hg init pull-src3
1463 reposetup() for $TESTTMP/reposetup-test/pull-src3 (glob)
1463 reposetup() for $TESTTMP/reposetup-test/pull-src3 (glob)
1464 $ hg -q -R pull-src3 pull src
1464 $ hg -q -R pull-src3 pull src
1465 reposetup() for $TESTTMP/reposetup-test/pull-src3 (glob)
1465 reposetup() for $TESTTMP/reposetup-test/pull-src3 (glob)
1466 reposetup() for $TESTTMP/reposetup-test/src (glob)
1466 reposetup() for $TESTTMP/reposetup-test/src (glob)
1467
1467
1468 $ echo '[extensions]' >> src/.hg/hgrc
1468 $ echo '[extensions]' >> src/.hg/hgrc
1469 $ echo '# disable extension locally' >> src/.hg/hgrc
1469 $ echo '# disable extension locally' >> src/.hg/hgrc
1470 $ echo 'reposetuptest = !' >> src/.hg/hgrc
1470 $ echo 'reposetuptest = !' >> src/.hg/hgrc
1471 $ hg clone -U src clone-dst4
1471 $ hg clone -U src clone-dst4
1472 reposetup() for $TESTTMP/reposetup-test/clone-dst4 (glob)
1472 reposetup() for $TESTTMP/reposetup-test/clone-dst4 (glob)
1473 $ hg init push-dst4
1473 $ hg init push-dst4
1474 reposetup() for $TESTTMP/reposetup-test/push-dst4 (glob)
1474 reposetup() for $TESTTMP/reposetup-test/push-dst4 (glob)
1475 $ hg -q -R src push push-dst4
1475 $ hg -q -R src push push-dst4
1476 reposetup() for $TESTTMP/reposetup-test/push-dst4 (glob)
1476 reposetup() for $TESTTMP/reposetup-test/push-dst4 (glob)
1477 $ hg init pull-src4
1477 $ hg init pull-src4
1478 reposetup() for $TESTTMP/reposetup-test/pull-src4 (glob)
1478 reposetup() for $TESTTMP/reposetup-test/pull-src4 (glob)
1479 $ hg -q -R pull-src4 pull src
1479 $ hg -q -R pull-src4 pull src
1480 reposetup() for $TESTTMP/reposetup-test/pull-src4 (glob)
1480 reposetup() for $TESTTMP/reposetup-test/pull-src4 (glob)
1481
1481
1482 disabling in command line overlays with all configuration
1482 disabling in command line overlays with all configuration
1483 $ hg --config extensions.reposetuptest=! clone -U src clone-dst5
1483 $ hg --config extensions.reposetuptest=! clone -U src clone-dst5
1484 $ hg --config extensions.reposetuptest=! init push-dst5
1484 $ hg --config extensions.reposetuptest=! init push-dst5
1485 $ hg --config extensions.reposetuptest=! -q -R src push push-dst5
1485 $ hg --config extensions.reposetuptest=! -q -R src push push-dst5
1486 $ hg --config extensions.reposetuptest=! init pull-src5
1486 $ hg --config extensions.reposetuptest=! init pull-src5
1487 $ hg --config extensions.reposetuptest=! -q -R pull-src5 pull src
1487 $ hg --config extensions.reposetuptest=! -q -R pull-src5 pull src
1488
1488
1489 $ cat <<EOF >> $HGRCPATH
1489 $ cat <<EOF >> $HGRCPATH
1490 > [extensions]
1490 > [extensions]
1491 > # disable extension globally and explicitly
1491 > # disable extension globally and explicitly
1492 > reposetuptest = !
1492 > reposetuptest = !
1493 > EOF
1493 > EOF
1494 $ hg init parent
1494 $ hg init parent
1495 $ hg init parent/sub1
1495 $ hg init parent/sub1
1496 $ echo 1 > parent/sub1/1
1496 $ echo 1 > parent/sub1/1
1497 $ hg -R parent/sub1 commit -Am '#0 at parent/sub1'
1497 $ hg -R parent/sub1 commit -Am '#0 at parent/sub1'
1498 adding 1
1498 adding 1
1499 $ hg init parent/sub2
1499 $ hg init parent/sub2
1500 $ hg init parent/sub2/sub21
1500 $ hg init parent/sub2/sub21
1501 $ echo 21 > parent/sub2/sub21/21
1501 $ echo 21 > parent/sub2/sub21/21
1502 $ hg -R parent/sub2/sub21 commit -Am '#0 at parent/sub2/sub21'
1502 $ hg -R parent/sub2/sub21 commit -Am '#0 at parent/sub2/sub21'
1503 adding 21
1503 adding 21
1504 $ cat > parent/sub2/.hgsub <<EOF
1504 $ cat > parent/sub2/.hgsub <<EOF
1505 > sub21 = sub21
1505 > sub21 = sub21
1506 > EOF
1506 > EOF
1507 $ hg -R parent/sub2 commit -Am '#0 at parent/sub2'
1507 $ hg -R parent/sub2 commit -Am '#0 at parent/sub2'
1508 adding .hgsub
1508 adding .hgsub
1509 $ hg init parent/sub3
1509 $ hg init parent/sub3
1510 $ echo 3 > parent/sub3/3
1510 $ echo 3 > parent/sub3/3
1511 $ hg -R parent/sub3 commit -Am '#0 at parent/sub3'
1511 $ hg -R parent/sub3 commit -Am '#0 at parent/sub3'
1512 adding 3
1512 adding 3
1513 $ cat > parent/.hgsub <<EOF
1513 $ cat > parent/.hgsub <<EOF
1514 > sub1 = sub1
1514 > sub1 = sub1
1515 > sub2 = sub2
1515 > sub2 = sub2
1516 > sub3 = sub3
1516 > sub3 = sub3
1517 > EOF
1517 > EOF
1518 $ hg -R parent commit -Am '#0 at parent'
1518 $ hg -R parent commit -Am '#0 at parent'
1519 adding .hgsub
1519 adding .hgsub
1520 $ echo '[extensions]' >> parent/.hg/hgrc
1520 $ echo '[extensions]' >> parent/.hg/hgrc
1521 $ echo '# enable extension locally' >> parent/.hg/hgrc
1521 $ echo '# enable extension locally' >> parent/.hg/hgrc
1522 $ echo "reposetuptest = $TESTTMP/reposetuptest.py" >> parent/.hg/hgrc
1522 $ echo "reposetuptest = $TESTTMP/reposetuptest.py" >> parent/.hg/hgrc
1523 $ cp parent/.hg/hgrc parent/sub2/.hg/hgrc
1523 $ cp parent/.hg/hgrc parent/sub2/.hg/hgrc
1524 $ hg -R parent status -S -A
1524 $ hg -R parent status -S -A
1525 reposetup() for $TESTTMP/reposetup-test/parent (glob)
1525 reposetup() for $TESTTMP/reposetup-test/parent (glob)
1526 reposetup() for $TESTTMP/reposetup-test/parent/sub2 (glob)
1526 reposetup() for $TESTTMP/reposetup-test/parent/sub2 (glob)
1527 C .hgsub
1527 C .hgsub
1528 C .hgsubstate
1528 C .hgsubstate
1529 C sub1/1
1529 C sub1/1
1530 C sub2/.hgsub
1530 C sub2/.hgsub
1531 C sub2/.hgsubstate
1531 C sub2/.hgsubstate
1532 C sub2/sub21/21
1532 C sub2/sub21/21
1533 C sub3/3
1533 C sub3/3
1534
1534
1535 $ cd ..
1535 $ cd ..
1536
1536
1537 Prohibit registration of commands that don't use @command (issue5137)
1537 Prohibit registration of commands that don't use @command (issue5137)
1538
1538
1539 $ hg init deprecated
1539 $ hg init deprecated
1540 $ cd deprecated
1540 $ cd deprecated
1541
1541
1542 $ cat <<EOF > deprecatedcmd.py
1542 $ cat <<EOF > deprecatedcmd.py
1543 > def deprecatedcmd(repo, ui):
1543 > def deprecatedcmd(repo, ui):
1544 > pass
1544 > pass
1545 > cmdtable = {
1545 > cmdtable = {
1546 > 'deprecatedcmd': (deprecatedcmd, [], ''),
1546 > 'deprecatedcmd': (deprecatedcmd, [], ''),
1547 > }
1547 > }
1548 > EOF
1548 > EOF
1549 $ cat <<EOF > .hg/hgrc
1549 $ cat <<EOF > .hg/hgrc
1550 > [extensions]
1550 > [extensions]
1551 > deprecatedcmd = `pwd`/deprecatedcmd.py
1551 > deprecatedcmd = `pwd`/deprecatedcmd.py
1552 > mq = !
1552 > mq = !
1553 > hgext.mq = !
1553 > hgext.mq = !
1554 > hgext/mq = !
1554 > hgext/mq = !
1555 > EOF
1555 > EOF
1556
1556
1557 $ hg deprecatedcmd > /dev/null
1557 $ hg deprecatedcmd > /dev/null
1558 *** failed to import extension deprecatedcmd from $TESTTMP/deprecated/deprecatedcmd.py: missing attributes: norepo, optionalrepo, inferrepo
1558 *** failed to import extension deprecatedcmd from $TESTTMP/deprecated/deprecatedcmd.py: missing attributes: norepo, optionalrepo, inferrepo
1559 *** (use @command decorator to register 'deprecatedcmd')
1559 *** (use @command decorator to register 'deprecatedcmd')
1560 hg: unknown command 'deprecatedcmd'
1560 hg: unknown command 'deprecatedcmd'
1561 [255]
1561 [255]
1562
1562
1563 the extension shouldn't be loaded at all so the mq works:
1563 the extension shouldn't be loaded at all so the mq works:
1564
1564
1565 $ hg qseries --config extensions.mq= > /dev/null
1565 $ hg qseries --config extensions.mq= > /dev/null
1566 *** failed to import extension deprecatedcmd from $TESTTMP/deprecated/deprecatedcmd.py: missing attributes: norepo, optionalrepo, inferrepo
1566 *** failed to import extension deprecatedcmd from $TESTTMP/deprecated/deprecatedcmd.py: missing attributes: norepo, optionalrepo, inferrepo
1567 *** (use @command decorator to register 'deprecatedcmd')
1567 *** (use @command decorator to register 'deprecatedcmd')
1568
1568
1569 $ cd ..
1569 $ cd ..
1570
1570
1571 Test synopsis and docstring extending
1571 Test synopsis and docstring extending
1572
1572
1573 $ hg init exthelp
1573 $ hg init exthelp
1574 $ cat > exthelp.py <<EOF
1574 $ cat > exthelp.py <<EOF
1575 > from mercurial import commands, extensions
1575 > from mercurial import commands, extensions
1576 > def exbookmarks(orig, *args, **opts):
1576 > def exbookmarks(orig, *args, **opts):
1577 > return orig(*args, **opts)
1577 > return orig(*args, **opts)
1578 > def uisetup(ui):
1578 > def uisetup(ui):
1579 > synopsis = ' GREPME [--foo] [-x]'
1579 > synopsis = ' GREPME [--foo] [-x]'
1580 > docstring = '''
1580 > docstring = '''
1581 > GREPME make sure that this is in the help!
1581 > GREPME make sure that this is in the help!
1582 > '''
1582 > '''
1583 > extensions.wrapcommand(commands.table, 'bookmarks', exbookmarks,
1583 > extensions.wrapcommand(commands.table, 'bookmarks', exbookmarks,
1584 > synopsis, docstring)
1584 > synopsis, docstring)
1585 > EOF
1585 > EOF
1586 $ abspath=`pwd`/exthelp.py
1586 $ abspath=`pwd`/exthelp.py
1587 $ echo '[extensions]' >> $HGRCPATH
1587 $ echo '[extensions]' >> $HGRCPATH
1588 $ echo "exthelp = $abspath" >> $HGRCPATH
1588 $ echo "exthelp = $abspath" >> $HGRCPATH
1589 $ cd exthelp
1589 $ cd exthelp
1590 $ hg help bookmarks | grep GREPME
1590 $ hg help bookmarks | grep GREPME
1591 hg bookmarks [OPTIONS]... [NAME]... GREPME [--foo] [-x]
1591 hg bookmarks [OPTIONS]... [NAME]... GREPME [--foo] [-x]
1592 GREPME make sure that this is in the help!
1592 GREPME make sure that this is in the help!
1593 $ cd ..
1593 $ cd ..
1594
1594
1595 Show deprecation warning for the use of cmdutil.command
1595 Show deprecation warning for the use of cmdutil.command
1596
1596
1597 $ cat > nonregistrar.py <<EOF
1597 $ cat > nonregistrar.py <<EOF
1598 > from mercurial import cmdutil
1598 > from mercurial import cmdutil
1599 > cmdtable = {}
1599 > cmdtable = {}
1600 > command = cmdutil.command(cmdtable)
1600 > command = cmdutil.command(cmdtable)
1601 > @command('foo', [], norepo=True)
1601 > @command('foo', [], norepo=True)
1602 > def foo(ui):
1602 > def foo(ui):
1603 > pass
1603 > pass
1604 > EOF
1604 > EOF
1605
1605
1606 $ hg --config extensions.nonregistrar=`pwd`/nonregistrar.py version > /dev/null
1606 $ hg --config extensions.nonregistrar=`pwd`/nonregistrar.py version > /dev/null
1607 devel-warn: cmdutil.command is deprecated, use registrar.command to register 'foo'
1607 devel-warn: cmdutil.command is deprecated, use registrar.command to register 'foo'
1608 (compatibility will be dropped after Mercurial-4.6, update your code.) * (glob)
1608 (compatibility will be dropped after Mercurial-4.6, update your code.) * (glob)
1609
1609
1610 Make sure a broken uisetup doesn't globally break hg:
1610 Make sure a broken uisetup doesn't globally break hg:
1611 $ cat > $TESTTMP/baduisetup.py <<EOF
1611 $ cat > $TESTTMP/baduisetup.py <<EOF
1612 > from mercurial import (
1612 > from mercurial import (
1613 > bdiff,
1613 > bdiff,
1614 > extensions,
1614 > extensions,
1615 > )
1615 > )
1616 >
1616 >
1617 > def blockswrapper(orig, *args, **kwargs):
1617 > def blockswrapper(orig, *args, **kwargs):
1618 > return orig(*args, **kwargs)
1618 > return orig(*args, **kwargs)
1619 >
1619 >
1620 > def uisetup(ui):
1620 > def uisetup(ui):
1621 > extensions.wrapfunction(bdiff, 'blocks', blockswrapper)
1621 > extensions.wrapfunction(bdiff, 'blocks', blockswrapper)
1622 > EOF
1622 > EOF
1623 $ cat >> $HGRCPATH <<EOF
1623 $ cat >> $HGRCPATH <<EOF
1624 > [extensions]
1624 > [extensions]
1625 > baduisetup = $TESTTMP/baduisetup.py
1625 > baduisetup = $TESTTMP/baduisetup.py
1626 > EOF
1626 > EOF
1627
1627
1628 Even though the extension fails during uisetup, hg is still basically usable:
1628 Even though the extension fails during uisetup, hg is still basically usable:
1629 $ hg version
1629 $ hg version
1630 *** failed to set up extension baduisetup: No module named bdiff
1630 *** failed to set up extension baduisetup: No module named bdiff
1631 Mercurial Distributed SCM (version *) (glob)
1631 Mercurial Distributed SCM (version *) (glob)
1632 (see https://mercurial-scm.org for more information)
1632 (see https://mercurial-scm.org for more information)
1633
1633
1634 Copyright (C) 2005-2017 Matt Mackall and others
1634 Copyright (C) 2005-2017 Matt Mackall and others
1635 This is free software; see the source for copying conditions. There is NO
1635 This is free software; see the source for copying conditions. There is NO
1636 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
1636 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
1637
1637
1638 $ hg version --traceback
1638 $ hg version --traceback
1639 Traceback (most recent call last):
1639 Traceback (most recent call last):
1640 File "*/mercurial/extensions.py", line *, in _runuisetup (glob)
1640 File "*/mercurial/extensions.py", line *, in _runuisetup (glob)
1641 uisetup(ui)
1641 uisetup(ui)
1642 File "$TESTTMP/baduisetup.py", line 10, in uisetup
1642 File "$TESTTMP/baduisetup.py", line 10, in uisetup
1643 extensions.wrapfunction(bdiff, 'blocks', blockswrapper)
1643 extensions.wrapfunction(bdiff, 'blocks', blockswrapper)
1644 File "*/mercurial/extensions.py", line *, in wrapfunction (glob)
1644 File "*/mercurial/extensions.py", line *, in wrapfunction (glob)
1645 origfn = getattr(container, funcname)
1645 origfn = getattr(container, funcname)
1646 File "*/hgdemandimport/demandimportpy2.py", line *, in __getattr__ (glob)
1646 File "*/hgdemandimport/demandimportpy2.py", line *, in __getattr__ (glob)
1647 self._load()
1647 self._load()
1648 File "*/hgdemandimport/demandimportpy2.py", line *, in _load (glob)
1648 File "*/hgdemandimport/demandimportpy2.py", line *, in _load (glob)
1649 mod = _hgextimport(_import, head, globals, locals, None, level)
1649 mod = _hgextimport(_import, head, globals, locals, None, level)
1650 File "*/hgdemandimport/demandimportpy2.py", line *, in _hgextimport (glob)
1650 File "*/hgdemandimport/demandimportpy2.py", line *, in _hgextimport (glob)
1651 return importfunc(name, globals, *args, **kwargs)
1651 return importfunc(name, globals, *args, **kwargs)
1652 ImportError: No module named bdiff
1652 ImportError: No module named bdiff
1653 *** failed to set up extension baduisetup: No module named bdiff
1653 *** failed to set up extension baduisetup: No module named bdiff
1654 Mercurial Distributed SCM (version *) (glob)
1654 Mercurial Distributed SCM (version *) (glob)
1655 (see https://mercurial-scm.org for more information)
1655 (see https://mercurial-scm.org for more information)
1656
1656
1657 Copyright (C) 2005-2017 Matt Mackall and others
1657 Copyright (C) 2005-2017 Matt Mackall and others
1658 This is free software; see the source for copying conditions. There is NO
1658 This is free software; see the source for copying conditions. There is NO
1659 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
1659 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
@@ -1,988 +1,988 b''
1 #require pygments serve
1 #require pygments serve
2
2
3 $ cat <<EOF >> $HGRCPATH
3 $ cat <<EOF >> $HGRCPATH
4 > [extensions]
4 > [extensions]
5 > highlight =
5 > highlight =
6 > [web]
6 > [web]
7 > pygments_style = friendly
7 > pygments_style = friendly
8 > highlightfiles = **.py and size('<100KB')
8 > highlightfiles = **.py and size('<100KB')
9 > EOF
9 > EOF
10 $ hg init test
10 $ hg init test
11 $ cd test
11 $ cd test
12
12
13 $ filterhtml () {
13 $ filterhtml () {
14 > sed -e "s/class=\"k\"/class=\"kn\"/g" \
14 > sed -e "s/class=\"k\"/class=\"kn\"/g" \
15 > -e "s/class=\"mf\"/class=\"mi\"/g" \
15 > -e "s/class=\"mf\"/class=\"mi\"/g" \
16 > -e "s/class=\"vm\"/class=\"n\"/g" \
16 > -e "s/class=\"vm\"/class=\"n\"/g" \
17 > -e "s/class=\"\([cs]\)[h12]\"/class=\"\1\"/g"
17 > -e "s/class=\"\([cs]\)[h12]\"/class=\"\1\"/g"
18 > }
18 > }
19
19
20 create random Python file to exercise Pygments
20 create random Python file to exercise Pygments
21
21
22 $ cat <<EOF > primes.py
22 $ cat <<EOF > primes.py
23 > """Fun with generators. Corresponding Haskell implementation:
23 > """Fun with generators. Corresponding Haskell implementation:
24 >
24 >
25 > primes = 2 : sieve [3, 5..]
25 > primes = 2 : sieve [3, 5..]
26 > where sieve (p:ns) = p : sieve [n | n <- ns, mod n p /= 0]
26 > where sieve (p:ns) = p : sieve [n | n <- ns, mod n p /= 0]
27 > """
27 > """
28 >
28 >
29 > from itertools import dropwhile, ifilter, islice, count, chain
29 > from itertools import dropwhile, ifilter, islice, count, chain
30 >
30 >
31 > def primes():
31 > def primes():
32 > """Generate all primes."""
32 > """Generate all primes."""
33 > def sieve(ns):
33 > def sieve(ns):
34 > p = ns.next()
34 > p = ns.next()
35 > # It is important to yield *here* in order to stop the
35 > # It is important to yield *here* in order to stop the
36 > # infinite recursion.
36 > # infinite recursion.
37 > yield p
37 > yield p
38 > ns = ifilter(lambda n: n % p != 0, ns)
38 > ns = ifilter(lambda n: n % p != 0, ns)
39 > for n in sieve(ns):
39 > for n in sieve(ns):
40 > yield n
40 > yield n
41 >
41 >
42 > odds = ifilter(lambda i: i % 2 == 1, count())
42 > odds = ifilter(lambda i: i % 2 == 1, count())
43 > return chain([2], sieve(dropwhile(lambda n: n < 3, odds)))
43 > return chain([2], sieve(dropwhile(lambda n: n < 3, odds)))
44 >
44 >
45 > if __name__ == "__main__":
45 > if __name__ == "__main__":
46 > import sys
46 > import sys
47 > try:
47 > try:
48 > n = int(sys.argv[1])
48 > n = int(sys.argv[1])
49 > except (ValueError, IndexError):
49 > except (ValueError, IndexError):
50 > n = 10
50 > n = 10
51 > p = primes()
51 > p = primes()
52 > print "The first %d primes: %s" % (n, list(islice(p, n)))
52 > print "The first %d primes: %s" % (n, list(islice(p, n)))
53 > EOF
53 > EOF
54 $ echo >> primes.py # to test html markup with an empty line just before EOF
54 $ echo >> primes.py # to test html markup with an empty line just before EOF
55 $ hg ci -Ama
55 $ hg ci -Ama
56 adding primes.py
56 adding primes.py
57
57
58 hg serve
58 hg serve
59
59
60 $ hg serve -p $HGPORT -d -n test --pid-file=hg.pid -A access.log -E errors.log
60 $ hg serve -p $HGPORT -d -n test --pid-file=hg.pid -A access.log -E errors.log
61 $ cat hg.pid >> $DAEMON_PIDS
61 $ cat hg.pid >> $DAEMON_PIDS
62
62
63 hgweb filerevision, html
63 hgweb filerevision, html
64
64
65 $ (get-with-headers.py localhost:$HGPORT 'file/tip/primes.py') | filterhtml
65 $ (get-with-headers.py localhost:$HGPORT 'file/tip/primes.py') | filterhtml
66 200 Script output follows
66 200 Script output follows
67
67
68 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
68 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
69 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
69 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
70 <head>
70 <head>
71 <link rel="icon" href="/static/hgicon.png" type="image/png" />
71 <link rel="icon" href="/static/hgicon.png" type="image/png" />
72 <meta name="robots" content="index, nofollow" />
72 <meta name="robots" content="index, nofollow" />
73 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
73 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
74 <script type="text/javascript" src="/static/mercurial.js"></script>
74 <script type="text/javascript" src="/static/mercurial.js"></script>
75
75
76 <link rel="stylesheet" href="/highlightcss" type="text/css" />
76 <link rel="stylesheet" href="/highlightcss" type="text/css" />
77 <title>test: 1af356141006 primes.py</title>
77 <title>test: 1af356141006 primes.py</title>
78 </head>
78 </head>
79 <body>
79 <body>
80
80
81 <div class="container">
81 <div class="container">
82 <div class="menu">
82 <div class="menu">
83 <div class="logo">
83 <div class="logo">
84 <a href="https://mercurial-scm.org/">
84 <a href="https://mercurial-scm.org/">
85 <img src="/static/hglogo.png" alt="mercurial" /></a>
85 <img src="/static/hglogo.png" alt="mercurial" /></a>
86 </div>
86 </div>
87 <ul>
87 <ul>
88 <li><a href="/shortlog/tip">log</a></li>
88 <li><a href="/shortlog/tip">log</a></li>
89 <li><a href="/graph/tip">graph</a></li>
89 <li><a href="/graph/tip">graph</a></li>
90 <li><a href="/tags">tags</a></li>
90 <li><a href="/tags">tags</a></li>
91 <li><a href="/bookmarks">bookmarks</a></li>
91 <li><a href="/bookmarks">bookmarks</a></li>
92 <li><a href="/branches">branches</a></li>
92 <li><a href="/branches">branches</a></li>
93 </ul>
93 </ul>
94 <ul>
94 <ul>
95 <li><a href="/rev/tip">changeset</a></li>
95 <li><a href="/rev/tip">changeset</a></li>
96 <li><a href="/file/tip/">browse</a></li>
96 <li><a href="/file/tip/">browse</a></li>
97 </ul>
97 </ul>
98 <ul>
98 <ul>
99 <li class="active">file</li>
99 <li class="active">file</li>
100 <li><a href="/file/tip/primes.py">latest</a></li>
100 <li><a href="/file/tip/primes.py">latest</a></li>
101 <li><a href="/diff/tip/primes.py">diff</a></li>
101 <li><a href="/diff/tip/primes.py">diff</a></li>
102 <li><a href="/comparison/tip/primes.py">comparison</a></li>
102 <li><a href="/comparison/tip/primes.py">comparison</a></li>
103 <li><a href="/annotate/tip/primes.py">annotate</a></li>
103 <li><a href="/annotate/tip/primes.py">annotate</a></li>
104 <li><a href="/log/tip/primes.py">file log</a></li>
104 <li><a href="/log/tip/primes.py">file log</a></li>
105 <li><a href="/raw-file/tip/primes.py">raw</a></li>
105 <li><a href="/raw-file/tip/primes.py">raw</a></li>
106 </ul>
106 </ul>
107 <ul>
107 <ul>
108 <li><a href="/help">help</a></li>
108 <li><a href="/help">help</a></li>
109 </ul>
109 </ul>
110 </div>
110 </div>
111
111
112 <div class="main">
112 <div class="main">
113 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
113 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
114 <h3>
114 <h3>
115 view primes.py @ 0:<a href="/rev/1af356141006">1af356141006</a>
115 view primes.py @ 0:<a href="/rev/1af356141006">1af356141006</a>
116 <span class="tag">tip</span>
116 <span class="tag">tip</span>
117 </h3>
117 </h3>
118
118
119
119
120 <form class="search" action="/log">
120 <form class="search" action="/log">
121
121
122 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
122 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
123 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
123 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
124 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
124 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
125 </form>
125 </form>
126
126
127 <div class="description">a</div>
127 <div class="description">a</div>
128
128
129 <table id="changesetEntry">
129 <table id="changesetEntry">
130 <tr>
130 <tr>
131 <th class="author">author</th>
131 <th class="author">author</th>
132 <td class="author">&#116;&#101;&#115;&#116;</td>
132 <td class="author">&#116;&#101;&#115;&#116;</td>
133 </tr>
133 </tr>
134 <tr>
134 <tr>
135 <th class="date">date</th>
135 <th class="date">date</th>
136 <td class="date age">Thu, 01 Jan 1970 00:00:00 +0000</td>
136 <td class="date age">Thu, 01 Jan 1970 00:00:00 +0000</td>
137 </tr>
137 </tr>
138 <tr>
138 <tr>
139 <th class="author">parents</th>
139 <th class="author">parents</th>
140 <td class="author"></td>
140 <td class="author"></td>
141 </tr>
141 </tr>
142 <tr>
142 <tr>
143 <th class="author">children</th>
143 <th class="author">children</th>
144 <td class="author"></td>
144 <td class="author"></td>
145 </tr>
145 </tr>
146 </table>
146 </table>
147
147
148 <div class="overflow">
148 <div class="overflow">
149 <div class="sourcefirst linewraptoggle">line wrap: <a class="linewraplink" href="javascript:toggleLinewrap()">on</a></div>
149 <div class="sourcefirst linewraptoggle">line wrap: <a class="linewraplink" href="javascript:toggleLinewrap()">on</a></div>
150 <div class="sourcefirst"> line source</div>
150 <div class="sourcefirst"> line source</div>
151 <pre class="sourcelines stripes4 wrap bottomline" data-logurl="/log/tip/primes.py" data-ishead="1">
151 <pre class="sourcelines stripes4 wrap bottomline" data-logurl="/log/tip/primes.py" data-ishead="1">
152 <span id="l1"><span class="sd">&quot;&quot;&quot;Fun with generators. Corresponding Haskell implementation:</span></span><a href="#l1"></a>
152 <span id="l1"><span class="sd">&quot;&quot;&quot;Fun with generators. Corresponding Haskell implementation:</span></span><a href="#l1"></a>
153 <span id="l2"></span><a href="#l2"></a>
153 <span id="l2"></span><a href="#l2"></a>
154 <span id="l3"><span class="sd">primes = 2 : sieve [3, 5..]</span></span><a href="#l3"></a>
154 <span id="l3"><span class="sd">primes = 2 : sieve [3, 5..]</span></span><a href="#l3"></a>
155 <span id="l4"><span class="sd"> where sieve (p:ns) = p : sieve [n | n &lt;- ns, mod n p /= 0]</span></span><a href="#l4"></a>
155 <span id="l4"><span class="sd"> where sieve (p:ns) = p : sieve [n | n &lt;- ns, mod n p /= 0]</span></span><a href="#l4"></a>
156 <span id="l5"><span class="sd">&quot;&quot;&quot;</span></span><a href="#l5"></a>
156 <span id="l5"><span class="sd">&quot;&quot;&quot;</span></span><a href="#l5"></a>
157 <span id="l6"></span><a href="#l6"></a>
157 <span id="l6"></span><a href="#l6"></a>
158 <span id="l7"><span class="kn">from</span> <span class="nn">itertools</span> <span class="kn">import</span> <span class="n">dropwhile</span><span class="p">,</span> <span class="n">ifilter</span><span class="p">,</span> <span class="n">islice</span><span class="p">,</span> <span class="n">count</span><span class="p">,</span> <span class="n">chain</span></span><a href="#l7"></a>
158 <span id="l7"><span class="kn">from</span> <span class="nn">itertools</span> <span class="kn">import</span> <span class="n">dropwhile</span><span class="p">,</span> <span class="n">ifilter</span><span class="p">,</span> <span class="n">islice</span><span class="p">,</span> <span class="n">count</span><span class="p">,</span> <span class="n">chain</span></span><a href="#l7"></a>
159 <span id="l8"></span><a href="#l8"></a>
159 <span id="l8"></span><a href="#l8"></a>
160 <span id="l9"><span class="kn">def</span> <span class="nf">primes</span><span class="p">():</span></span><a href="#l9"></a>
160 <span id="l9"><span class="kn">def</span> <span class="nf">primes</span><span class="p">():</span></span><a href="#l9"></a>
161 <span id="l10"> <span class="sd">&quot;&quot;&quot;Generate all primes.&quot;&quot;&quot;</span></span><a href="#l10"></a>
161 <span id="l10"> <span class="sd">&quot;&quot;&quot;Generate all primes.&quot;&quot;&quot;</span></span><a href="#l10"></a>
162 <span id="l11"> <span class="kn">def</span> <span class="nf">sieve</span><span class="p">(</span><span class="n">ns</span><span class="p">):</span></span><a href="#l11"></a>
162 <span id="l11"> <span class="kn">def</span> <span class="nf">sieve</span><span class="p">(</span><span class="n">ns</span><span class="p">):</span></span><a href="#l11"></a>
163 <span id="l12"> <span class="n">p</span> <span class="o">=</span> <span class="n">ns</span><span class="o">.</span><span class="n">next</span><span class="p">()</span></span><a href="#l12"></a>
163 <span id="l12"> <span class="n">p</span> <span class="o">=</span> <span class="n">ns</span><span class="o">.</span><span class="n">next</span><span class="p">()</span></span><a href="#l12"></a>
164 <span id="l13"> <span class="c"># It is important to yield *here* in order to stop the</span></span><a href="#l13"></a>
164 <span id="l13"> <span class="c"># It is important to yield *here* in order to stop the</span></span><a href="#l13"></a>
165 <span id="l14"> <span class="c"># infinite recursion.</span></span><a href="#l14"></a>
165 <span id="l14"> <span class="c"># infinite recursion.</span></span><a href="#l14"></a>
166 <span id="l15"> <span class="kn">yield</span> <span class="n">p</span></span><a href="#l15"></a>
166 <span id="l15"> <span class="kn">yield</span> <span class="n">p</span></span><a href="#l15"></a>
167 <span id="l16"> <span class="n">ns</span> <span class="o">=</span> <span class="n">ifilter</span><span class="p">(</span><span class="kn">lambda</span> <span class="n">n</span><span class="p">:</span> <span class="n">n</span> <span class="o">%</span> <span class="n">p</span> <span class="o">!=</span> <span class="mi">0</span><span class="p">,</span> <span class="n">ns</span><span class="p">)</span></span><a href="#l16"></a>
167 <span id="l16"> <span class="n">ns</span> <span class="o">=</span> <span class="n">ifilter</span><span class="p">(</span><span class="kn">lambda</span> <span class="n">n</span><span class="p">:</span> <span class="n">n</span> <span class="o">%</span> <span class="n">p</span> <span class="o">!=</span> <span class="mi">0</span><span class="p">,</span> <span class="n">ns</span><span class="p">)</span></span><a href="#l16"></a>
168 <span id="l17"> <span class="kn">for</span> <span class="n">n</span> <span class="ow">in</span> <span class="n">sieve</span><span class="p">(</span><span class="n">ns</span><span class="p">):</span></span><a href="#l17"></a>
168 <span id="l17"> <span class="kn">for</span> <span class="n">n</span> <span class="ow">in</span> <span class="n">sieve</span><span class="p">(</span><span class="n">ns</span><span class="p">):</span></span><a href="#l17"></a>
169 <span id="l18"> <span class="kn">yield</span> <span class="n">n</span></span><a href="#l18"></a>
169 <span id="l18"> <span class="kn">yield</span> <span class="n">n</span></span><a href="#l18"></a>
170 <span id="l19"></span><a href="#l19"></a>
170 <span id="l19"></span><a href="#l19"></a>
171 <span id="l20"> <span class="n">odds</span> <span class="o">=</span> <span class="n">ifilter</span><span class="p">(</span><span class="kn">lambda</span> <span class="n">i</span><span class="p">:</span> <span class="n">i</span> <span class="o">%</span> <span class="mi">2</span> <span class="o">==</span> <span class="mi">1</span><span class="p">,</span> <span class="n">count</span><span class="p">())</span></span><a href="#l20"></a>
171 <span id="l20"> <span class="n">odds</span> <span class="o">=</span> <span class="n">ifilter</span><span class="p">(</span><span class="kn">lambda</span> <span class="n">i</span><span class="p">:</span> <span class="n">i</span> <span class="o">%</span> <span class="mi">2</span> <span class="o">==</span> <span class="mi">1</span><span class="p">,</span> <span class="n">count</span><span class="p">())</span></span><a href="#l20"></a>
172 <span id="l21"> <span class="kn">return</span> <span class="n">chain</span><span class="p">([</span><span class="mi">2</span><span class="p">],</span> <span class="n">sieve</span><span class="p">(</span><span class="n">dropwhile</span><span class="p">(</span><span class="kn">lambda</span> <span class="n">n</span><span class="p">:</span> <span class="n">n</span> <span class="o">&lt;</span> <span class="mi">3</span><span class="p">,</span> <span class="n">odds</span><span class="p">)))</span></span><a href="#l21"></a>
172 <span id="l21"> <span class="kn">return</span> <span class="n">chain</span><span class="p">([</span><span class="mi">2</span><span class="p">],</span> <span class="n">sieve</span><span class="p">(</span><span class="n">dropwhile</span><span class="p">(</span><span class="kn">lambda</span> <span class="n">n</span><span class="p">:</span> <span class="n">n</span> <span class="o">&lt;</span> <span class="mi">3</span><span class="p">,</span> <span class="n">odds</span><span class="p">)))</span></span><a href="#l21"></a>
173 <span id="l22"></span><a href="#l22"></a>
173 <span id="l22"></span><a href="#l22"></a>
174 <span id="l23"><span class="kn">if</span> <span class="n">__name__</span> <span class="o">==</span> <span class="s">&quot;__main__&quot;</span><span class="p">:</span></span><a href="#l23"></a>
174 <span id="l23"><span class="kn">if</span> <span class="n">__name__</span> <span class="o">==</span> <span class="s">&quot;__main__&quot;</span><span class="p">:</span></span><a href="#l23"></a>
175 <span id="l24"> <span class="kn">import</span> <span class="nn">sys</span></span><a href="#l24"></a>
175 <span id="l24"> <span class="kn">import</span> <span class="nn">sys</span></span><a href="#l24"></a>
176 <span id="l25"> <span class="kn">try</span><span class="p">:</span></span><a href="#l25"></a>
176 <span id="l25"> <span class="kn">try</span><span class="p">:</span></span><a href="#l25"></a>
177 <span id="l26"> <span class="n">n</span> <span class="o">=</span> <span class="nb">int</span><span class="p">(</span><span class="n">sys</span><span class="o">.</span><span class="n">argv</span><span class="p">[</span><span class="mi">1</span><span class="p">])</span></span><a href="#l26"></a>
177 <span id="l26"> <span class="n">n</span> <span class="o">=</span> <span class="nb">int</span><span class="p">(</span><span class="n">sys</span><span class="o">.</span><span class="n">argv</span><span class="p">[</span><span class="mi">1</span><span class="p">])</span></span><a href="#l26"></a>
178 <span id="l27"> <span class="kn">except</span> <span class="p">(</span><span class="ne">ValueError</span><span class="p">,</span> <span class="ne">IndexError</span><span class="p">):</span></span><a href="#l27"></a>
178 <span id="l27"> <span class="kn">except</span> <span class="p">(</span><span class="ne">ValueError</span><span class="p">,</span> <span class="ne">IndexError</span><span class="p">):</span></span><a href="#l27"></a>
179 <span id="l28"> <span class="n">n</span> <span class="o">=</span> <span class="mi">10</span></span><a href="#l28"></a>
179 <span id="l28"> <span class="n">n</span> <span class="o">=</span> <span class="mi">10</span></span><a href="#l28"></a>
180 <span id="l29"> <span class="n">p</span> <span class="o">=</span> <span class="n">primes</span><span class="p">()</span></span><a href="#l29"></a>
180 <span id="l29"> <span class="n">p</span> <span class="o">=</span> <span class="n">primes</span><span class="p">()</span></span><a href="#l29"></a>
181 <span id="l30"> <span class="kn">print</span> <span class="s">&quot;The first </span><span class="si">%d</span><span class="s"> primes: </span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">n</span><span class="p">,</span> <span class="nb">list</span><span class="p">(</span><span class="n">islice</span><span class="p">(</span><span class="n">p</span><span class="p">,</span> <span class="n">n</span><span class="p">)))</span></span><a href="#l30"></a>
181 <span id="l30"> <span class="kn">print</span> <span class="s">&quot;The first </span><span class="si">%d</span><span class="s"> primes: </span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">n</span><span class="p">,</span> <span class="nb">list</span><span class="p">(</span><span class="n">islice</span><span class="p">(</span><span class="n">p</span><span class="p">,</span> <span class="n">n</span><span class="p">)))</span></span><a href="#l30"></a>
182 <span id="l31"></span><a href="#l31"></a></pre>
182 <span id="l31"></span><a href="#l31"></a></pre>
183 </div>
183 </div>
184
184
185 <script type="text/javascript" src="/static/followlines.js"></script>
185 <script type="text/javascript" src="/static/followlines.js"></script>
186
186
187 </div>
187 </div>
188 </div>
188 </div>
189
189
190
190
191
191
192 </body>
192 </body>
193 </html>
193 </html>
194
194
195
195
196 hgweb fileannotate, html
196 hgweb fileannotate, html
197
197
198 $ (get-with-headers.py localhost:$HGPORT 'annotate/tip/primes.py') | filterhtml
198 $ (get-with-headers.py localhost:$HGPORT 'annotate/tip/primes.py') | filterhtml
199 200 Script output follows
199 200 Script output follows
200
200
201 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
201 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
202 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
202 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
203 <head>
203 <head>
204 <link rel="icon" href="/static/hgicon.png" type="image/png" />
204 <link rel="icon" href="/static/hgicon.png" type="image/png" />
205 <meta name="robots" content="index, nofollow" />
205 <meta name="robots" content="index, nofollow" />
206 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
206 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
207 <script type="text/javascript" src="/static/mercurial.js"></script>
207 <script type="text/javascript" src="/static/mercurial.js"></script>
208
208
209 <link rel="stylesheet" href="/highlightcss" type="text/css" />
209 <link rel="stylesheet" href="/highlightcss" type="text/css" />
210 <title>test: primes.py annotate</title>
210 <title>test: primes.py annotate</title>
211 </head>
211 </head>
212 <body>
212 <body>
213
213
214 <div class="container">
214 <div class="container">
215 <div class="menu">
215 <div class="menu">
216 <div class="logo">
216 <div class="logo">
217 <a href="https://mercurial-scm.org/">
217 <a href="https://mercurial-scm.org/">
218 <img src="/static/hglogo.png" alt="mercurial" /></a>
218 <img src="/static/hglogo.png" alt="mercurial" /></a>
219 </div>
219 </div>
220 <ul>
220 <ul>
221 <li><a href="/shortlog/tip">log</a></li>
221 <li><a href="/shortlog/tip">log</a></li>
222 <li><a href="/graph/tip">graph</a></li>
222 <li><a href="/graph/tip">graph</a></li>
223 <li><a href="/tags">tags</a></li>
223 <li><a href="/tags">tags</a></li>
224 <li><a href="/bookmarks">bookmarks</a></li>
224 <li><a href="/bookmarks">bookmarks</a></li>
225 <li><a href="/branches">branches</a></li>
225 <li><a href="/branches">branches</a></li>
226 </ul>
226 </ul>
227
227
228 <ul>
228 <ul>
229 <li><a href="/rev/tip">changeset</a></li>
229 <li><a href="/rev/tip">changeset</a></li>
230 <li><a href="/file/tip/">browse</a></li>
230 <li><a href="/file/tip/">browse</a></li>
231 </ul>
231 </ul>
232 <ul>
232 <ul>
233 <li><a href="/file/tip/primes.py">file</a></li>
233 <li><a href="/file/tip/primes.py">file</a></li>
234 <li><a href="/file/tip/primes.py">latest</a></li>
234 <li><a href="/file/tip/primes.py">latest</a></li>
235 <li><a href="/diff/tip/primes.py">diff</a></li>
235 <li><a href="/diff/tip/primes.py">diff</a></li>
236 <li><a href="/comparison/tip/primes.py">comparison</a></li>
236 <li><a href="/comparison/tip/primes.py">comparison</a></li>
237 <li class="active">annotate</li>
237 <li class="active">annotate</li>
238 <li><a href="/log/tip/primes.py">file log</a></li>
238 <li><a href="/log/tip/primes.py">file log</a></li>
239 <li><a href="/raw-file/tip/primes.py">raw</a></li>
239 <li><a href="/raw-file/tip/primes.py">raw</a></li>
240 </ul>
240 </ul>
241 <ul>
241 <ul>
242 <li><a href="/help">help</a></li>
242 <li><a href="/help">help</a></li>
243 </ul>
243 </ul>
244 </div>
244 </div>
245
245
246 <div class="main">
246 <div class="main">
247 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
247 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
248 <h3>
248 <h3>
249 annotate primes.py @ 0:<a href="/rev/1af356141006">1af356141006</a>
249 annotate primes.py @ 0:<a href="/rev/1af356141006">1af356141006</a>
250 <span class="tag">tip</span>
250 <span class="tag">tip</span>
251 </h3>
251 </h3>
252
252
253
253
254 <form class="search" action="/log">
254 <form class="search" action="/log">
255
255
256 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
256 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
257 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
257 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
258 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
258 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
259 </form>
259 </form>
260
260
261 <div class="description">a</div>
261 <div class="description">a</div>
262
262
263 <table id="changesetEntry">
263 <table id="changesetEntry">
264 <tr>
264 <tr>
265 <th class="author">author</th>
265 <th class="author">author</th>
266 <td class="author">&#116;&#101;&#115;&#116;</td>
266 <td class="author">&#116;&#101;&#115;&#116;</td>
267 </tr>
267 </tr>
268 <tr>
268 <tr>
269 <th class="date">date</th>
269 <th class="date">date</th>
270 <td class="date age">Thu, 01 Jan 1970 00:00:00 +0000</td>
270 <td class="date age">Thu, 01 Jan 1970 00:00:00 +0000</td>
271 </tr>
271 </tr>
272 <tr>
272 <tr>
273 <th class="author">parents</th>
273 <th class="author">parents</th>
274 <td class="author"></td>
274 <td class="author"></td>
275 </tr>
275 </tr>
276 <tr>
276 <tr>
277 <th class="author">children</th>
277 <th class="author">children</th>
278 <td class="author"></td>
278 <td class="author"></td>
279 </tr>
279 </tr>
280 </table>
280 </table>
281
281
282 <div class="overflow">
282 <div class="overflow">
283 <table class="bigtable">
283 <table class="bigtable">
284 <thead>
284 <thead>
285 <tr>
285 <tr>
286 <th class="annotate">rev</th>
286 <th class="annotate">rev</th>
287 <th class="line">&nbsp;&nbsp;line source</th>
287 <th class="line">&nbsp;&nbsp;line source</th>
288 </tr>
288 </tr>
289 </thead>
289 </thead>
290 <tbody class="stripes2">
290 <tbody class="stripes2">
291
291
292 <tr id="l1" class="thisrev">
292 <tr id="l1" class="thisrev">
293 <td class="annotate parity0">
293 <td class="annotate parity0">
294 <a href="/annotate/1af356141006/primes.py#l1">
294 <a href="/annotate/1af356141006/primes.py#l1">
295 0
295 0
296 </a>
296 </a>
297 <div class="annotate-info">
297 <div class="annotate-info">
298 <div>
298 <div>
299 <a href="/annotate/1af356141006/primes.py#l1">
299 <a href="/annotate/1af356141006/primes.py#l1">
300 1af356141006</a>
300 1af356141006</a>
301 a
301 a
302 </div>
302 </div>
303 <div><em>&#116;&#101;&#115;&#116;</em></div>
303 <div><em>&#116;&#101;&#115;&#116;</em></div>
304 <div>parents: </div>
304 <div>parents: </div>
305 <a href="/diff/1af356141006/primes.py">diff</a>
305 <a href="/diff/1af356141006/primes.py">diff</a>
306 <a href="/rev/1af356141006">changeset</a>
306 <a href="/rev/1af356141006">changeset</a>
307 </div>
307 </div>
308 </td>
308 </td>
309 <td class="source"><a href="#l1"> 1</a> <span class="sd">&quot;&quot;&quot;Fun with generators. Corresponding Haskell implementation:</span></td>
309 <td class="source"><a href="#l1"> 1</a> <span class="sd">&quot;&quot;&quot;Fun with generators. Corresponding Haskell implementation:</span></td>
310 </tr>
310 </tr>
311 <tr id="l2" class="thisrev">
311 <tr id="l2" class="thisrev">
312 <td class="annotate parity0">
312 <td class="annotate parity0">
313
313
314 <div class="annotate-info">
314 <div class="annotate-info">
315 <div>
315 <div>
316 <a href="/annotate/1af356141006/primes.py#l2">
316 <a href="/annotate/1af356141006/primes.py#l2">
317 1af356141006</a>
317 1af356141006</a>
318 a
318 a
319 </div>
319 </div>
320 <div><em>&#116;&#101;&#115;&#116;</em></div>
320 <div><em>&#116;&#101;&#115;&#116;</em></div>
321 <div>parents: </div>
321 <div>parents: </div>
322 <a href="/diff/1af356141006/primes.py">diff</a>
322 <a href="/diff/1af356141006/primes.py">diff</a>
323 <a href="/rev/1af356141006">changeset</a>
323 <a href="/rev/1af356141006">changeset</a>
324 </div>
324 </div>
325 </td>
325 </td>
326 <td class="source"><a href="#l2"> 2</a> </td>
326 <td class="source"><a href="#l2"> 2</a> </td>
327 </tr>
327 </tr>
328 <tr id="l3" class="thisrev">
328 <tr id="l3" class="thisrev">
329 <td class="annotate parity0">
329 <td class="annotate parity0">
330
330
331 <div class="annotate-info">
331 <div class="annotate-info">
332 <div>
332 <div>
333 <a href="/annotate/1af356141006/primes.py#l3">
333 <a href="/annotate/1af356141006/primes.py#l3">
334 1af356141006</a>
334 1af356141006</a>
335 a
335 a
336 </div>
336 </div>
337 <div><em>&#116;&#101;&#115;&#116;</em></div>
337 <div><em>&#116;&#101;&#115;&#116;</em></div>
338 <div>parents: </div>
338 <div>parents: </div>
339 <a href="/diff/1af356141006/primes.py">diff</a>
339 <a href="/diff/1af356141006/primes.py">diff</a>
340 <a href="/rev/1af356141006">changeset</a>
340 <a href="/rev/1af356141006">changeset</a>
341 </div>
341 </div>
342 </td>
342 </td>
343 <td class="source"><a href="#l3"> 3</a> <span class="sd">primes = 2 : sieve [3, 5..]</span></td>
343 <td class="source"><a href="#l3"> 3</a> <span class="sd">primes = 2 : sieve [3, 5..]</span></td>
344 </tr>
344 </tr>
345 <tr id="l4" class="thisrev">
345 <tr id="l4" class="thisrev">
346 <td class="annotate parity0">
346 <td class="annotate parity0">
347
347
348 <div class="annotate-info">
348 <div class="annotate-info">
349 <div>
349 <div>
350 <a href="/annotate/1af356141006/primes.py#l4">
350 <a href="/annotate/1af356141006/primes.py#l4">
351 1af356141006</a>
351 1af356141006</a>
352 a
352 a
353 </div>
353 </div>
354 <div><em>&#116;&#101;&#115;&#116;</em></div>
354 <div><em>&#116;&#101;&#115;&#116;</em></div>
355 <div>parents: </div>
355 <div>parents: </div>
356 <a href="/diff/1af356141006/primes.py">diff</a>
356 <a href="/diff/1af356141006/primes.py">diff</a>
357 <a href="/rev/1af356141006">changeset</a>
357 <a href="/rev/1af356141006">changeset</a>
358 </div>
358 </div>
359 </td>
359 </td>
360 <td class="source"><a href="#l4"> 4</a> <span class="sd"> where sieve (p:ns) = p : sieve [n | n &lt;- ns, mod n p /= 0]</span></td>
360 <td class="source"><a href="#l4"> 4</a> <span class="sd"> where sieve (p:ns) = p : sieve [n | n &lt;- ns, mod n p /= 0]</span></td>
361 </tr>
361 </tr>
362 <tr id="l5" class="thisrev">
362 <tr id="l5" class="thisrev">
363 <td class="annotate parity0">
363 <td class="annotate parity0">
364
364
365 <div class="annotate-info">
365 <div class="annotate-info">
366 <div>
366 <div>
367 <a href="/annotate/1af356141006/primes.py#l5">
367 <a href="/annotate/1af356141006/primes.py#l5">
368 1af356141006</a>
368 1af356141006</a>
369 a
369 a
370 </div>
370 </div>
371 <div><em>&#116;&#101;&#115;&#116;</em></div>
371 <div><em>&#116;&#101;&#115;&#116;</em></div>
372 <div>parents: </div>
372 <div>parents: </div>
373 <a href="/diff/1af356141006/primes.py">diff</a>
373 <a href="/diff/1af356141006/primes.py">diff</a>
374 <a href="/rev/1af356141006">changeset</a>
374 <a href="/rev/1af356141006">changeset</a>
375 </div>
375 </div>
376 </td>
376 </td>
377 <td class="source"><a href="#l5"> 5</a> <span class="sd">&quot;&quot;&quot;</span></td>
377 <td class="source"><a href="#l5"> 5</a> <span class="sd">&quot;&quot;&quot;</span></td>
378 </tr>
378 </tr>
379 <tr id="l6" class="thisrev">
379 <tr id="l6" class="thisrev">
380 <td class="annotate parity0">
380 <td class="annotate parity0">
381
381
382 <div class="annotate-info">
382 <div class="annotate-info">
383 <div>
383 <div>
384 <a href="/annotate/1af356141006/primes.py#l6">
384 <a href="/annotate/1af356141006/primes.py#l6">
385 1af356141006</a>
385 1af356141006</a>
386 a
386 a
387 </div>
387 </div>
388 <div><em>&#116;&#101;&#115;&#116;</em></div>
388 <div><em>&#116;&#101;&#115;&#116;</em></div>
389 <div>parents: </div>
389 <div>parents: </div>
390 <a href="/diff/1af356141006/primes.py">diff</a>
390 <a href="/diff/1af356141006/primes.py">diff</a>
391 <a href="/rev/1af356141006">changeset</a>
391 <a href="/rev/1af356141006">changeset</a>
392 </div>
392 </div>
393 </td>
393 </td>
394 <td class="source"><a href="#l6"> 6</a> </td>
394 <td class="source"><a href="#l6"> 6</a> </td>
395 </tr>
395 </tr>
396 <tr id="l7" class="thisrev">
396 <tr id="l7" class="thisrev">
397 <td class="annotate parity0">
397 <td class="annotate parity0">
398
398
399 <div class="annotate-info">
399 <div class="annotate-info">
400 <div>
400 <div>
401 <a href="/annotate/1af356141006/primes.py#l7">
401 <a href="/annotate/1af356141006/primes.py#l7">
402 1af356141006</a>
402 1af356141006</a>
403 a
403 a
404 </div>
404 </div>
405 <div><em>&#116;&#101;&#115;&#116;</em></div>
405 <div><em>&#116;&#101;&#115;&#116;</em></div>
406 <div>parents: </div>
406 <div>parents: </div>
407 <a href="/diff/1af356141006/primes.py">diff</a>
407 <a href="/diff/1af356141006/primes.py">diff</a>
408 <a href="/rev/1af356141006">changeset</a>
408 <a href="/rev/1af356141006">changeset</a>
409 </div>
409 </div>
410 </td>
410 </td>
411 <td class="source"><a href="#l7"> 7</a> <span class="kn">from</span> <span class="nn">itertools</span> <span class="kn">import</span> <span class="n">dropwhile</span><span class="p">,</span> <span class="n">ifilter</span><span class="p">,</span> <span class="n">islice</span><span class="p">,</span> <span class="n">count</span><span class="p">,</span> <span class="n">chain</span></td>
411 <td class="source"><a href="#l7"> 7</a> <span class="kn">from</span> <span class="nn">itertools</span> <span class="kn">import</span> <span class="n">dropwhile</span><span class="p">,</span> <span class="n">ifilter</span><span class="p">,</span> <span class="n">islice</span><span class="p">,</span> <span class="n">count</span><span class="p">,</span> <span class="n">chain</span></td>
412 </tr>
412 </tr>
413 <tr id="l8" class="thisrev">
413 <tr id="l8" class="thisrev">
414 <td class="annotate parity0">
414 <td class="annotate parity0">
415
415
416 <div class="annotate-info">
416 <div class="annotate-info">
417 <div>
417 <div>
418 <a href="/annotate/1af356141006/primes.py#l8">
418 <a href="/annotate/1af356141006/primes.py#l8">
419 1af356141006</a>
419 1af356141006</a>
420 a
420 a
421 </div>
421 </div>
422 <div><em>&#116;&#101;&#115;&#116;</em></div>
422 <div><em>&#116;&#101;&#115;&#116;</em></div>
423 <div>parents: </div>
423 <div>parents: </div>
424 <a href="/diff/1af356141006/primes.py">diff</a>
424 <a href="/diff/1af356141006/primes.py">diff</a>
425 <a href="/rev/1af356141006">changeset</a>
425 <a href="/rev/1af356141006">changeset</a>
426 </div>
426 </div>
427 </td>
427 </td>
428 <td class="source"><a href="#l8"> 8</a> </td>
428 <td class="source"><a href="#l8"> 8</a> </td>
429 </tr>
429 </tr>
430 <tr id="l9" class="thisrev">
430 <tr id="l9" class="thisrev">
431 <td class="annotate parity0">
431 <td class="annotate parity0">
432
432
433 <div class="annotate-info">
433 <div class="annotate-info">
434 <div>
434 <div>
435 <a href="/annotate/1af356141006/primes.py#l9">
435 <a href="/annotate/1af356141006/primes.py#l9">
436 1af356141006</a>
436 1af356141006</a>
437 a
437 a
438 </div>
438 </div>
439 <div><em>&#116;&#101;&#115;&#116;</em></div>
439 <div><em>&#116;&#101;&#115;&#116;</em></div>
440 <div>parents: </div>
440 <div>parents: </div>
441 <a href="/diff/1af356141006/primes.py">diff</a>
441 <a href="/diff/1af356141006/primes.py">diff</a>
442 <a href="/rev/1af356141006">changeset</a>
442 <a href="/rev/1af356141006">changeset</a>
443 </div>
443 </div>
444 </td>
444 </td>
445 <td class="source"><a href="#l9"> 9</a> <span class="kn">def</span> <span class="nf">primes</span><span class="p">():</span></td>
445 <td class="source"><a href="#l9"> 9</a> <span class="kn">def</span> <span class="nf">primes</span><span class="p">():</span></td>
446 </tr>
446 </tr>
447 <tr id="l10" class="thisrev">
447 <tr id="l10" class="thisrev">
448 <td class="annotate parity0">
448 <td class="annotate parity0">
449
449
450 <div class="annotate-info">
450 <div class="annotate-info">
451 <div>
451 <div>
452 <a href="/annotate/1af356141006/primes.py#l10">
452 <a href="/annotate/1af356141006/primes.py#l10">
453 1af356141006</a>
453 1af356141006</a>
454 a
454 a
455 </div>
455 </div>
456 <div><em>&#116;&#101;&#115;&#116;</em></div>
456 <div><em>&#116;&#101;&#115;&#116;</em></div>
457 <div>parents: </div>
457 <div>parents: </div>
458 <a href="/diff/1af356141006/primes.py">diff</a>
458 <a href="/diff/1af356141006/primes.py">diff</a>
459 <a href="/rev/1af356141006">changeset</a>
459 <a href="/rev/1af356141006">changeset</a>
460 </div>
460 </div>
461 </td>
461 </td>
462 <td class="source"><a href="#l10"> 10</a> <span class="sd">&quot;&quot;&quot;Generate all primes.&quot;&quot;&quot;</span></td>
462 <td class="source"><a href="#l10"> 10</a> <span class="sd">&quot;&quot;&quot;Generate all primes.&quot;&quot;&quot;</span></td>
463 </tr>
463 </tr>
464 <tr id="l11" class="thisrev">
464 <tr id="l11" class="thisrev">
465 <td class="annotate parity0">
465 <td class="annotate parity0">
466
466
467 <div class="annotate-info">
467 <div class="annotate-info">
468 <div>
468 <div>
469 <a href="/annotate/1af356141006/primes.py#l11">
469 <a href="/annotate/1af356141006/primes.py#l11">
470 1af356141006</a>
470 1af356141006</a>
471 a
471 a
472 </div>
472 </div>
473 <div><em>&#116;&#101;&#115;&#116;</em></div>
473 <div><em>&#116;&#101;&#115;&#116;</em></div>
474 <div>parents: </div>
474 <div>parents: </div>
475 <a href="/diff/1af356141006/primes.py">diff</a>
475 <a href="/diff/1af356141006/primes.py">diff</a>
476 <a href="/rev/1af356141006">changeset</a>
476 <a href="/rev/1af356141006">changeset</a>
477 </div>
477 </div>
478 </td>
478 </td>
479 <td class="source"><a href="#l11"> 11</a> <span class="kn">def</span> <span class="nf">sieve</span><span class="p">(</span><span class="n">ns</span><span class="p">):</span></td>
479 <td class="source"><a href="#l11"> 11</a> <span class="kn">def</span> <span class="nf">sieve</span><span class="p">(</span><span class="n">ns</span><span class="p">):</span></td>
480 </tr>
480 </tr>
481 <tr id="l12" class="thisrev">
481 <tr id="l12" class="thisrev">
482 <td class="annotate parity0">
482 <td class="annotate parity0">
483
483
484 <div class="annotate-info">
484 <div class="annotate-info">
485 <div>
485 <div>
486 <a href="/annotate/1af356141006/primes.py#l12">
486 <a href="/annotate/1af356141006/primes.py#l12">
487 1af356141006</a>
487 1af356141006</a>
488 a
488 a
489 </div>
489 </div>
490 <div><em>&#116;&#101;&#115;&#116;</em></div>
490 <div><em>&#116;&#101;&#115;&#116;</em></div>
491 <div>parents: </div>
491 <div>parents: </div>
492 <a href="/diff/1af356141006/primes.py">diff</a>
492 <a href="/diff/1af356141006/primes.py">diff</a>
493 <a href="/rev/1af356141006">changeset</a>
493 <a href="/rev/1af356141006">changeset</a>
494 </div>
494 </div>
495 </td>
495 </td>
496 <td class="source"><a href="#l12"> 12</a> <span class="n">p</span> <span class="o">=</span> <span class="n">ns</span><span class="o">.</span><span class="n">next</span><span class="p">()</span></td>
496 <td class="source"><a href="#l12"> 12</a> <span class="n">p</span> <span class="o">=</span> <span class="n">ns</span><span class="o">.</span><span class="n">next</span><span class="p">()</span></td>
497 </tr>
497 </tr>
498 <tr id="l13" class="thisrev">
498 <tr id="l13" class="thisrev">
499 <td class="annotate parity0">
499 <td class="annotate parity0">
500
500
501 <div class="annotate-info">
501 <div class="annotate-info">
502 <div>
502 <div>
503 <a href="/annotate/1af356141006/primes.py#l13">
503 <a href="/annotate/1af356141006/primes.py#l13">
504 1af356141006</a>
504 1af356141006</a>
505 a
505 a
506 </div>
506 </div>
507 <div><em>&#116;&#101;&#115;&#116;</em></div>
507 <div><em>&#116;&#101;&#115;&#116;</em></div>
508 <div>parents: </div>
508 <div>parents: </div>
509 <a href="/diff/1af356141006/primes.py">diff</a>
509 <a href="/diff/1af356141006/primes.py">diff</a>
510 <a href="/rev/1af356141006">changeset</a>
510 <a href="/rev/1af356141006">changeset</a>
511 </div>
511 </div>
512 </td>
512 </td>
513 <td class="source"><a href="#l13"> 13</a> <span class="c"># It is important to yield *here* in order to stop the</span></td>
513 <td class="source"><a href="#l13"> 13</a> <span class="c"># It is important to yield *here* in order to stop the</span></td>
514 </tr>
514 </tr>
515 <tr id="l14" class="thisrev">
515 <tr id="l14" class="thisrev">
516 <td class="annotate parity0">
516 <td class="annotate parity0">
517
517
518 <div class="annotate-info">
518 <div class="annotate-info">
519 <div>
519 <div>
520 <a href="/annotate/1af356141006/primes.py#l14">
520 <a href="/annotate/1af356141006/primes.py#l14">
521 1af356141006</a>
521 1af356141006</a>
522 a
522 a
523 </div>
523 </div>
524 <div><em>&#116;&#101;&#115;&#116;</em></div>
524 <div><em>&#116;&#101;&#115;&#116;</em></div>
525 <div>parents: </div>
525 <div>parents: </div>
526 <a href="/diff/1af356141006/primes.py">diff</a>
526 <a href="/diff/1af356141006/primes.py">diff</a>
527 <a href="/rev/1af356141006">changeset</a>
527 <a href="/rev/1af356141006">changeset</a>
528 </div>
528 </div>
529 </td>
529 </td>
530 <td class="source"><a href="#l14"> 14</a> <span class="c"># infinite recursion.</span></td>
530 <td class="source"><a href="#l14"> 14</a> <span class="c"># infinite recursion.</span></td>
531 </tr>
531 </tr>
532 <tr id="l15" class="thisrev">
532 <tr id="l15" class="thisrev">
533 <td class="annotate parity0">
533 <td class="annotate parity0">
534
534
535 <div class="annotate-info">
535 <div class="annotate-info">
536 <div>
536 <div>
537 <a href="/annotate/1af356141006/primes.py#l15">
537 <a href="/annotate/1af356141006/primes.py#l15">
538 1af356141006</a>
538 1af356141006</a>
539 a
539 a
540 </div>
540 </div>
541 <div><em>&#116;&#101;&#115;&#116;</em></div>
541 <div><em>&#116;&#101;&#115;&#116;</em></div>
542 <div>parents: </div>
542 <div>parents: </div>
543 <a href="/diff/1af356141006/primes.py">diff</a>
543 <a href="/diff/1af356141006/primes.py">diff</a>
544 <a href="/rev/1af356141006">changeset</a>
544 <a href="/rev/1af356141006">changeset</a>
545 </div>
545 </div>
546 </td>
546 </td>
547 <td class="source"><a href="#l15"> 15</a> <span class="kn">yield</span> <span class="n">p</span></td>
547 <td class="source"><a href="#l15"> 15</a> <span class="kn">yield</span> <span class="n">p</span></td>
548 </tr>
548 </tr>
549 <tr id="l16" class="thisrev">
549 <tr id="l16" class="thisrev">
550 <td class="annotate parity0">
550 <td class="annotate parity0">
551
551
552 <div class="annotate-info">
552 <div class="annotate-info">
553 <div>
553 <div>
554 <a href="/annotate/1af356141006/primes.py#l16">
554 <a href="/annotate/1af356141006/primes.py#l16">
555 1af356141006</a>
555 1af356141006</a>
556 a
556 a
557 </div>
557 </div>
558 <div><em>&#116;&#101;&#115;&#116;</em></div>
558 <div><em>&#116;&#101;&#115;&#116;</em></div>
559 <div>parents: </div>
559 <div>parents: </div>
560 <a href="/diff/1af356141006/primes.py">diff</a>
560 <a href="/diff/1af356141006/primes.py">diff</a>
561 <a href="/rev/1af356141006">changeset</a>
561 <a href="/rev/1af356141006">changeset</a>
562 </div>
562 </div>
563 </td>
563 </td>
564 <td class="source"><a href="#l16"> 16</a> <span class="n">ns</span> <span class="o">=</span> <span class="n">ifilter</span><span class="p">(</span><span class="kn">lambda</span> <span class="n">n</span><span class="p">:</span> <span class="n">n</span> <span class="o">%</span> <span class="n">p</span> <span class="o">!=</span> <span class="mi">0</span><span class="p">,</span> <span class="n">ns</span><span class="p">)</span></td>
564 <td class="source"><a href="#l16"> 16</a> <span class="n">ns</span> <span class="o">=</span> <span class="n">ifilter</span><span class="p">(</span><span class="kn">lambda</span> <span class="n">n</span><span class="p">:</span> <span class="n">n</span> <span class="o">%</span> <span class="n">p</span> <span class="o">!=</span> <span class="mi">0</span><span class="p">,</span> <span class="n">ns</span><span class="p">)</span></td>
565 </tr>
565 </tr>
566 <tr id="l17" class="thisrev">
566 <tr id="l17" class="thisrev">
567 <td class="annotate parity0">
567 <td class="annotate parity0">
568
568
569 <div class="annotate-info">
569 <div class="annotate-info">
570 <div>
570 <div>
571 <a href="/annotate/1af356141006/primes.py#l17">
571 <a href="/annotate/1af356141006/primes.py#l17">
572 1af356141006</a>
572 1af356141006</a>
573 a
573 a
574 </div>
574 </div>
575 <div><em>&#116;&#101;&#115;&#116;</em></div>
575 <div><em>&#116;&#101;&#115;&#116;</em></div>
576 <div>parents: </div>
576 <div>parents: </div>
577 <a href="/diff/1af356141006/primes.py">diff</a>
577 <a href="/diff/1af356141006/primes.py">diff</a>
578 <a href="/rev/1af356141006">changeset</a>
578 <a href="/rev/1af356141006">changeset</a>
579 </div>
579 </div>
580 </td>
580 </td>
581 <td class="source"><a href="#l17"> 17</a> <span class="kn">for</span> <span class="n">n</span> <span class="ow">in</span> <span class="n">sieve</span><span class="p">(</span><span class="n">ns</span><span class="p">):</span></td>
581 <td class="source"><a href="#l17"> 17</a> <span class="kn">for</span> <span class="n">n</span> <span class="ow">in</span> <span class="n">sieve</span><span class="p">(</span><span class="n">ns</span><span class="p">):</span></td>
582 </tr>
582 </tr>
583 <tr id="l18" class="thisrev">
583 <tr id="l18" class="thisrev">
584 <td class="annotate parity0">
584 <td class="annotate parity0">
585
585
586 <div class="annotate-info">
586 <div class="annotate-info">
587 <div>
587 <div>
588 <a href="/annotate/1af356141006/primes.py#l18">
588 <a href="/annotate/1af356141006/primes.py#l18">
589 1af356141006</a>
589 1af356141006</a>
590 a
590 a
591 </div>
591 </div>
592 <div><em>&#116;&#101;&#115;&#116;</em></div>
592 <div><em>&#116;&#101;&#115;&#116;</em></div>
593 <div>parents: </div>
593 <div>parents: </div>
594 <a href="/diff/1af356141006/primes.py">diff</a>
594 <a href="/diff/1af356141006/primes.py">diff</a>
595 <a href="/rev/1af356141006">changeset</a>
595 <a href="/rev/1af356141006">changeset</a>
596 </div>
596 </div>
597 </td>
597 </td>
598 <td class="source"><a href="#l18"> 18</a> <span class="kn">yield</span> <span class="n">n</span></td>
598 <td class="source"><a href="#l18"> 18</a> <span class="kn">yield</span> <span class="n">n</span></td>
599 </tr>
599 </tr>
600 <tr id="l19" class="thisrev">
600 <tr id="l19" class="thisrev">
601 <td class="annotate parity0">
601 <td class="annotate parity0">
602
602
603 <div class="annotate-info">
603 <div class="annotate-info">
604 <div>
604 <div>
605 <a href="/annotate/1af356141006/primes.py#l19">
605 <a href="/annotate/1af356141006/primes.py#l19">
606 1af356141006</a>
606 1af356141006</a>
607 a
607 a
608 </div>
608 </div>
609 <div><em>&#116;&#101;&#115;&#116;</em></div>
609 <div><em>&#116;&#101;&#115;&#116;</em></div>
610 <div>parents: </div>
610 <div>parents: </div>
611 <a href="/diff/1af356141006/primes.py">diff</a>
611 <a href="/diff/1af356141006/primes.py">diff</a>
612 <a href="/rev/1af356141006">changeset</a>
612 <a href="/rev/1af356141006">changeset</a>
613 </div>
613 </div>
614 </td>
614 </td>
615 <td class="source"><a href="#l19"> 19</a> </td>
615 <td class="source"><a href="#l19"> 19</a> </td>
616 </tr>
616 </tr>
617 <tr id="l20" class="thisrev">
617 <tr id="l20" class="thisrev">
618 <td class="annotate parity0">
618 <td class="annotate parity0">
619
619
620 <div class="annotate-info">
620 <div class="annotate-info">
621 <div>
621 <div>
622 <a href="/annotate/1af356141006/primes.py#l20">
622 <a href="/annotate/1af356141006/primes.py#l20">
623 1af356141006</a>
623 1af356141006</a>
624 a
624 a
625 </div>
625 </div>
626 <div><em>&#116;&#101;&#115;&#116;</em></div>
626 <div><em>&#116;&#101;&#115;&#116;</em></div>
627 <div>parents: </div>
627 <div>parents: </div>
628 <a href="/diff/1af356141006/primes.py">diff</a>
628 <a href="/diff/1af356141006/primes.py">diff</a>
629 <a href="/rev/1af356141006">changeset</a>
629 <a href="/rev/1af356141006">changeset</a>
630 </div>
630 </div>
631 </td>
631 </td>
632 <td class="source"><a href="#l20"> 20</a> <span class="n">odds</span> <span class="o">=</span> <span class="n">ifilter</span><span class="p">(</span><span class="kn">lambda</span> <span class="n">i</span><span class="p">:</span> <span class="n">i</span> <span class="o">%</span> <span class="mi">2</span> <span class="o">==</span> <span class="mi">1</span><span class="p">,</span> <span class="n">count</span><span class="p">())</span></td>
632 <td class="source"><a href="#l20"> 20</a> <span class="n">odds</span> <span class="o">=</span> <span class="n">ifilter</span><span class="p">(</span><span class="kn">lambda</span> <span class="n">i</span><span class="p">:</span> <span class="n">i</span> <span class="o">%</span> <span class="mi">2</span> <span class="o">==</span> <span class="mi">1</span><span class="p">,</span> <span class="n">count</span><span class="p">())</span></td>
633 </tr>
633 </tr>
634 <tr id="l21" class="thisrev">
634 <tr id="l21" class="thisrev">
635 <td class="annotate parity0">
635 <td class="annotate parity0">
636
636
637 <div class="annotate-info">
637 <div class="annotate-info">
638 <div>
638 <div>
639 <a href="/annotate/1af356141006/primes.py#l21">
639 <a href="/annotate/1af356141006/primes.py#l21">
640 1af356141006</a>
640 1af356141006</a>
641 a
641 a
642 </div>
642 </div>
643 <div><em>&#116;&#101;&#115;&#116;</em></div>
643 <div><em>&#116;&#101;&#115;&#116;</em></div>
644 <div>parents: </div>
644 <div>parents: </div>
645 <a href="/diff/1af356141006/primes.py">diff</a>
645 <a href="/diff/1af356141006/primes.py">diff</a>
646 <a href="/rev/1af356141006">changeset</a>
646 <a href="/rev/1af356141006">changeset</a>
647 </div>
647 </div>
648 </td>
648 </td>
649 <td class="source"><a href="#l21"> 21</a> <span class="kn">return</span> <span class="n">chain</span><span class="p">([</span><span class="mi">2</span><span class="p">],</span> <span class="n">sieve</span><span class="p">(</span><span class="n">dropwhile</span><span class="p">(</span><span class="kn">lambda</span> <span class="n">n</span><span class="p">:</span> <span class="n">n</span> <span class="o">&lt;</span> <span class="mi">3</span><span class="p">,</span> <span class="n">odds</span><span class="p">)))</span></td>
649 <td class="source"><a href="#l21"> 21</a> <span class="kn">return</span> <span class="n">chain</span><span class="p">([</span><span class="mi">2</span><span class="p">],</span> <span class="n">sieve</span><span class="p">(</span><span class="n">dropwhile</span><span class="p">(</span><span class="kn">lambda</span> <span class="n">n</span><span class="p">:</span> <span class="n">n</span> <span class="o">&lt;</span> <span class="mi">3</span><span class="p">,</span> <span class="n">odds</span><span class="p">)))</span></td>
650 </tr>
650 </tr>
651 <tr id="l22" class="thisrev">
651 <tr id="l22" class="thisrev">
652 <td class="annotate parity0">
652 <td class="annotate parity0">
653
653
654 <div class="annotate-info">
654 <div class="annotate-info">
655 <div>
655 <div>
656 <a href="/annotate/1af356141006/primes.py#l22">
656 <a href="/annotate/1af356141006/primes.py#l22">
657 1af356141006</a>
657 1af356141006</a>
658 a
658 a
659 </div>
659 </div>
660 <div><em>&#116;&#101;&#115;&#116;</em></div>
660 <div><em>&#116;&#101;&#115;&#116;</em></div>
661 <div>parents: </div>
661 <div>parents: </div>
662 <a href="/diff/1af356141006/primes.py">diff</a>
662 <a href="/diff/1af356141006/primes.py">diff</a>
663 <a href="/rev/1af356141006">changeset</a>
663 <a href="/rev/1af356141006">changeset</a>
664 </div>
664 </div>
665 </td>
665 </td>
666 <td class="source"><a href="#l22"> 22</a> </td>
666 <td class="source"><a href="#l22"> 22</a> </td>
667 </tr>
667 </tr>
668 <tr id="l23" class="thisrev">
668 <tr id="l23" class="thisrev">
669 <td class="annotate parity0">
669 <td class="annotate parity0">
670
670
671 <div class="annotate-info">
671 <div class="annotate-info">
672 <div>
672 <div>
673 <a href="/annotate/1af356141006/primes.py#l23">
673 <a href="/annotate/1af356141006/primes.py#l23">
674 1af356141006</a>
674 1af356141006</a>
675 a
675 a
676 </div>
676 </div>
677 <div><em>&#116;&#101;&#115;&#116;</em></div>
677 <div><em>&#116;&#101;&#115;&#116;</em></div>
678 <div>parents: </div>
678 <div>parents: </div>
679 <a href="/diff/1af356141006/primes.py">diff</a>
679 <a href="/diff/1af356141006/primes.py">diff</a>
680 <a href="/rev/1af356141006">changeset</a>
680 <a href="/rev/1af356141006">changeset</a>
681 </div>
681 </div>
682 </td>
682 </td>
683 <td class="source"><a href="#l23"> 23</a> <span class="kn">if</span> <span class="n">__name__</span> <span class="o">==</span> <span class="s">&quot;__main__&quot;</span><span class="p">:</span></td>
683 <td class="source"><a href="#l23"> 23</a> <span class="kn">if</span> <span class="n">__name__</span> <span class="o">==</span> <span class="s">&quot;__main__&quot;</span><span class="p">:</span></td>
684 </tr>
684 </tr>
685 <tr id="l24" class="thisrev">
685 <tr id="l24" class="thisrev">
686 <td class="annotate parity0">
686 <td class="annotate parity0">
687
687
688 <div class="annotate-info">
688 <div class="annotate-info">
689 <div>
689 <div>
690 <a href="/annotate/1af356141006/primes.py#l24">
690 <a href="/annotate/1af356141006/primes.py#l24">
691 1af356141006</a>
691 1af356141006</a>
692 a
692 a
693 </div>
693 </div>
694 <div><em>&#116;&#101;&#115;&#116;</em></div>
694 <div><em>&#116;&#101;&#115;&#116;</em></div>
695 <div>parents: </div>
695 <div>parents: </div>
696 <a href="/diff/1af356141006/primes.py">diff</a>
696 <a href="/diff/1af356141006/primes.py">diff</a>
697 <a href="/rev/1af356141006">changeset</a>
697 <a href="/rev/1af356141006">changeset</a>
698 </div>
698 </div>
699 </td>
699 </td>
700 <td class="source"><a href="#l24"> 24</a> <span class="kn">import</span> <span class="nn">sys</span></td>
700 <td class="source"><a href="#l24"> 24</a> <span class="kn">import</span> <span class="nn">sys</span></td>
701 </tr>
701 </tr>
702 <tr id="l25" class="thisrev">
702 <tr id="l25" class="thisrev">
703 <td class="annotate parity0">
703 <td class="annotate parity0">
704
704
705 <div class="annotate-info">
705 <div class="annotate-info">
706 <div>
706 <div>
707 <a href="/annotate/1af356141006/primes.py#l25">
707 <a href="/annotate/1af356141006/primes.py#l25">
708 1af356141006</a>
708 1af356141006</a>
709 a
709 a
710 </div>
710 </div>
711 <div><em>&#116;&#101;&#115;&#116;</em></div>
711 <div><em>&#116;&#101;&#115;&#116;</em></div>
712 <div>parents: </div>
712 <div>parents: </div>
713 <a href="/diff/1af356141006/primes.py">diff</a>
713 <a href="/diff/1af356141006/primes.py">diff</a>
714 <a href="/rev/1af356141006">changeset</a>
714 <a href="/rev/1af356141006">changeset</a>
715 </div>
715 </div>
716 </td>
716 </td>
717 <td class="source"><a href="#l25"> 25</a> <span class="kn">try</span><span class="p">:</span></td>
717 <td class="source"><a href="#l25"> 25</a> <span class="kn">try</span><span class="p">:</span></td>
718 </tr>
718 </tr>
719 <tr id="l26" class="thisrev">
719 <tr id="l26" class="thisrev">
720 <td class="annotate parity0">
720 <td class="annotate parity0">
721
721
722 <div class="annotate-info">
722 <div class="annotate-info">
723 <div>
723 <div>
724 <a href="/annotate/1af356141006/primes.py#l26">
724 <a href="/annotate/1af356141006/primes.py#l26">
725 1af356141006</a>
725 1af356141006</a>
726 a
726 a
727 </div>
727 </div>
728 <div><em>&#116;&#101;&#115;&#116;</em></div>
728 <div><em>&#116;&#101;&#115;&#116;</em></div>
729 <div>parents: </div>
729 <div>parents: </div>
730 <a href="/diff/1af356141006/primes.py">diff</a>
730 <a href="/diff/1af356141006/primes.py">diff</a>
731 <a href="/rev/1af356141006">changeset</a>
731 <a href="/rev/1af356141006">changeset</a>
732 </div>
732 </div>
733 </td>
733 </td>
734 <td class="source"><a href="#l26"> 26</a> <span class="n">n</span> <span class="o">=</span> <span class="nb">int</span><span class="p">(</span><span class="n">sys</span><span class="o">.</span><span class="n">argv</span><span class="p">[</span><span class="mi">1</span><span class="p">])</span></td>
734 <td class="source"><a href="#l26"> 26</a> <span class="n">n</span> <span class="o">=</span> <span class="nb">int</span><span class="p">(</span><span class="n">sys</span><span class="o">.</span><span class="n">argv</span><span class="p">[</span><span class="mi">1</span><span class="p">])</span></td>
735 </tr>
735 </tr>
736 <tr id="l27" class="thisrev">
736 <tr id="l27" class="thisrev">
737 <td class="annotate parity0">
737 <td class="annotate parity0">
738
738
739 <div class="annotate-info">
739 <div class="annotate-info">
740 <div>
740 <div>
741 <a href="/annotate/1af356141006/primes.py#l27">
741 <a href="/annotate/1af356141006/primes.py#l27">
742 1af356141006</a>
742 1af356141006</a>
743 a
743 a
744 </div>
744 </div>
745 <div><em>&#116;&#101;&#115;&#116;</em></div>
745 <div><em>&#116;&#101;&#115;&#116;</em></div>
746 <div>parents: </div>
746 <div>parents: </div>
747 <a href="/diff/1af356141006/primes.py">diff</a>
747 <a href="/diff/1af356141006/primes.py">diff</a>
748 <a href="/rev/1af356141006">changeset</a>
748 <a href="/rev/1af356141006">changeset</a>
749 </div>
749 </div>
750 </td>
750 </td>
751 <td class="source"><a href="#l27"> 27</a> <span class="kn">except</span> <span class="p">(</span><span class="ne">ValueError</span><span class="p">,</span> <span class="ne">IndexError</span><span class="p">):</span></td>
751 <td class="source"><a href="#l27"> 27</a> <span class="kn">except</span> <span class="p">(</span><span class="ne">ValueError</span><span class="p">,</span> <span class="ne">IndexError</span><span class="p">):</span></td>
752 </tr>
752 </tr>
753 <tr id="l28" class="thisrev">
753 <tr id="l28" class="thisrev">
754 <td class="annotate parity0">
754 <td class="annotate parity0">
755
755
756 <div class="annotate-info">
756 <div class="annotate-info">
757 <div>
757 <div>
758 <a href="/annotate/1af356141006/primes.py#l28">
758 <a href="/annotate/1af356141006/primes.py#l28">
759 1af356141006</a>
759 1af356141006</a>
760 a
760 a
761 </div>
761 </div>
762 <div><em>&#116;&#101;&#115;&#116;</em></div>
762 <div><em>&#116;&#101;&#115;&#116;</em></div>
763 <div>parents: </div>
763 <div>parents: </div>
764 <a href="/diff/1af356141006/primes.py">diff</a>
764 <a href="/diff/1af356141006/primes.py">diff</a>
765 <a href="/rev/1af356141006">changeset</a>
765 <a href="/rev/1af356141006">changeset</a>
766 </div>
766 </div>
767 </td>
767 </td>
768 <td class="source"><a href="#l28"> 28</a> <span class="n">n</span> <span class="o">=</span> <span class="mi">10</span></td>
768 <td class="source"><a href="#l28"> 28</a> <span class="n">n</span> <span class="o">=</span> <span class="mi">10</span></td>
769 </tr>
769 </tr>
770 <tr id="l29" class="thisrev">
770 <tr id="l29" class="thisrev">
771 <td class="annotate parity0">
771 <td class="annotate parity0">
772
772
773 <div class="annotate-info">
773 <div class="annotate-info">
774 <div>
774 <div>
775 <a href="/annotate/1af356141006/primes.py#l29">
775 <a href="/annotate/1af356141006/primes.py#l29">
776 1af356141006</a>
776 1af356141006</a>
777 a
777 a
778 </div>
778 </div>
779 <div><em>&#116;&#101;&#115;&#116;</em></div>
779 <div><em>&#116;&#101;&#115;&#116;</em></div>
780 <div>parents: </div>
780 <div>parents: </div>
781 <a href="/diff/1af356141006/primes.py">diff</a>
781 <a href="/diff/1af356141006/primes.py">diff</a>
782 <a href="/rev/1af356141006">changeset</a>
782 <a href="/rev/1af356141006">changeset</a>
783 </div>
783 </div>
784 </td>
784 </td>
785 <td class="source"><a href="#l29"> 29</a> <span class="n">p</span> <span class="o">=</span> <span class="n">primes</span><span class="p">()</span></td>
785 <td class="source"><a href="#l29"> 29</a> <span class="n">p</span> <span class="o">=</span> <span class="n">primes</span><span class="p">()</span></td>
786 </tr>
786 </tr>
787 <tr id="l30" class="thisrev">
787 <tr id="l30" class="thisrev">
788 <td class="annotate parity0">
788 <td class="annotate parity0">
789
789
790 <div class="annotate-info">
790 <div class="annotate-info">
791 <div>
791 <div>
792 <a href="/annotate/1af356141006/primes.py#l30">
792 <a href="/annotate/1af356141006/primes.py#l30">
793 1af356141006</a>
793 1af356141006</a>
794 a
794 a
795 </div>
795 </div>
796 <div><em>&#116;&#101;&#115;&#116;</em></div>
796 <div><em>&#116;&#101;&#115;&#116;</em></div>
797 <div>parents: </div>
797 <div>parents: </div>
798 <a href="/diff/1af356141006/primes.py">diff</a>
798 <a href="/diff/1af356141006/primes.py">diff</a>
799 <a href="/rev/1af356141006">changeset</a>
799 <a href="/rev/1af356141006">changeset</a>
800 </div>
800 </div>
801 </td>
801 </td>
802 <td class="source"><a href="#l30"> 30</a> <span class="kn">print</span> <span class="s">&quot;The first </span><span class="si">%d</span><span class="s"> primes: </span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">n</span><span class="p">,</span> <span class="nb">list</span><span class="p">(</span><span class="n">islice</span><span class="p">(</span><span class="n">p</span><span class="p">,</span> <span class="n">n</span><span class="p">)))</span></td>
802 <td class="source"><a href="#l30"> 30</a> <span class="kn">print</span> <span class="s">&quot;The first </span><span class="si">%d</span><span class="s"> primes: </span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">n</span><span class="p">,</span> <span class="nb">list</span><span class="p">(</span><span class="n">islice</span><span class="p">(</span><span class="n">p</span><span class="p">,</span> <span class="n">n</span><span class="p">)))</span></td>
803 </tr>
803 </tr>
804 <tr id="l31" class="thisrev">
804 <tr id="l31" class="thisrev">
805 <td class="annotate parity0">
805 <td class="annotate parity0">
806
806
807 <div class="annotate-info">
807 <div class="annotate-info">
808 <div>
808 <div>
809 <a href="/annotate/1af356141006/primes.py#l31">
809 <a href="/annotate/1af356141006/primes.py#l31">
810 1af356141006</a>
810 1af356141006</a>
811 a
811 a
812 </div>
812 </div>
813 <div><em>&#116;&#101;&#115;&#116;</em></div>
813 <div><em>&#116;&#101;&#115;&#116;</em></div>
814 <div>parents: </div>
814 <div>parents: </div>
815 <a href="/diff/1af356141006/primes.py">diff</a>
815 <a href="/diff/1af356141006/primes.py">diff</a>
816 <a href="/rev/1af356141006">changeset</a>
816 <a href="/rev/1af356141006">changeset</a>
817 </div>
817 </div>
818 </td>
818 </td>
819 <td class="source"><a href="#l31"> 31</a> </td>
819 <td class="source"><a href="#l31"> 31</a> </td>
820 </tr>
820 </tr>
821 </tbody>
821 </tbody>
822 </table>
822 </table>
823 </div>
823 </div>
824 </div>
824 </div>
825 </div>
825 </div>
826
826
827
827
828
828
829 </body>
829 </body>
830 </html>
830 </html>
831
831
832
832
833 hgweb fileannotate, raw
833 hgweb fileannotate, raw
834
834
835 $ (get-with-headers.py localhost:$HGPORT 'annotate/tip/primes.py?style=raw') \
835 $ (get-with-headers.py localhost:$HGPORT 'annotate/tip/primes.py?style=raw') \
836 > | sed "s/test@//" > a
836 > | sed "s/test@//" > a
837 $ echo "200 Script output follows" > b
837 $ echo "200 Script output follows" > b
838 $ echo "" >> b
838 $ echo "" >> b
839 $ echo "" >> b
839 $ echo "" >> b
840 $ hg annotate "primes.py" >> b
840 $ hg annotate "primes.py" >> b
841 $ echo "" >> b
841 $ echo "" >> b
842 $ echo "" >> b
842 $ echo "" >> b
843 $ echo "" >> b
843 $ echo "" >> b
844 $ echo "" >> b
844 $ echo "" >> b
845 $ cmp b a || diff -u b a
845 $ cmp b a || diff -u b a
846
846
847 hgweb filerevision, raw
847 hgweb filerevision, raw
848
848
849 $ (get-with-headers.py localhost:$HGPORT 'file/tip/primes.py?style=raw') \
849 $ (get-with-headers.py localhost:$HGPORT 'file/tip/primes.py?style=raw') \
850 > > a
850 > > a
851 $ echo "200 Script output follows" > b
851 $ echo "200 Script output follows" > b
852 $ echo "" >> b
852 $ echo "" >> b
853 $ hg cat primes.py >> b
853 $ hg cat primes.py >> b
854 $ cmp b a || diff -u b a
854 $ cmp b a || diff -u b a
855
855
856 hgweb highlightcss friendly
856 hgweb highlightcss friendly
857
857
858 $ get-with-headers.py localhost:$HGPORT 'highlightcss' > out
858 $ get-with-headers.py localhost:$HGPORT 'highlightcss' > out
859 $ head -n 4 out
859 $ head -n 4 out
860 200 Script output follows
860 200 Script output follows
861
861
862 /* pygments_style = friendly */
862 /* pygments_style = friendly */
863
863
864 $ rm out
864 $ rm out
865
865
866 errors encountered
866 errors encountered
867
867
868 $ cat errors.log
868 $ cat errors.log
869 $ killdaemons.py
869 $ killdaemons.py
870
870
871 Change the pygments style
871 Change the pygments style
872
872
873 $ cat > .hg/hgrc <<EOF
873 $ cat > .hg/hgrc <<EOF
874 > [web]
874 > [web]
875 > pygments_style = fruity
875 > pygments_style = fruity
876 > EOF
876 > EOF
877
877
878 hg serve again
878 hg serve again
879
879
880 $ hg serve -p $HGPORT -d -n test --pid-file=hg.pid -A access.log -E errors.log
880 $ hg serve -p $HGPORT -d -n test --pid-file=hg.pid -A access.log -E errors.log
881 $ cat hg.pid >> $DAEMON_PIDS
881 $ cat hg.pid >> $DAEMON_PIDS
882
882
883 hgweb highlightcss fruity
883 hgweb highlightcss fruity
884
884
885 $ get-with-headers.py localhost:$HGPORT 'highlightcss' > out
885 $ get-with-headers.py localhost:$HGPORT 'highlightcss' > out
886 $ head -n 4 out
886 $ head -n 4 out
887 200 Script output follows
887 200 Script output follows
888
888
889 /* pygments_style = fruity */
889 /* pygments_style = fruity */
890
890
891 $ rm out
891 $ rm out
892
892
893 errors encountered
893 errors encountered
894
894
895 $ cat errors.log
895 $ cat errors.log
896 $ killdaemons.py
896 $ killdaemons.py
897
897
898 only highlight C source files
898 only highlight C source files
899
899
900 $ cat > .hg/hgrc <<EOF
900 $ cat > .hg/hgrc <<EOF
901 > [web]
901 > [web]
902 > highlightfiles = **.c
902 > highlightfiles = **.c
903 > EOF
903 > EOF
904
904
905 hg serve again
905 hg serve again
906
906
907 $ hg serve -p $HGPORT -d -n test --pid-file=hg.pid -A access.log -E errors.log
907 $ hg serve -p $HGPORT -d -n test --pid-file=hg.pid -A access.log -E errors.log
908 $ cat hg.pid >> $DAEMON_PIDS
908 $ cat hg.pid >> $DAEMON_PIDS
909
909
910 test that fileset in highlightfiles works and primes.py is not highlighted
910 test that fileset in highlightfiles works and primes.py is not highlighted
911
911
912 $ get-with-headers.py localhost:$HGPORT 'file/tip/primes.py' | grep 'id="l11"'
912 $ get-with-headers.py localhost:$HGPORT 'file/tip/primes.py' | grep 'id="l11"'
913 <span id="l11"> def sieve(ns):</span><a href="#l11"></a>
913 <span id="l11"> def sieve(ns):</span><a href="#l11"></a>
914
914
915 errors encountered
915 errors encountered
916
916
917 $ cat errors.log
917 $ cat errors.log
918 $ cd ..
918 $ cd ..
919 $ hg init eucjp
919 $ hg init eucjp
920 $ cd eucjp
920 $ cd eucjp
921 $ $PYTHON -c 'print("\265\376")' >> eucjp.txt # Japanese kanji "Kyo"
921 $ $PYTHON -c 'print("\265\376")' >> eucjp.txt # Japanese kanji "Kyo"
922 $ hg ci -Ama
922 $ hg ci -Ama
923 adding eucjp.txt
923 adding eucjp.txt
924 $ hgserveget () {
924 $ hgserveget () {
925 > killdaemons.py
925 > killdaemons.py
926 > echo % HGENCODING="$1" hg serve
926 > echo % HGENCODING="$1" hg serve
927 > HGENCODING="$1" hg serve -p $HGPORT -d -n test --pid-file=hg.pid -E errors.log
927 > HGENCODING="$1" hg serve -p $HGPORT -d -n test --pid-file=hg.pid -E errors.log
928 > cat hg.pid >> $DAEMON_PIDS
928 > cat hg.pid >> $DAEMON_PIDS
929 >
929 >
930 > echo % hgweb filerevision, html
930 > echo % hgweb filerevision, html
931 > get-with-headers.py localhost:$HGPORT "file/tip/$2" \
931 > get-with-headers.py localhost:$HGPORT "file/tip/$2" \
932 > | grep '<div class="parity0 source">'
932 > | grep '<div class="parity0 source">'
933 > echo % errors encountered
933 > echo % errors encountered
934 > cat errors.log
934 > cat errors.log
935 > }
935 > }
936 $ hgserveget euc-jp eucjp.txt
936 $ hgserveget euc-jp eucjp.txt
937 % HGENCODING=euc-jp hg serve
937 % HGENCODING=euc-jp hg serve
938 % hgweb filerevision, html
938 % hgweb filerevision, html
939 % errors encountered
939 % errors encountered
940 $ hgserveget utf-8 eucjp.txt
940 $ hgserveget utf-8 eucjp.txt
941 % HGENCODING=utf-8 hg serve
941 % HGENCODING=utf-8 hg serve
942 % hgweb filerevision, html
942 % hgweb filerevision, html
943 % errors encountered
943 % errors encountered
944 $ hgserveget us-ascii eucjp.txt
944 $ hgserveget us-ascii eucjp.txt
945 % HGENCODING=us-ascii hg serve
945 % HGENCODING=us-ascii hg serve
946 % hgweb filerevision, html
946 % hgweb filerevision, html
947 % errors encountered
947 % errors encountered
948
948
949 We attempt to highlight unknown files by default
949 We attempt to highlight unknown files by default
950
950
951 $ killdaemons.py
951 $ killdaemons.py
952
952
953 $ cat > .hg/hgrc << EOF
953 $ cat > .hg/hgrc << EOF
954 > [web]
954 > [web]
955 > highlightfiles = **
955 > highlightfiles = **
956 > EOF
956 > EOF
957
957
958 $ cat > unknownfile << EOF
958 $ cat > unknownfile << EOF
959 > #!/usr/bin/python
959 > #!$PYTHON
960 > def foo():
960 > def foo():
961 > pass
961 > pass
962 > EOF
962 > EOF
963
963
964 $ hg add unknownfile
964 $ hg add unknownfile
965 $ hg commit -m unknown unknownfile
965 $ hg commit -m unknown unknownfile
966
966
967 $ hg serve -p $HGPORT -d -n test --pid-file=hg.pid
967 $ hg serve -p $HGPORT -d -n test --pid-file=hg.pid
968 $ cat hg.pid >> $DAEMON_PIDS
968 $ cat hg.pid >> $DAEMON_PIDS
969
969
970 $ get-with-headers.py localhost:$HGPORT 'file/tip/unknownfile' | grep l2
970 $ get-with-headers.py localhost:$HGPORT 'file/tip/unknownfile' | grep l2
971 <span id="l2"><span class="k">def</span> <span class="nf">foo</span><span class="p">():</span></span><a href="#l2"></a>
971 <span id="l2"><span class="k">def</span> <span class="nf">foo</span><span class="p">():</span></span><a href="#l2"></a>
972
972
973 We can prevent Pygments from falling back to a non filename-based
973 We can prevent Pygments from falling back to a non filename-based
974 detection mode
974 detection mode
975
975
976 $ cat > .hg/hgrc << EOF
976 $ cat > .hg/hgrc << EOF
977 > [web]
977 > [web]
978 > highlightfiles = **
978 > highlightfiles = **
979 > highlightonlymatchfilename = true
979 > highlightonlymatchfilename = true
980 > EOF
980 > EOF
981
981
982 $ killdaemons.py
982 $ killdaemons.py
983 $ hg serve -p $HGPORT -d -n test --pid-file=hg.pid
983 $ hg serve -p $HGPORT -d -n test --pid-file=hg.pid
984 $ cat hg.pid >> $DAEMON_PIDS
984 $ cat hg.pid >> $DAEMON_PIDS
985 $ get-with-headers.py localhost:$HGPORT 'file/tip/unknownfile' | grep l2
985 $ get-with-headers.py localhost:$HGPORT 'file/tip/unknownfile' | grep l2
986 <span id="l2">def foo():</span><a href="#l2"></a>
986 <span id="l2">def foo():</span><a href="#l2"></a>
987
987
988 $ cd ..
988 $ cd ..
@@ -1,259 +1,259 b''
1 Create user cache directory
1 Create user cache directory
2
2
3 $ USERCACHE=`pwd`/cache; export USERCACHE
3 $ USERCACHE=`pwd`/cache; export USERCACHE
4 $ cat <<EOF >> ${HGRCPATH}
4 $ cat <<EOF >> ${HGRCPATH}
5 > [extensions]
5 > [extensions]
6 > hgext.largefiles=
6 > hgext.largefiles=
7 > [largefiles]
7 > [largefiles]
8 > usercache=${USERCACHE}
8 > usercache=${USERCACHE}
9 > EOF
9 > EOF
10 $ mkdir -p ${USERCACHE}
10 $ mkdir -p ${USERCACHE}
11
11
12 Create source repo, and commit adding largefile.
12 Create source repo, and commit adding largefile.
13
13
14 $ hg init src
14 $ hg init src
15 $ cd src
15 $ cd src
16 $ echo large > large
16 $ echo large > large
17 $ hg add --large large
17 $ hg add --large large
18 $ hg commit -m 'add largefile'
18 $ hg commit -m 'add largefile'
19 $ hg rm large
19 $ hg rm large
20 $ hg commit -m 'branchhead without largefile' large
20 $ hg commit -m 'branchhead without largefile' large
21 $ hg up -qr 0
21 $ hg up -qr 0
22 $ rm large
22 $ rm large
23 $ echo "0000000000000000000000000000000000000000" > .hglf/large
23 $ echo "0000000000000000000000000000000000000000" > .hglf/large
24 $ hg commit -m 'commit missing file with corrupt standin' large
24 $ hg commit -m 'commit missing file with corrupt standin' large
25 abort: large: file not found!
25 abort: large: file not found!
26 [255]
26 [255]
27 $ hg up -Cqr 0
27 $ hg up -Cqr 0
28 $ cd ..
28 $ cd ..
29
29
30 Discard all cached largefiles in USERCACHE
30 Discard all cached largefiles in USERCACHE
31
31
32 $ rm -rf ${USERCACHE}
32 $ rm -rf ${USERCACHE}
33
33
34 Create mirror repo, and pull from source without largefile:
34 Create mirror repo, and pull from source without largefile:
35 "pull" is used instead of "clone" for suppression of (1) updating to
35 "pull" is used instead of "clone" for suppression of (1) updating to
36 tip (= caching largefile from source repo), and (2) recording source
36 tip (= caching largefile from source repo), and (2) recording source
37 repo as "default" path in .hg/hgrc.
37 repo as "default" path in .hg/hgrc.
38
38
39 $ hg init mirror
39 $ hg init mirror
40 $ cd mirror
40 $ cd mirror
41 $ hg pull ../src
41 $ hg pull ../src
42 pulling from ../src
42 pulling from ../src
43 requesting all changes
43 requesting all changes
44 adding changesets
44 adding changesets
45 adding manifests
45 adding manifests
46 adding file changes
46 adding file changes
47 added 2 changesets with 1 changes to 1 files
47 added 2 changesets with 1 changes to 1 files
48 (run 'hg update' to get a working copy)
48 (run 'hg update' to get a working copy)
49
49
50 Update working directory to "tip", which requires largefile("large"),
50 Update working directory to "tip", which requires largefile("large"),
51 but there is no cache file for it. So, hg must treat it as
51 but there is no cache file for it. So, hg must treat it as
52 "missing"(!) file.
52 "missing"(!) file.
53
53
54 $ hg update -r0
54 $ hg update -r0
55 getting changed largefiles
55 getting changed largefiles
56 large: largefile 7f7097b041ccf68cc5561e9600da4655d21c6d18 not available from file:/*/$TESTTMP/mirror (glob)
56 large: largefile 7f7097b041ccf68cc5561e9600da4655d21c6d18 not available from file:/*/$TESTTMP/mirror (glob)
57 0 largefiles updated, 0 removed
57 0 largefiles updated, 0 removed
58 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
58 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
59 $ hg status
59 $ hg status
60 ! large
60 ! large
61
61
62 Update working directory to null: this cleanup .hg/largefiles/dirstate
62 Update working directory to null: this cleanup .hg/largefiles/dirstate
63
63
64 $ hg update null
64 $ hg update null
65 getting changed largefiles
65 getting changed largefiles
66 0 largefiles updated, 0 removed
66 0 largefiles updated, 0 removed
67 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
67 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
68
68
69 Update working directory to tip, again.
69 Update working directory to tip, again.
70
70
71 $ hg update -r0
71 $ hg update -r0
72 getting changed largefiles
72 getting changed largefiles
73 large: largefile 7f7097b041ccf68cc5561e9600da4655d21c6d18 not available from file:/*/$TESTTMP/mirror (glob)
73 large: largefile 7f7097b041ccf68cc5561e9600da4655d21c6d18 not available from file:/*/$TESTTMP/mirror (glob)
74 0 largefiles updated, 0 removed
74 0 largefiles updated, 0 removed
75 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
75 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
76 $ hg status
76 $ hg status
77 ! large
77 ! large
78 $ cd ..
78 $ cd ..
79
79
80 Verify that largefiles from pulled branchheads are fetched, also to an empty repo
80 Verify that largefiles from pulled branchheads are fetched, also to an empty repo
81
81
82 $ hg init mirror2
82 $ hg init mirror2
83 $ hg -R mirror2 pull src -r0
83 $ hg -R mirror2 pull src -r0
84 pulling from src
84 pulling from src
85 adding changesets
85 adding changesets
86 adding manifests
86 adding manifests
87 adding file changes
87 adding file changes
88 added 1 changesets with 1 changes to 1 files
88 added 1 changesets with 1 changes to 1 files
89 (run 'hg update' to get a working copy)
89 (run 'hg update' to get a working copy)
90
90
91 #if unix-permissions
91 #if unix-permissions
92
92
93 Portable way to print file permissions:
93 Portable way to print file permissions:
94
94
95 $ cat > ls-l.py <<EOF
95 $ cat > ls-l.py <<EOF
96 > #!/usr/bin/env python
96 > #!$PYTHON
97 > import sys, os
97 > import sys, os
98 > path = sys.argv[1]
98 > path = sys.argv[1]
99 > print '%03o' % (os.lstat(path).st_mode & 0777)
99 > print '%03o' % (os.lstat(path).st_mode & 0777)
100 > EOF
100 > EOF
101 $ chmod +x ls-l.py
101 $ chmod +x ls-l.py
102
102
103 Test that files in .hg/largefiles inherit mode from .hg/store, not
103 Test that files in .hg/largefiles inherit mode from .hg/store, not
104 from file in working copy:
104 from file in working copy:
105
105
106 $ cd src
106 $ cd src
107 $ chmod 750 .hg/store
107 $ chmod 750 .hg/store
108 $ chmod 660 large
108 $ chmod 660 large
109 $ echo change >> large
109 $ echo change >> large
110 $ hg commit -m change
110 $ hg commit -m change
111 created new head
111 created new head
112 $ ../ls-l.py .hg/largefiles/e151b474069de4ca6898f67ce2f2a7263adf8fea
112 $ ../ls-l.py .hg/largefiles/e151b474069de4ca6898f67ce2f2a7263adf8fea
113 640
113 640
114
114
115 Test permission of with files in .hg/largefiles created by update:
115 Test permission of with files in .hg/largefiles created by update:
116
116
117 $ cd ../mirror
117 $ cd ../mirror
118 $ rm -r "$USERCACHE" .hg/largefiles # avoid links
118 $ rm -r "$USERCACHE" .hg/largefiles # avoid links
119 $ chmod 750 .hg/store
119 $ chmod 750 .hg/store
120 $ hg pull ../src --update -q
120 $ hg pull ../src --update -q
121 $ ../ls-l.py .hg/largefiles/e151b474069de4ca6898f67ce2f2a7263adf8fea
121 $ ../ls-l.py .hg/largefiles/e151b474069de4ca6898f67ce2f2a7263adf8fea
122 640
122 640
123
123
124 Test permission of files created by push:
124 Test permission of files created by push:
125
125
126 $ hg serve -R ../src -d -p $HGPORT --pid-file hg.pid \
126 $ hg serve -R ../src -d -p $HGPORT --pid-file hg.pid \
127 > --config "web.allow_push=*" --config web.push_ssl=no
127 > --config "web.allow_push=*" --config web.push_ssl=no
128 $ cat hg.pid >> $DAEMON_PIDS
128 $ cat hg.pid >> $DAEMON_PIDS
129
129
130 $ echo change >> large
130 $ echo change >> large
131 $ hg commit -m change
131 $ hg commit -m change
132
132
133 $ rm -r "$USERCACHE"
133 $ rm -r "$USERCACHE"
134
134
135 $ hg push -q http://localhost:$HGPORT/
135 $ hg push -q http://localhost:$HGPORT/
136
136
137 $ ../ls-l.py ../src/.hg/largefiles/b734e14a0971e370408ab9bce8d56d8485e368a9
137 $ ../ls-l.py ../src/.hg/largefiles/b734e14a0971e370408ab9bce8d56d8485e368a9
138 640
138 640
139
139
140 $ cd ..
140 $ cd ..
141
141
142 #endif
142 #endif
143
143
144 Test issue 4053 (remove --after on a deleted, uncommitted file shouldn't say
144 Test issue 4053 (remove --after on a deleted, uncommitted file shouldn't say
145 it is missing, but a remove on a nonexistent unknown file still should. Same
145 it is missing, but a remove on a nonexistent unknown file still should. Same
146 for a forget.)
146 for a forget.)
147
147
148 $ cd src
148 $ cd src
149 $ touch x
149 $ touch x
150 $ hg add x
150 $ hg add x
151 $ mv x y
151 $ mv x y
152 $ hg remove -A x y ENOENT
152 $ hg remove -A x y ENOENT
153 ENOENT: * (glob)
153 ENOENT: * (glob)
154 not removing y: file is untracked
154 not removing y: file is untracked
155 [1]
155 [1]
156 $ hg add y
156 $ hg add y
157 $ mv y z
157 $ mv y z
158 $ hg forget y z ENOENT
158 $ hg forget y z ENOENT
159 ENOENT: * (glob)
159 ENOENT: * (glob)
160 not removing z: file is already untracked
160 not removing z: file is already untracked
161 [1]
161 [1]
162
162
163 Largefiles are accessible from the share's store
163 Largefiles are accessible from the share's store
164 $ cd ..
164 $ cd ..
165 $ hg share -q src share_dst --config extensions.share=
165 $ hg share -q src share_dst --config extensions.share=
166 $ hg -R share_dst update -r0
166 $ hg -R share_dst update -r0
167 getting changed largefiles
167 getting changed largefiles
168 1 largefiles updated, 0 removed
168 1 largefiles updated, 0 removed
169 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
169 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
170
170
171 $ echo modified > share_dst/large
171 $ echo modified > share_dst/large
172 $ hg -R share_dst ci -m modified
172 $ hg -R share_dst ci -m modified
173 created new head
173 created new head
174
174
175 Only dirstate is in the local store for the share, and the largefile is in the
175 Only dirstate is in the local store for the share, and the largefile is in the
176 share source's local store. Avoid the extra largefiles added in the unix
176 share source's local store. Avoid the extra largefiles added in the unix
177 conditional above.
177 conditional above.
178 $ hash=`hg -R share_dst cat share_dst/.hglf/large`
178 $ hash=`hg -R share_dst cat share_dst/.hglf/large`
179 $ echo $hash
179 $ echo $hash
180 e2fb5f2139d086ded2cb600d5a91a196e76bf020
180 e2fb5f2139d086ded2cb600d5a91a196e76bf020
181
181
182 $ find share_dst/.hg/largefiles/* | sort
182 $ find share_dst/.hg/largefiles/* | sort
183 share_dst/.hg/largefiles/dirstate
183 share_dst/.hg/largefiles/dirstate
184
184
185 $ find src/.hg/largefiles/* | egrep "(dirstate|$hash)" | sort
185 $ find src/.hg/largefiles/* | egrep "(dirstate|$hash)" | sort
186 src/.hg/largefiles/dirstate
186 src/.hg/largefiles/dirstate
187 src/.hg/largefiles/e2fb5f2139d086ded2cb600d5a91a196e76bf020
187 src/.hg/largefiles/e2fb5f2139d086ded2cb600d5a91a196e76bf020
188
188
189 Verify that backwards compatibility is maintained for old storage layout
189 Verify that backwards compatibility is maintained for old storage layout
190 $ mv src/.hg/largefiles/$hash share_dst/.hg/largefiles
190 $ mv src/.hg/largefiles/$hash share_dst/.hg/largefiles
191 $ hg verify --quiet --lfa -R share_dst --config largefiles.usercache=
191 $ hg verify --quiet --lfa -R share_dst --config largefiles.usercache=
192
192
193 Inject corruption into the largefiles store and see how update handles that:
193 Inject corruption into the largefiles store and see how update handles that:
194
194
195 $ cd src
195 $ cd src
196 $ hg up -qC tip
196 $ hg up -qC tip
197 $ cat large
197 $ cat large
198 modified
198 modified
199 $ rm large
199 $ rm large
200 $ cat .hglf/large
200 $ cat .hglf/large
201 e2fb5f2139d086ded2cb600d5a91a196e76bf020
201 e2fb5f2139d086ded2cb600d5a91a196e76bf020
202 $ mv .hg/largefiles/e2fb5f2139d086ded2cb600d5a91a196e76bf020 ..
202 $ mv .hg/largefiles/e2fb5f2139d086ded2cb600d5a91a196e76bf020 ..
203 $ echo corruption > .hg/largefiles/e2fb5f2139d086ded2cb600d5a91a196e76bf020
203 $ echo corruption > .hg/largefiles/e2fb5f2139d086ded2cb600d5a91a196e76bf020
204 $ hg up -C
204 $ hg up -C
205 getting changed largefiles
205 getting changed largefiles
206 large: data corruption in $TESTTMP/src/.hg/largefiles/e2fb5f2139d086ded2cb600d5a91a196e76bf020 with hash 6a7bb2556144babe3899b25e5428123735bb1e27 (glob)
206 large: data corruption in $TESTTMP/src/.hg/largefiles/e2fb5f2139d086ded2cb600d5a91a196e76bf020 with hash 6a7bb2556144babe3899b25e5428123735bb1e27 (glob)
207 0 largefiles updated, 0 removed
207 0 largefiles updated, 0 removed
208 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
208 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
209 updated to "cd24c147f45c: modified"
209 updated to "cd24c147f45c: modified"
210 [12] other heads for branch "default" (re)
210 [12] other heads for branch "default" (re)
211 $ hg st
211 $ hg st
212 ! large
212 ! large
213 ? z
213 ? z
214 $ rm .hg/largefiles/e2fb5f2139d086ded2cb600d5a91a196e76bf020
214 $ rm .hg/largefiles/e2fb5f2139d086ded2cb600d5a91a196e76bf020
215
215
216 #if serve
216 #if serve
217
217
218 Test coverage of error handling from putlfile:
218 Test coverage of error handling from putlfile:
219
219
220 $ mkdir $TESTTMP/mirrorcache
220 $ mkdir $TESTTMP/mirrorcache
221 $ hg serve -R ../mirror -d -p $HGPORT1 --pid-file hg.pid --config largefiles.usercache=$TESTTMP/mirrorcache
221 $ hg serve -R ../mirror -d -p $HGPORT1 --pid-file hg.pid --config largefiles.usercache=$TESTTMP/mirrorcache
222 $ cat hg.pid >> $DAEMON_PIDS
222 $ cat hg.pid >> $DAEMON_PIDS
223
223
224 $ hg push http://localhost:$HGPORT1 -f --config files.usercache=nocache
224 $ hg push http://localhost:$HGPORT1 -f --config files.usercache=nocache
225 pushing to http://localhost:$HGPORT1/
225 pushing to http://localhost:$HGPORT1/
226 searching for changes
226 searching for changes
227 abort: remotestore: could not open file $TESTTMP/src/.hg/largefiles/e2fb5f2139d086ded2cb600d5a91a196e76bf020: HTTP Error 403: ssl required (glob)
227 abort: remotestore: could not open file $TESTTMP/src/.hg/largefiles/e2fb5f2139d086ded2cb600d5a91a196e76bf020: HTTP Error 403: ssl required (glob)
228 [255]
228 [255]
229
229
230 $ rm .hg/largefiles/e2fb5f2139d086ded2cb600d5a91a196e76bf020
230 $ rm .hg/largefiles/e2fb5f2139d086ded2cb600d5a91a196e76bf020
231
231
232 Test coverage of 'missing from store':
232 Test coverage of 'missing from store':
233
233
234 $ hg serve -R ../mirror -d -p $HGPORT2 --pid-file hg.pid --config largefiles.usercache=$TESTTMP/mirrorcache --config "web.allow_push=*" --config web.push_ssl=no
234 $ hg serve -R ../mirror -d -p $HGPORT2 --pid-file hg.pid --config largefiles.usercache=$TESTTMP/mirrorcache --config "web.allow_push=*" --config web.push_ssl=no
235 $ cat hg.pid >> $DAEMON_PIDS
235 $ cat hg.pid >> $DAEMON_PIDS
236
236
237 $ hg push http://localhost:$HGPORT2 -f --config largefiles.usercache=nocache
237 $ hg push http://localhost:$HGPORT2 -f --config largefiles.usercache=nocache
238 pushing to http://localhost:$HGPORT2/
238 pushing to http://localhost:$HGPORT2/
239 searching for changes
239 searching for changes
240 abort: largefile e2fb5f2139d086ded2cb600d5a91a196e76bf020 missing from store (needs to be uploaded)
240 abort: largefile e2fb5f2139d086ded2cb600d5a91a196e76bf020 missing from store (needs to be uploaded)
241 [255]
241 [255]
242
242
243 Verify that --lfrev controls which revisions are checked for largefiles to push
243 Verify that --lfrev controls which revisions are checked for largefiles to push
244
244
245 $ hg push http://localhost:$HGPORT2 -f --config largefiles.usercache=nocache --lfrev tip
245 $ hg push http://localhost:$HGPORT2 -f --config largefiles.usercache=nocache --lfrev tip
246 pushing to http://localhost:$HGPORT2/
246 pushing to http://localhost:$HGPORT2/
247 searching for changes
247 searching for changes
248 abort: largefile e2fb5f2139d086ded2cb600d5a91a196e76bf020 missing from store (needs to be uploaded)
248 abort: largefile e2fb5f2139d086ded2cb600d5a91a196e76bf020 missing from store (needs to be uploaded)
249 [255]
249 [255]
250
250
251 $ hg push http://localhost:$HGPORT2 -f --config largefiles.usercache=nocache --lfrev null
251 $ hg push http://localhost:$HGPORT2 -f --config largefiles.usercache=nocache --lfrev null
252 pushing to http://localhost:$HGPORT2/
252 pushing to http://localhost:$HGPORT2/
253 searching for changes
253 searching for changes
254 remote: adding changesets
254 remote: adding changesets
255 remote: adding manifests
255 remote: adding manifests
256 remote: adding file changes
256 remote: adding file changes
257 remote: added 1 changesets with 1 changes to 1 files (+1 heads)
257 remote: added 1 changesets with 1 changes to 1 files (+1 heads)
258
258
259 #endif
259 #endif
@@ -1,1881 +1,1881 b''
1 This file used to contains all largefile tests.
1 This file used to contains all largefile tests.
2 Do not add any new tests in this file as it his already far too long to run.
2 Do not add any new tests in this file as it his already far too long to run.
3
3
4 It contains all the testing of the basic concepts of large file in a single block.
4 It contains all the testing of the basic concepts of large file in a single block.
5
5
6 $ USERCACHE="$TESTTMP/cache"; export USERCACHE
6 $ USERCACHE="$TESTTMP/cache"; export USERCACHE
7 $ mkdir "${USERCACHE}"
7 $ mkdir "${USERCACHE}"
8 $ cat >> $HGRCPATH <<EOF
8 $ cat >> $HGRCPATH <<EOF
9 > [extensions]
9 > [extensions]
10 > largefiles=
10 > largefiles=
11 > purge=
11 > purge=
12 > rebase=
12 > rebase=
13 > transplant=
13 > transplant=
14 > [phases]
14 > [phases]
15 > publish=False
15 > publish=False
16 > [largefiles]
16 > [largefiles]
17 > minsize=2
17 > minsize=2
18 > patterns=glob:**.dat
18 > patterns=glob:**.dat
19 > usercache=${USERCACHE}
19 > usercache=${USERCACHE}
20 > [hooks]
20 > [hooks]
21 > precommit=sh -c "echo \\"Invoking status precommit hook\\"; hg status"
21 > precommit=sh -c "echo \\"Invoking status precommit hook\\"; hg status"
22 > EOF
22 > EOF
23
23
24 Create the repo with a couple of revisions of both large and normal
24 Create the repo with a couple of revisions of both large and normal
25 files.
25 files.
26 Test status and dirstate of largefiles and that summary output is correct.
26 Test status and dirstate of largefiles and that summary output is correct.
27
27
28 $ hg init a
28 $ hg init a
29 $ cd a
29 $ cd a
30 $ mkdir sub
30 $ mkdir sub
31 $ echo normal1 > normal1
31 $ echo normal1 > normal1
32 $ echo normal2 > sub/normal2
32 $ echo normal2 > sub/normal2
33 $ echo large1 > large1
33 $ echo large1 > large1
34 $ echo large2 > sub/large2
34 $ echo large2 > sub/large2
35 $ hg add normal1 sub/normal2
35 $ hg add normal1 sub/normal2
36 $ hg add --large large1 sub/large2
36 $ hg add --large large1 sub/large2
37 $ hg commit -m "add files"
37 $ hg commit -m "add files"
38 Invoking status precommit hook
38 Invoking status precommit hook
39 A large1
39 A large1
40 A normal1
40 A normal1
41 A sub/large2
41 A sub/large2
42 A sub/normal2
42 A sub/normal2
43 $ touch large1 sub/large2
43 $ touch large1 sub/large2
44 $ sleep 1
44 $ sleep 1
45 $ hg st
45 $ hg st
46 $ hg debugstate --nodates
46 $ hg debugstate --nodates
47 n 644 41 set .hglf/large1
47 n 644 41 set .hglf/large1
48 n 644 41 set .hglf/sub/large2
48 n 644 41 set .hglf/sub/large2
49 n 644 8 set normal1
49 n 644 8 set normal1
50 n 644 8 set sub/normal2
50 n 644 8 set sub/normal2
51 $ hg debugstate --large --nodates
51 $ hg debugstate --large --nodates
52 n 644 7 set large1
52 n 644 7 set large1
53 n 644 7 set sub/large2
53 n 644 7 set sub/large2
54 $ echo normal11 > normal1
54 $ echo normal11 > normal1
55 $ echo normal22 > sub/normal2
55 $ echo normal22 > sub/normal2
56 $ echo large11 > large1
56 $ echo large11 > large1
57 $ echo large22 > sub/large2
57 $ echo large22 > sub/large2
58 $ hg commit -m "edit files"
58 $ hg commit -m "edit files"
59 Invoking status precommit hook
59 Invoking status precommit hook
60 M large1
60 M large1
61 M normal1
61 M normal1
62 M sub/large2
62 M sub/large2
63 M sub/normal2
63 M sub/normal2
64 $ hg sum --large
64 $ hg sum --large
65 parent: 1:ce8896473775 tip
65 parent: 1:ce8896473775 tip
66 edit files
66 edit files
67 branch: default
67 branch: default
68 commit: (clean)
68 commit: (clean)
69 update: (current)
69 update: (current)
70 phases: 2 draft
70 phases: 2 draft
71 largefiles: (no remote repo)
71 largefiles: (no remote repo)
72
72
73 Commit preserved largefile contents.
73 Commit preserved largefile contents.
74
74
75 $ cat normal1
75 $ cat normal1
76 normal11
76 normal11
77 $ cat large1
77 $ cat large1
78 large11
78 large11
79 $ cat sub/normal2
79 $ cat sub/normal2
80 normal22
80 normal22
81 $ cat sub/large2
81 $ cat sub/large2
82 large22
82 large22
83
83
84 Test status, subdir and unknown files
84 Test status, subdir and unknown files
85
85
86 $ echo unknown > sub/unknown
86 $ echo unknown > sub/unknown
87 $ hg st --all
87 $ hg st --all
88 ? sub/unknown
88 ? sub/unknown
89 C large1
89 C large1
90 C normal1
90 C normal1
91 C sub/large2
91 C sub/large2
92 C sub/normal2
92 C sub/normal2
93 $ hg st --all sub
93 $ hg st --all sub
94 ? sub/unknown
94 ? sub/unknown
95 C sub/large2
95 C sub/large2
96 C sub/normal2
96 C sub/normal2
97 $ rm sub/unknown
97 $ rm sub/unknown
98
98
99 Test messages and exit codes for remove warning cases
99 Test messages and exit codes for remove warning cases
100
100
101 $ hg remove -A large1
101 $ hg remove -A large1
102 not removing large1: file still exists
102 not removing large1: file still exists
103 [1]
103 [1]
104 $ echo 'modified' > large1
104 $ echo 'modified' > large1
105 $ hg remove large1
105 $ hg remove large1
106 not removing large1: file is modified (use -f to force removal)
106 not removing large1: file is modified (use -f to force removal)
107 [1]
107 [1]
108 $ echo 'new' > normalnew
108 $ echo 'new' > normalnew
109 $ hg add normalnew
109 $ hg add normalnew
110 $ echo 'new' > largenew
110 $ echo 'new' > largenew
111 $ hg add --large normalnew
111 $ hg add --large normalnew
112 normalnew already tracked!
112 normalnew already tracked!
113 $ hg remove normalnew largenew
113 $ hg remove normalnew largenew
114 not removing largenew: file is untracked
114 not removing largenew: file is untracked
115 not removing normalnew: file has been marked for add (use 'hg forget' to undo add)
115 not removing normalnew: file has been marked for add (use 'hg forget' to undo add)
116 [1]
116 [1]
117 $ rm normalnew largenew
117 $ rm normalnew largenew
118 $ hg up -Cq
118 $ hg up -Cq
119
119
120 Remove both largefiles and normal files.
120 Remove both largefiles and normal files.
121
121
122 $ hg remove normal1 large1
122 $ hg remove normal1 large1
123 $ hg status large1
123 $ hg status large1
124 R large1
124 R large1
125 $ hg commit -m "remove files"
125 $ hg commit -m "remove files"
126 Invoking status precommit hook
126 Invoking status precommit hook
127 R large1
127 R large1
128 R normal1
128 R normal1
129 $ ls
129 $ ls
130 sub
130 sub
131 $ echo "testlargefile" > large1-test
131 $ echo "testlargefile" > large1-test
132 $ hg add --large large1-test
132 $ hg add --large large1-test
133 $ hg st
133 $ hg st
134 A large1-test
134 A large1-test
135 $ hg rm large1-test
135 $ hg rm large1-test
136 not removing large1-test: file has been marked for add (use forget to undo)
136 not removing large1-test: file has been marked for add (use forget to undo)
137 [1]
137 [1]
138 $ hg st
138 $ hg st
139 A large1-test
139 A large1-test
140 $ hg forget large1-test
140 $ hg forget large1-test
141 $ hg st
141 $ hg st
142 ? large1-test
142 ? large1-test
143 $ hg remove large1-test
143 $ hg remove large1-test
144 not removing large1-test: file is untracked
144 not removing large1-test: file is untracked
145 [1]
145 [1]
146 $ hg forget large1-test
146 $ hg forget large1-test
147 not removing large1-test: file is already untracked
147 not removing large1-test: file is already untracked
148 [1]
148 [1]
149 $ rm large1-test
149 $ rm large1-test
150
150
151 Copy both largefiles and normal files (testing that status output is correct).
151 Copy both largefiles and normal files (testing that status output is correct).
152
152
153 $ hg cp sub/normal2 normal1
153 $ hg cp sub/normal2 normal1
154 $ hg cp sub/large2 large1
154 $ hg cp sub/large2 large1
155 $ hg commit -m "copy files"
155 $ hg commit -m "copy files"
156 Invoking status precommit hook
156 Invoking status precommit hook
157 A large1
157 A large1
158 A normal1
158 A normal1
159 $ cat normal1
159 $ cat normal1
160 normal22
160 normal22
161 $ cat large1
161 $ cat large1
162 large22
162 large22
163
163
164 Test moving largefiles and verify that normal files are also unaffected.
164 Test moving largefiles and verify that normal files are also unaffected.
165
165
166 $ hg mv normal1 normal3
166 $ hg mv normal1 normal3
167 $ hg mv large1 large3
167 $ hg mv large1 large3
168 $ hg mv sub/normal2 sub/normal4
168 $ hg mv sub/normal2 sub/normal4
169 $ hg mv sub/large2 sub/large4
169 $ hg mv sub/large2 sub/large4
170 $ hg commit -m "move files"
170 $ hg commit -m "move files"
171 Invoking status precommit hook
171 Invoking status precommit hook
172 A large3
172 A large3
173 A normal3
173 A normal3
174 A sub/large4
174 A sub/large4
175 A sub/normal4
175 A sub/normal4
176 R large1
176 R large1
177 R normal1
177 R normal1
178 R sub/large2
178 R sub/large2
179 R sub/normal2
179 R sub/normal2
180 $ cat normal3
180 $ cat normal3
181 normal22
181 normal22
182 $ cat large3
182 $ cat large3
183 large22
183 large22
184 $ cat sub/normal4
184 $ cat sub/normal4
185 normal22
185 normal22
186 $ cat sub/large4
186 $ cat sub/large4
187 large22
187 large22
188
188
189
189
190 #if serve
190 #if serve
191 Test display of largefiles in hgweb
191 Test display of largefiles in hgweb
192
192
193 $ hg serve -d -p $HGPORT --pid-file ../hg.pid
193 $ hg serve -d -p $HGPORT --pid-file ../hg.pid
194 $ cat ../hg.pid >> $DAEMON_PIDS
194 $ cat ../hg.pid >> $DAEMON_PIDS
195 $ get-with-headers.py $LOCALIP:$HGPORT 'file/tip/?style=raw'
195 $ get-with-headers.py $LOCALIP:$HGPORT 'file/tip/?style=raw'
196 200 Script output follows
196 200 Script output follows
197
197
198
198
199 drwxr-xr-x sub
199 drwxr-xr-x sub
200 -rw-r--r-- 41 large3
200 -rw-r--r-- 41 large3
201 -rw-r--r-- 9 normal3
201 -rw-r--r-- 9 normal3
202
202
203
203
204 $ get-with-headers.py $LOCALIP:$HGPORT 'file/tip/sub/?style=raw'
204 $ get-with-headers.py $LOCALIP:$HGPORT 'file/tip/sub/?style=raw'
205 200 Script output follows
205 200 Script output follows
206
206
207
207
208 -rw-r--r-- 41 large4
208 -rw-r--r-- 41 large4
209 -rw-r--r-- 9 normal4
209 -rw-r--r-- 9 normal4
210
210
211
211
212 $ killdaemons.py
212 $ killdaemons.py
213 #endif
213 #endif
214
214
215 Test largefiles can be loaded in hgweb (wrapcommand() shouldn't fail)
215 Test largefiles can be loaded in hgweb (wrapcommand() shouldn't fail)
216
216
217 $ cat <<EOF > "$TESTTMP/hgweb.cgi"
217 $ cat <<EOF > "$TESTTMP/hgweb.cgi"
218 > #!/usr/bin/env python
218 > #!$PYTHON
219 > from mercurial import demandimport; demandimport.enable()
219 > from mercurial import demandimport; demandimport.enable()
220 > from mercurial.hgweb import hgweb
220 > from mercurial.hgweb import hgweb
221 > from mercurial.hgweb import wsgicgi
221 > from mercurial.hgweb import wsgicgi
222 > application = hgweb('.', 'test repo')
222 > application = hgweb('.', 'test repo')
223 > wsgicgi.launch(application)
223 > wsgicgi.launch(application)
224 > EOF
224 > EOF
225
225
226 $ PATH_INFO='/' \
226 $ PATH_INFO='/' \
227 > QUERY_STRING='' \
227 > QUERY_STRING='' \
228 > REQUEST_METHOD='GET' \
228 > REQUEST_METHOD='GET' \
229 > SCRIPT_NAME='' \
229 > SCRIPT_NAME='' \
230 > SERVER_NAME='localhost' \
230 > SERVER_NAME='localhost' \
231 > SERVER_PORT='80' \
231 > SERVER_PORT='80' \
232 > python "$TESTTMP/hgweb.cgi" > /dev/null
232 > python "$TESTTMP/hgweb.cgi" > /dev/null
233
233
234 Test archiving the various revisions. These hit corner cases known with
234 Test archiving the various revisions. These hit corner cases known with
235 archiving.
235 archiving.
236
236
237 $ hg archive -r 0 ../archive0
237 $ hg archive -r 0 ../archive0
238 $ hg archive -r 1 ../archive1
238 $ hg archive -r 1 ../archive1
239 $ hg archive -r 2 ../archive2
239 $ hg archive -r 2 ../archive2
240 $ hg archive -r 3 ../archive3
240 $ hg archive -r 3 ../archive3
241 $ hg archive -r 4 ../archive4
241 $ hg archive -r 4 ../archive4
242 $ cd ../archive0
242 $ cd ../archive0
243 $ cat normal1
243 $ cat normal1
244 normal1
244 normal1
245 $ cat large1
245 $ cat large1
246 large1
246 large1
247 $ cat sub/normal2
247 $ cat sub/normal2
248 normal2
248 normal2
249 $ cat sub/large2
249 $ cat sub/large2
250 large2
250 large2
251 $ cd ../archive1
251 $ cd ../archive1
252 $ cat normal1
252 $ cat normal1
253 normal11
253 normal11
254 $ cat large1
254 $ cat large1
255 large11
255 large11
256 $ cat sub/normal2
256 $ cat sub/normal2
257 normal22
257 normal22
258 $ cat sub/large2
258 $ cat sub/large2
259 large22
259 large22
260 $ cd ../archive2
260 $ cd ../archive2
261 $ ls
261 $ ls
262 sub
262 sub
263 $ cat sub/normal2
263 $ cat sub/normal2
264 normal22
264 normal22
265 $ cat sub/large2
265 $ cat sub/large2
266 large22
266 large22
267 $ cd ../archive3
267 $ cd ../archive3
268 $ cat normal1
268 $ cat normal1
269 normal22
269 normal22
270 $ cat large1
270 $ cat large1
271 large22
271 large22
272 $ cat sub/normal2
272 $ cat sub/normal2
273 normal22
273 normal22
274 $ cat sub/large2
274 $ cat sub/large2
275 large22
275 large22
276 $ cd ../archive4
276 $ cd ../archive4
277 $ cat normal3
277 $ cat normal3
278 normal22
278 normal22
279 $ cat large3
279 $ cat large3
280 large22
280 large22
281 $ cat sub/normal4
281 $ cat sub/normal4
282 normal22
282 normal22
283 $ cat sub/large4
283 $ cat sub/large4
284 large22
284 large22
285
285
286 Commit corner case: specify files to commit.
286 Commit corner case: specify files to commit.
287
287
288 $ cd ../a
288 $ cd ../a
289 $ echo normal3 > normal3
289 $ echo normal3 > normal3
290 $ echo large3 > large3
290 $ echo large3 > large3
291 $ echo normal4 > sub/normal4
291 $ echo normal4 > sub/normal4
292 $ echo large4 > sub/large4
292 $ echo large4 > sub/large4
293 $ hg commit normal3 large3 sub/normal4 sub/large4 -m "edit files again"
293 $ hg commit normal3 large3 sub/normal4 sub/large4 -m "edit files again"
294 Invoking status precommit hook
294 Invoking status precommit hook
295 M large3
295 M large3
296 M normal3
296 M normal3
297 M sub/large4
297 M sub/large4
298 M sub/normal4
298 M sub/normal4
299 $ cat normal3
299 $ cat normal3
300 normal3
300 normal3
301 $ cat large3
301 $ cat large3
302 large3
302 large3
303 $ cat sub/normal4
303 $ cat sub/normal4
304 normal4
304 normal4
305 $ cat sub/large4
305 $ cat sub/large4
306 large4
306 large4
307
307
308 One more commit corner case: commit from a subdirectory.
308 One more commit corner case: commit from a subdirectory.
309
309
310 $ cd ../a
310 $ cd ../a
311 $ echo normal33 > normal3
311 $ echo normal33 > normal3
312 $ echo large33 > large3
312 $ echo large33 > large3
313 $ echo normal44 > sub/normal4
313 $ echo normal44 > sub/normal4
314 $ echo large44 > sub/large4
314 $ echo large44 > sub/large4
315 $ cd sub
315 $ cd sub
316 $ hg commit -m "edit files yet again"
316 $ hg commit -m "edit files yet again"
317 Invoking status precommit hook
317 Invoking status precommit hook
318 M large3
318 M large3
319 M normal3
319 M normal3
320 M sub/large4
320 M sub/large4
321 M sub/normal4
321 M sub/normal4
322 $ cat ../normal3
322 $ cat ../normal3
323 normal33
323 normal33
324 $ cat ../large3
324 $ cat ../large3
325 large33
325 large33
326 $ cat normal4
326 $ cat normal4
327 normal44
327 normal44
328 $ cat large4
328 $ cat large4
329 large44
329 large44
330
330
331 Committing standins is not allowed.
331 Committing standins is not allowed.
332
332
333 $ cd ..
333 $ cd ..
334 $ echo large3 > large3
334 $ echo large3 > large3
335 $ hg commit .hglf/large3 -m "try to commit standin"
335 $ hg commit .hglf/large3 -m "try to commit standin"
336 abort: file ".hglf/large3" is a largefile standin
336 abort: file ".hglf/large3" is a largefile standin
337 (commit the largefile itself instead)
337 (commit the largefile itself instead)
338 [255]
338 [255]
339
339
340 Corner cases for adding largefiles.
340 Corner cases for adding largefiles.
341
341
342 $ echo large5 > large5
342 $ echo large5 > large5
343 $ hg add --large large5
343 $ hg add --large large5
344 $ hg add --large large5
344 $ hg add --large large5
345 large5 already a largefile
345 large5 already a largefile
346 $ mkdir sub2
346 $ mkdir sub2
347 $ echo large6 > sub2/large6
347 $ echo large6 > sub2/large6
348 $ echo large7 > sub2/large7
348 $ echo large7 > sub2/large7
349 $ hg add --large sub2
349 $ hg add --large sub2
350 adding sub2/large6 as a largefile (glob)
350 adding sub2/large6 as a largefile (glob)
351 adding sub2/large7 as a largefile (glob)
351 adding sub2/large7 as a largefile (glob)
352 $ hg st
352 $ hg st
353 M large3
353 M large3
354 A large5
354 A large5
355 A sub2/large6
355 A sub2/large6
356 A sub2/large7
356 A sub2/large7
357
357
358 Committing directories containing only largefiles.
358 Committing directories containing only largefiles.
359
359
360 $ mkdir -p z/y/x/m
360 $ mkdir -p z/y/x/m
361 $ touch z/y/x/m/large1
361 $ touch z/y/x/m/large1
362 $ touch z/y/x/large2
362 $ touch z/y/x/large2
363 $ hg add --large z/y/x/m/large1 z/y/x/large2
363 $ hg add --large z/y/x/m/large1 z/y/x/large2
364 $ hg commit -m "Subdir with directory only containing largefiles" z
364 $ hg commit -m "Subdir with directory only containing largefiles" z
365 Invoking status precommit hook
365 Invoking status precommit hook
366 M large3
366 M large3
367 A large5
367 A large5
368 A sub2/large6
368 A sub2/large6
369 A sub2/large7
369 A sub2/large7
370 A z/y/x/large2
370 A z/y/x/large2
371 A z/y/x/m/large1
371 A z/y/x/m/large1
372
372
373 (and a bit of log testing)
373 (and a bit of log testing)
374
374
375 $ hg log -T '{rev}\n' z/y/x/m/large1
375 $ hg log -T '{rev}\n' z/y/x/m/large1
376 7
376 7
377 $ hg log -T '{rev}\n' z/y/x/m # with only a largefile
377 $ hg log -T '{rev}\n' z/y/x/m # with only a largefile
378 7
378 7
379
379
380 $ hg rollback --quiet
380 $ hg rollback --quiet
381 $ touch z/y/x/m/normal
381 $ touch z/y/x/m/normal
382 $ hg add z/y/x/m/normal
382 $ hg add z/y/x/m/normal
383 $ hg commit -m "Subdir with mixed contents" z
383 $ hg commit -m "Subdir with mixed contents" z
384 Invoking status precommit hook
384 Invoking status precommit hook
385 M large3
385 M large3
386 A large5
386 A large5
387 A sub2/large6
387 A sub2/large6
388 A sub2/large7
388 A sub2/large7
389 A z/y/x/large2
389 A z/y/x/large2
390 A z/y/x/m/large1
390 A z/y/x/m/large1
391 A z/y/x/m/normal
391 A z/y/x/m/normal
392 $ hg st
392 $ hg st
393 M large3
393 M large3
394 A large5
394 A large5
395 A sub2/large6
395 A sub2/large6
396 A sub2/large7
396 A sub2/large7
397 $ hg rollback --quiet
397 $ hg rollback --quiet
398 $ hg revert z/y/x/large2 z/y/x/m/large1
398 $ hg revert z/y/x/large2 z/y/x/m/large1
399 $ rm z/y/x/large2 z/y/x/m/large1
399 $ rm z/y/x/large2 z/y/x/m/large1
400 $ hg commit -m "Subdir with normal contents" z
400 $ hg commit -m "Subdir with normal contents" z
401 Invoking status precommit hook
401 Invoking status precommit hook
402 M large3
402 M large3
403 A large5
403 A large5
404 A sub2/large6
404 A sub2/large6
405 A sub2/large7
405 A sub2/large7
406 A z/y/x/m/normal
406 A z/y/x/m/normal
407 $ hg st
407 $ hg st
408 M large3
408 M large3
409 A large5
409 A large5
410 A sub2/large6
410 A sub2/large6
411 A sub2/large7
411 A sub2/large7
412 $ hg rollback --quiet
412 $ hg rollback --quiet
413 $ hg revert --quiet z
413 $ hg revert --quiet z
414 $ hg commit -m "Empty subdir" z
414 $ hg commit -m "Empty subdir" z
415 abort: z: no match under directory!
415 abort: z: no match under directory!
416 [255]
416 [255]
417 $ rm -rf z
417 $ rm -rf z
418 $ hg ci -m "standin" .hglf
418 $ hg ci -m "standin" .hglf
419 abort: file ".hglf" is a largefile standin
419 abort: file ".hglf" is a largefile standin
420 (commit the largefile itself instead)
420 (commit the largefile itself instead)
421 [255]
421 [255]
422
422
423 Test "hg status" with combination of 'file pattern' and 'directory
423 Test "hg status" with combination of 'file pattern' and 'directory
424 pattern' for largefiles:
424 pattern' for largefiles:
425
425
426 $ hg status sub2/large6 sub2
426 $ hg status sub2/large6 sub2
427 A sub2/large6
427 A sub2/large6
428 A sub2/large7
428 A sub2/large7
429
429
430 Config settings (pattern **.dat, minsize 2 MB) are respected.
430 Config settings (pattern **.dat, minsize 2 MB) are respected.
431
431
432 $ echo testdata > test.dat
432 $ echo testdata > test.dat
433 $ dd bs=1k count=2k if=/dev/zero of=reallylarge > /dev/null 2> /dev/null
433 $ dd bs=1k count=2k if=/dev/zero of=reallylarge > /dev/null 2> /dev/null
434 $ hg add
434 $ hg add
435 adding reallylarge as a largefile
435 adding reallylarge as a largefile
436 adding test.dat as a largefile
436 adding test.dat as a largefile
437
437
438 Test that minsize and --lfsize handle float values;
438 Test that minsize and --lfsize handle float values;
439 also tests that --lfsize overrides largefiles.minsize.
439 also tests that --lfsize overrides largefiles.minsize.
440 (0.250 MB = 256 kB = 262144 B)
440 (0.250 MB = 256 kB = 262144 B)
441
441
442 $ dd if=/dev/zero of=ratherlarge bs=1024 count=256 > /dev/null 2> /dev/null
442 $ dd if=/dev/zero of=ratherlarge bs=1024 count=256 > /dev/null 2> /dev/null
443 $ dd if=/dev/zero of=medium bs=1024 count=128 > /dev/null 2> /dev/null
443 $ dd if=/dev/zero of=medium bs=1024 count=128 > /dev/null 2> /dev/null
444 $ hg --config largefiles.minsize=.25 add
444 $ hg --config largefiles.minsize=.25 add
445 adding ratherlarge as a largefile
445 adding ratherlarge as a largefile
446 adding medium
446 adding medium
447 $ hg forget medium
447 $ hg forget medium
448 $ hg --config largefiles.minsize=.25 add --lfsize=.125
448 $ hg --config largefiles.minsize=.25 add --lfsize=.125
449 adding medium as a largefile
449 adding medium as a largefile
450 $ dd if=/dev/zero of=notlarge bs=1024 count=127 > /dev/null 2> /dev/null
450 $ dd if=/dev/zero of=notlarge bs=1024 count=127 > /dev/null 2> /dev/null
451 $ hg --config largefiles.minsize=.25 add --lfsize=.125
451 $ hg --config largefiles.minsize=.25 add --lfsize=.125
452 adding notlarge
452 adding notlarge
453 $ hg forget notlarge
453 $ hg forget notlarge
454
454
455 Test forget on largefiles.
455 Test forget on largefiles.
456
456
457 $ hg forget large3 large5 test.dat reallylarge ratherlarge medium
457 $ hg forget large3 large5 test.dat reallylarge ratherlarge medium
458 $ hg commit -m "add/edit more largefiles"
458 $ hg commit -m "add/edit more largefiles"
459 Invoking status precommit hook
459 Invoking status precommit hook
460 A sub2/large6
460 A sub2/large6
461 A sub2/large7
461 A sub2/large7
462 R large3
462 R large3
463 ? large5
463 ? large5
464 ? medium
464 ? medium
465 ? notlarge
465 ? notlarge
466 ? ratherlarge
466 ? ratherlarge
467 ? reallylarge
467 ? reallylarge
468 ? test.dat
468 ? test.dat
469 $ hg st
469 $ hg st
470 ? large3
470 ? large3
471 ? large5
471 ? large5
472 ? medium
472 ? medium
473 ? notlarge
473 ? notlarge
474 ? ratherlarge
474 ? ratherlarge
475 ? reallylarge
475 ? reallylarge
476 ? test.dat
476 ? test.dat
477
477
478 Purge with largefiles: verify that largefiles are still in the working
478 Purge with largefiles: verify that largefiles are still in the working
479 dir after a purge.
479 dir after a purge.
480
480
481 $ hg purge --all
481 $ hg purge --all
482 $ cat sub/large4
482 $ cat sub/large4
483 large44
483 large44
484 $ cat sub2/large6
484 $ cat sub2/large6
485 large6
485 large6
486 $ cat sub2/large7
486 $ cat sub2/large7
487 large7
487 large7
488
488
489 Test addremove: verify that files that should be added as largefiles are added as
489 Test addremove: verify that files that should be added as largefiles are added as
490 such and that already-existing largefiles are not added as normal files by
490 such and that already-existing largefiles are not added as normal files by
491 accident.
491 accident.
492
492
493 $ rm normal3
493 $ rm normal3
494 $ rm sub/large4
494 $ rm sub/large4
495 $ echo "testing addremove with patterns" > testaddremove.dat
495 $ echo "testing addremove with patterns" > testaddremove.dat
496 $ echo "normaladdremove" > normaladdremove
496 $ echo "normaladdremove" > normaladdremove
497 $ hg addremove
497 $ hg addremove
498 removing sub/large4
498 removing sub/large4
499 adding testaddremove.dat as a largefile
499 adding testaddremove.dat as a largefile
500 removing normal3
500 removing normal3
501 adding normaladdremove
501 adding normaladdremove
502
502
503 Test addremove with -R
503 Test addremove with -R
504
504
505 $ hg up -C
505 $ hg up -C
506 getting changed largefiles
506 getting changed largefiles
507 1 largefiles updated, 0 removed
507 1 largefiles updated, 0 removed
508 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
508 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
509 $ rm normal3
509 $ rm normal3
510 $ rm sub/large4
510 $ rm sub/large4
511 $ echo "testing addremove with patterns" > testaddremove.dat
511 $ echo "testing addremove with patterns" > testaddremove.dat
512 $ echo "normaladdremove" > normaladdremove
512 $ echo "normaladdremove" > normaladdremove
513 $ cd ..
513 $ cd ..
514 $ hg -R a -v addremove
514 $ hg -R a -v addremove
515 removing sub/large4
515 removing sub/large4
516 adding testaddremove.dat as a largefile
516 adding testaddremove.dat as a largefile
517 removing normal3
517 removing normal3
518 adding normaladdremove
518 adding normaladdremove
519 $ cd a
519 $ cd a
520
520
521 Test 3364
521 Test 3364
522 $ hg clone . ../addrm
522 $ hg clone . ../addrm
523 updating to branch default
523 updating to branch default
524 getting changed largefiles
524 getting changed largefiles
525 3 largefiles updated, 0 removed
525 3 largefiles updated, 0 removed
526 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
526 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
527 $ cd ../addrm
527 $ cd ../addrm
528 $ cat >> .hg/hgrc <<EOF
528 $ cat >> .hg/hgrc <<EOF
529 > [hooks]
529 > [hooks]
530 > post-commit.stat=sh -c "echo \\"Invoking status postcommit hook\\"; hg status -A"
530 > post-commit.stat=sh -c "echo \\"Invoking status postcommit hook\\"; hg status -A"
531 > EOF
531 > EOF
532 $ touch foo
532 $ touch foo
533 $ hg add --large foo
533 $ hg add --large foo
534 $ hg ci -m "add foo"
534 $ hg ci -m "add foo"
535 Invoking status precommit hook
535 Invoking status precommit hook
536 A foo
536 A foo
537 Invoking status postcommit hook
537 Invoking status postcommit hook
538 C foo
538 C foo
539 C normal3
539 C normal3
540 C sub/large4
540 C sub/large4
541 C sub/normal4
541 C sub/normal4
542 C sub2/large6
542 C sub2/large6
543 C sub2/large7
543 C sub2/large7
544 $ rm foo
544 $ rm foo
545 $ hg st
545 $ hg st
546 ! foo
546 ! foo
547 hmm.. no precommit invoked, but there is a postcommit??
547 hmm.. no precommit invoked, but there is a postcommit??
548 $ hg ci -m "will not checkin"
548 $ hg ci -m "will not checkin"
549 nothing changed (1 missing files, see 'hg status')
549 nothing changed (1 missing files, see 'hg status')
550 Invoking status postcommit hook
550 Invoking status postcommit hook
551 ! foo
551 ! foo
552 C normal3
552 C normal3
553 C sub/large4
553 C sub/large4
554 C sub/normal4
554 C sub/normal4
555 C sub2/large6
555 C sub2/large6
556 C sub2/large7
556 C sub2/large7
557 [1]
557 [1]
558 $ hg addremove
558 $ hg addremove
559 removing foo
559 removing foo
560 $ hg st
560 $ hg st
561 R foo
561 R foo
562 $ hg ci -m "used to say nothing changed"
562 $ hg ci -m "used to say nothing changed"
563 Invoking status precommit hook
563 Invoking status precommit hook
564 R foo
564 R foo
565 Invoking status postcommit hook
565 Invoking status postcommit hook
566 C normal3
566 C normal3
567 C sub/large4
567 C sub/large4
568 C sub/normal4
568 C sub/normal4
569 C sub2/large6
569 C sub2/large6
570 C sub2/large7
570 C sub2/large7
571 $ hg st
571 $ hg st
572
572
573 Test 3507 (both normal files and largefiles were a problem)
573 Test 3507 (both normal files and largefiles were a problem)
574
574
575 $ touch normal
575 $ touch normal
576 $ touch large
576 $ touch large
577 $ hg add normal
577 $ hg add normal
578 $ hg add --large large
578 $ hg add --large large
579 $ hg ci -m "added"
579 $ hg ci -m "added"
580 Invoking status precommit hook
580 Invoking status precommit hook
581 A large
581 A large
582 A normal
582 A normal
583 Invoking status postcommit hook
583 Invoking status postcommit hook
584 C large
584 C large
585 C normal
585 C normal
586 C normal3
586 C normal3
587 C sub/large4
587 C sub/large4
588 C sub/normal4
588 C sub/normal4
589 C sub2/large6
589 C sub2/large6
590 C sub2/large7
590 C sub2/large7
591 $ hg remove normal
591 $ hg remove normal
592 $ hg addremove --traceback
592 $ hg addremove --traceback
593 $ hg ci -m "addremoved normal"
593 $ hg ci -m "addremoved normal"
594 Invoking status precommit hook
594 Invoking status precommit hook
595 R normal
595 R normal
596 Invoking status postcommit hook
596 Invoking status postcommit hook
597 C large
597 C large
598 C normal3
598 C normal3
599 C sub/large4
599 C sub/large4
600 C sub/normal4
600 C sub/normal4
601 C sub2/large6
601 C sub2/large6
602 C sub2/large7
602 C sub2/large7
603 $ hg up -C '.^'
603 $ hg up -C '.^'
604 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
604 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
605 $ hg remove large
605 $ hg remove large
606 $ hg addremove --traceback
606 $ hg addremove --traceback
607 $ hg ci -m "removed large"
607 $ hg ci -m "removed large"
608 Invoking status precommit hook
608 Invoking status precommit hook
609 R large
609 R large
610 created new head
610 created new head
611 Invoking status postcommit hook
611 Invoking status postcommit hook
612 C normal
612 C normal
613 C normal3
613 C normal3
614 C sub/large4
614 C sub/large4
615 C sub/normal4
615 C sub/normal4
616 C sub2/large6
616 C sub2/large6
617 C sub2/large7
617 C sub2/large7
618
618
619 Test commit -A (issue3542)
619 Test commit -A (issue3542)
620 $ echo large8 > large8
620 $ echo large8 > large8
621 $ hg add --large large8
621 $ hg add --large large8
622 $ hg ci -Am 'this used to add large8 as normal and commit both'
622 $ hg ci -Am 'this used to add large8 as normal and commit both'
623 Invoking status precommit hook
623 Invoking status precommit hook
624 A large8
624 A large8
625 Invoking status postcommit hook
625 Invoking status postcommit hook
626 C large8
626 C large8
627 C normal
627 C normal
628 C normal3
628 C normal3
629 C sub/large4
629 C sub/large4
630 C sub/normal4
630 C sub/normal4
631 C sub2/large6
631 C sub2/large6
632 C sub2/large7
632 C sub2/large7
633 $ rm large8
633 $ rm large8
634 $ hg ci -Am 'this used to not notice the rm'
634 $ hg ci -Am 'this used to not notice the rm'
635 removing large8
635 removing large8
636 Invoking status precommit hook
636 Invoking status precommit hook
637 R large8
637 R large8
638 Invoking status postcommit hook
638 Invoking status postcommit hook
639 C normal
639 C normal
640 C normal3
640 C normal3
641 C sub/large4
641 C sub/large4
642 C sub/normal4
642 C sub/normal4
643 C sub2/large6
643 C sub2/large6
644 C sub2/large7
644 C sub2/large7
645
645
646 Test that a standin can't be added as a large file
646 Test that a standin can't be added as a large file
647
647
648 $ touch large
648 $ touch large
649 $ hg add --large large
649 $ hg add --large large
650 $ hg ci -m "add"
650 $ hg ci -m "add"
651 Invoking status precommit hook
651 Invoking status precommit hook
652 A large
652 A large
653 Invoking status postcommit hook
653 Invoking status postcommit hook
654 C large
654 C large
655 C normal
655 C normal
656 C normal3
656 C normal3
657 C sub/large4
657 C sub/large4
658 C sub/normal4
658 C sub/normal4
659 C sub2/large6
659 C sub2/large6
660 C sub2/large7
660 C sub2/large7
661 $ hg remove large
661 $ hg remove large
662 $ touch large
662 $ touch large
663 $ hg addremove --config largefiles.patterns=**large --traceback
663 $ hg addremove --config largefiles.patterns=**large --traceback
664 adding large as a largefile
664 adding large as a largefile
665
665
666 Test that outgoing --large works (with revsets too)
666 Test that outgoing --large works (with revsets too)
667 $ hg outgoing --rev '.^' --large
667 $ hg outgoing --rev '.^' --large
668 comparing with $TESTTMP/a (glob)
668 comparing with $TESTTMP/a (glob)
669 searching for changes
669 searching for changes
670 changeset: 8:c02fd3b77ec4
670 changeset: 8:c02fd3b77ec4
671 user: test
671 user: test
672 date: Thu Jan 01 00:00:00 1970 +0000
672 date: Thu Jan 01 00:00:00 1970 +0000
673 summary: add foo
673 summary: add foo
674
674
675 changeset: 9:289dd08c9bbb
675 changeset: 9:289dd08c9bbb
676 user: test
676 user: test
677 date: Thu Jan 01 00:00:00 1970 +0000
677 date: Thu Jan 01 00:00:00 1970 +0000
678 summary: used to say nothing changed
678 summary: used to say nothing changed
679
679
680 changeset: 10:34f23ac6ac12
680 changeset: 10:34f23ac6ac12
681 user: test
681 user: test
682 date: Thu Jan 01 00:00:00 1970 +0000
682 date: Thu Jan 01 00:00:00 1970 +0000
683 summary: added
683 summary: added
684
684
685 changeset: 12:710c1b2f523c
685 changeset: 12:710c1b2f523c
686 parent: 10:34f23ac6ac12
686 parent: 10:34f23ac6ac12
687 user: test
687 user: test
688 date: Thu Jan 01 00:00:00 1970 +0000
688 date: Thu Jan 01 00:00:00 1970 +0000
689 summary: removed large
689 summary: removed large
690
690
691 changeset: 13:0a3e75774479
691 changeset: 13:0a3e75774479
692 user: test
692 user: test
693 date: Thu Jan 01 00:00:00 1970 +0000
693 date: Thu Jan 01 00:00:00 1970 +0000
694 summary: this used to add large8 as normal and commit both
694 summary: this used to add large8 as normal and commit both
695
695
696 changeset: 14:84f3d378175c
696 changeset: 14:84f3d378175c
697 user: test
697 user: test
698 date: Thu Jan 01 00:00:00 1970 +0000
698 date: Thu Jan 01 00:00:00 1970 +0000
699 summary: this used to not notice the rm
699 summary: this used to not notice the rm
700
700
701 largefiles to upload (1 entities):
701 largefiles to upload (1 entities):
702 large8
702 large8
703
703
704 $ cd ../a
704 $ cd ../a
705
705
706 Clone a largefiles repo.
706 Clone a largefiles repo.
707
707
708 $ hg clone . ../b
708 $ hg clone . ../b
709 updating to branch default
709 updating to branch default
710 getting changed largefiles
710 getting changed largefiles
711 3 largefiles updated, 0 removed
711 3 largefiles updated, 0 removed
712 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
712 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
713 $ cd ../b
713 $ cd ../b
714 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
714 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
715 7:daea875e9014 add/edit more largefiles
715 7:daea875e9014 add/edit more largefiles
716 6:4355d653f84f edit files yet again
716 6:4355d653f84f edit files yet again
717 5:9d5af5072dbd edit files again
717 5:9d5af5072dbd edit files again
718 4:74c02385b94c move files
718 4:74c02385b94c move files
719 3:9e8fbc4bce62 copy files
719 3:9e8fbc4bce62 copy files
720 2:51a0ae4d5864 remove files
720 2:51a0ae4d5864 remove files
721 1:ce8896473775 edit files
721 1:ce8896473775 edit files
722 0:30d30fe6a5be add files
722 0:30d30fe6a5be add files
723 $ cat normal3
723 $ cat normal3
724 normal33
724 normal33
725
725
726 Test graph log
726 Test graph log
727
727
728 $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n'
728 $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n'
729 @ 7:daea875e9014 add/edit more largefiles
729 @ 7:daea875e9014 add/edit more largefiles
730 |
730 |
731 o 6:4355d653f84f edit files yet again
731 o 6:4355d653f84f edit files yet again
732 |
732 |
733 o 5:9d5af5072dbd edit files again
733 o 5:9d5af5072dbd edit files again
734 |
734 |
735 o 4:74c02385b94c move files
735 o 4:74c02385b94c move files
736 |
736 |
737 o 3:9e8fbc4bce62 copy files
737 o 3:9e8fbc4bce62 copy files
738 |
738 |
739 o 2:51a0ae4d5864 remove files
739 o 2:51a0ae4d5864 remove files
740 |
740 |
741 o 1:ce8896473775 edit files
741 o 1:ce8896473775 edit files
742 |
742 |
743 o 0:30d30fe6a5be add files
743 o 0:30d30fe6a5be add files
744
744
745
745
746 Test log with --patch
746 Test log with --patch
747
747
748 $ hg log --patch -r 6::7
748 $ hg log --patch -r 6::7
749 changeset: 6:4355d653f84f
749 changeset: 6:4355d653f84f
750 user: test
750 user: test
751 date: Thu Jan 01 00:00:00 1970 +0000
751 date: Thu Jan 01 00:00:00 1970 +0000
752 summary: edit files yet again
752 summary: edit files yet again
753
753
754 diff -r 9d5af5072dbd -r 4355d653f84f .hglf/large3
754 diff -r 9d5af5072dbd -r 4355d653f84f .hglf/large3
755 --- a/.hglf/large3 Thu Jan 01 00:00:00 1970 +0000
755 --- a/.hglf/large3 Thu Jan 01 00:00:00 1970 +0000
756 +++ b/.hglf/large3 Thu Jan 01 00:00:00 1970 +0000
756 +++ b/.hglf/large3 Thu Jan 01 00:00:00 1970 +0000
757 @@ -1,1 +1,1 @@
757 @@ -1,1 +1,1 @@
758 -baaf12afde9d8d67f25dab6dced0d2bf77dba47c
758 -baaf12afde9d8d67f25dab6dced0d2bf77dba47c
759 +7838695e10da2bb75ac1156565f40a2595fa2fa0
759 +7838695e10da2bb75ac1156565f40a2595fa2fa0
760 diff -r 9d5af5072dbd -r 4355d653f84f .hglf/sub/large4
760 diff -r 9d5af5072dbd -r 4355d653f84f .hglf/sub/large4
761 --- a/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
761 --- a/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
762 +++ b/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
762 +++ b/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
763 @@ -1,1 +1,1 @@
763 @@ -1,1 +1,1 @@
764 -aeb2210d19f02886dde00dac279729a48471e2f9
764 -aeb2210d19f02886dde00dac279729a48471e2f9
765 +971fb41e78fea4f8e0ba5244784239371cb00591
765 +971fb41e78fea4f8e0ba5244784239371cb00591
766 diff -r 9d5af5072dbd -r 4355d653f84f normal3
766 diff -r 9d5af5072dbd -r 4355d653f84f normal3
767 --- a/normal3 Thu Jan 01 00:00:00 1970 +0000
767 --- a/normal3 Thu Jan 01 00:00:00 1970 +0000
768 +++ b/normal3 Thu Jan 01 00:00:00 1970 +0000
768 +++ b/normal3 Thu Jan 01 00:00:00 1970 +0000
769 @@ -1,1 +1,1 @@
769 @@ -1,1 +1,1 @@
770 -normal3
770 -normal3
771 +normal33
771 +normal33
772 diff -r 9d5af5072dbd -r 4355d653f84f sub/normal4
772 diff -r 9d5af5072dbd -r 4355d653f84f sub/normal4
773 --- a/sub/normal4 Thu Jan 01 00:00:00 1970 +0000
773 --- a/sub/normal4 Thu Jan 01 00:00:00 1970 +0000
774 +++ b/sub/normal4 Thu Jan 01 00:00:00 1970 +0000
774 +++ b/sub/normal4 Thu Jan 01 00:00:00 1970 +0000
775 @@ -1,1 +1,1 @@
775 @@ -1,1 +1,1 @@
776 -normal4
776 -normal4
777 +normal44
777 +normal44
778
778
779 changeset: 7:daea875e9014
779 changeset: 7:daea875e9014
780 tag: tip
780 tag: tip
781 user: test
781 user: test
782 date: Thu Jan 01 00:00:00 1970 +0000
782 date: Thu Jan 01 00:00:00 1970 +0000
783 summary: add/edit more largefiles
783 summary: add/edit more largefiles
784
784
785 diff -r 4355d653f84f -r daea875e9014 .hglf/large3
785 diff -r 4355d653f84f -r daea875e9014 .hglf/large3
786 --- a/.hglf/large3 Thu Jan 01 00:00:00 1970 +0000
786 --- a/.hglf/large3 Thu Jan 01 00:00:00 1970 +0000
787 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
787 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
788 @@ -1,1 +0,0 @@
788 @@ -1,1 +0,0 @@
789 -7838695e10da2bb75ac1156565f40a2595fa2fa0
789 -7838695e10da2bb75ac1156565f40a2595fa2fa0
790 diff -r 4355d653f84f -r daea875e9014 .hglf/sub2/large6
790 diff -r 4355d653f84f -r daea875e9014 .hglf/sub2/large6
791 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
791 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
792 +++ b/.hglf/sub2/large6 Thu Jan 01 00:00:00 1970 +0000
792 +++ b/.hglf/sub2/large6 Thu Jan 01 00:00:00 1970 +0000
793 @@ -0,0 +1,1 @@
793 @@ -0,0 +1,1 @@
794 +0d6d75887db61b2c7e6c74b5dd8fc6ad50c0cc30
794 +0d6d75887db61b2c7e6c74b5dd8fc6ad50c0cc30
795 diff -r 4355d653f84f -r daea875e9014 .hglf/sub2/large7
795 diff -r 4355d653f84f -r daea875e9014 .hglf/sub2/large7
796 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
796 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
797 +++ b/.hglf/sub2/large7 Thu Jan 01 00:00:00 1970 +0000
797 +++ b/.hglf/sub2/large7 Thu Jan 01 00:00:00 1970 +0000
798 @@ -0,0 +1,1 @@
798 @@ -0,0 +1,1 @@
799 +bb3151689acb10f0c3125c560d5e63df914bc1af
799 +bb3151689acb10f0c3125c560d5e63df914bc1af
800
800
801
801
802 $ hg log --patch -r 6::7 sub/
802 $ hg log --patch -r 6::7 sub/
803 changeset: 6:4355d653f84f
803 changeset: 6:4355d653f84f
804 user: test
804 user: test
805 date: Thu Jan 01 00:00:00 1970 +0000
805 date: Thu Jan 01 00:00:00 1970 +0000
806 summary: edit files yet again
806 summary: edit files yet again
807
807
808 diff -r 9d5af5072dbd -r 4355d653f84f .hglf/sub/large4
808 diff -r 9d5af5072dbd -r 4355d653f84f .hglf/sub/large4
809 --- a/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
809 --- a/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
810 +++ b/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
810 +++ b/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
811 @@ -1,1 +1,1 @@
811 @@ -1,1 +1,1 @@
812 -aeb2210d19f02886dde00dac279729a48471e2f9
812 -aeb2210d19f02886dde00dac279729a48471e2f9
813 +971fb41e78fea4f8e0ba5244784239371cb00591
813 +971fb41e78fea4f8e0ba5244784239371cb00591
814 diff -r 9d5af5072dbd -r 4355d653f84f sub/normal4
814 diff -r 9d5af5072dbd -r 4355d653f84f sub/normal4
815 --- a/sub/normal4 Thu Jan 01 00:00:00 1970 +0000
815 --- a/sub/normal4 Thu Jan 01 00:00:00 1970 +0000
816 +++ b/sub/normal4 Thu Jan 01 00:00:00 1970 +0000
816 +++ b/sub/normal4 Thu Jan 01 00:00:00 1970 +0000
817 @@ -1,1 +1,1 @@
817 @@ -1,1 +1,1 @@
818 -normal4
818 -normal4
819 +normal44
819 +normal44
820
820
821
821
822 log with both --follow and --patch
822 log with both --follow and --patch
823
823
824 $ hg log --follow --patch --limit 2
824 $ hg log --follow --patch --limit 2
825 changeset: 7:daea875e9014
825 changeset: 7:daea875e9014
826 tag: tip
826 tag: tip
827 user: test
827 user: test
828 date: Thu Jan 01 00:00:00 1970 +0000
828 date: Thu Jan 01 00:00:00 1970 +0000
829 summary: add/edit more largefiles
829 summary: add/edit more largefiles
830
830
831 diff -r 4355d653f84f -r daea875e9014 .hglf/large3
831 diff -r 4355d653f84f -r daea875e9014 .hglf/large3
832 --- a/.hglf/large3 Thu Jan 01 00:00:00 1970 +0000
832 --- a/.hglf/large3 Thu Jan 01 00:00:00 1970 +0000
833 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
833 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
834 @@ -1,1 +0,0 @@
834 @@ -1,1 +0,0 @@
835 -7838695e10da2bb75ac1156565f40a2595fa2fa0
835 -7838695e10da2bb75ac1156565f40a2595fa2fa0
836 diff -r 4355d653f84f -r daea875e9014 .hglf/sub2/large6
836 diff -r 4355d653f84f -r daea875e9014 .hglf/sub2/large6
837 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
837 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
838 +++ b/.hglf/sub2/large6 Thu Jan 01 00:00:00 1970 +0000
838 +++ b/.hglf/sub2/large6 Thu Jan 01 00:00:00 1970 +0000
839 @@ -0,0 +1,1 @@
839 @@ -0,0 +1,1 @@
840 +0d6d75887db61b2c7e6c74b5dd8fc6ad50c0cc30
840 +0d6d75887db61b2c7e6c74b5dd8fc6ad50c0cc30
841 diff -r 4355d653f84f -r daea875e9014 .hglf/sub2/large7
841 diff -r 4355d653f84f -r daea875e9014 .hglf/sub2/large7
842 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
842 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
843 +++ b/.hglf/sub2/large7 Thu Jan 01 00:00:00 1970 +0000
843 +++ b/.hglf/sub2/large7 Thu Jan 01 00:00:00 1970 +0000
844 @@ -0,0 +1,1 @@
844 @@ -0,0 +1,1 @@
845 +bb3151689acb10f0c3125c560d5e63df914bc1af
845 +bb3151689acb10f0c3125c560d5e63df914bc1af
846
846
847 changeset: 6:4355d653f84f
847 changeset: 6:4355d653f84f
848 user: test
848 user: test
849 date: Thu Jan 01 00:00:00 1970 +0000
849 date: Thu Jan 01 00:00:00 1970 +0000
850 summary: edit files yet again
850 summary: edit files yet again
851
851
852 diff -r 9d5af5072dbd -r 4355d653f84f .hglf/large3
852 diff -r 9d5af5072dbd -r 4355d653f84f .hglf/large3
853 --- a/.hglf/large3 Thu Jan 01 00:00:00 1970 +0000
853 --- a/.hglf/large3 Thu Jan 01 00:00:00 1970 +0000
854 +++ b/.hglf/large3 Thu Jan 01 00:00:00 1970 +0000
854 +++ b/.hglf/large3 Thu Jan 01 00:00:00 1970 +0000
855 @@ -1,1 +1,1 @@
855 @@ -1,1 +1,1 @@
856 -baaf12afde9d8d67f25dab6dced0d2bf77dba47c
856 -baaf12afde9d8d67f25dab6dced0d2bf77dba47c
857 +7838695e10da2bb75ac1156565f40a2595fa2fa0
857 +7838695e10da2bb75ac1156565f40a2595fa2fa0
858 diff -r 9d5af5072dbd -r 4355d653f84f .hglf/sub/large4
858 diff -r 9d5af5072dbd -r 4355d653f84f .hglf/sub/large4
859 --- a/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
859 --- a/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
860 +++ b/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
860 +++ b/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
861 @@ -1,1 +1,1 @@
861 @@ -1,1 +1,1 @@
862 -aeb2210d19f02886dde00dac279729a48471e2f9
862 -aeb2210d19f02886dde00dac279729a48471e2f9
863 +971fb41e78fea4f8e0ba5244784239371cb00591
863 +971fb41e78fea4f8e0ba5244784239371cb00591
864 diff -r 9d5af5072dbd -r 4355d653f84f normal3
864 diff -r 9d5af5072dbd -r 4355d653f84f normal3
865 --- a/normal3 Thu Jan 01 00:00:00 1970 +0000
865 --- a/normal3 Thu Jan 01 00:00:00 1970 +0000
866 +++ b/normal3 Thu Jan 01 00:00:00 1970 +0000
866 +++ b/normal3 Thu Jan 01 00:00:00 1970 +0000
867 @@ -1,1 +1,1 @@
867 @@ -1,1 +1,1 @@
868 -normal3
868 -normal3
869 +normal33
869 +normal33
870 diff -r 9d5af5072dbd -r 4355d653f84f sub/normal4
870 diff -r 9d5af5072dbd -r 4355d653f84f sub/normal4
871 --- a/sub/normal4 Thu Jan 01 00:00:00 1970 +0000
871 --- a/sub/normal4 Thu Jan 01 00:00:00 1970 +0000
872 +++ b/sub/normal4 Thu Jan 01 00:00:00 1970 +0000
872 +++ b/sub/normal4 Thu Jan 01 00:00:00 1970 +0000
873 @@ -1,1 +1,1 @@
873 @@ -1,1 +1,1 @@
874 -normal4
874 -normal4
875 +normal44
875 +normal44
876
876
877 $ hg log --follow --patch sub/large4
877 $ hg log --follow --patch sub/large4
878 changeset: 6:4355d653f84f
878 changeset: 6:4355d653f84f
879 user: test
879 user: test
880 date: Thu Jan 01 00:00:00 1970 +0000
880 date: Thu Jan 01 00:00:00 1970 +0000
881 summary: edit files yet again
881 summary: edit files yet again
882
882
883 diff -r 9d5af5072dbd -r 4355d653f84f .hglf/sub/large4
883 diff -r 9d5af5072dbd -r 4355d653f84f .hglf/sub/large4
884 --- a/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
884 --- a/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
885 +++ b/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
885 +++ b/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
886 @@ -1,1 +1,1 @@
886 @@ -1,1 +1,1 @@
887 -aeb2210d19f02886dde00dac279729a48471e2f9
887 -aeb2210d19f02886dde00dac279729a48471e2f9
888 +971fb41e78fea4f8e0ba5244784239371cb00591
888 +971fb41e78fea4f8e0ba5244784239371cb00591
889
889
890 changeset: 5:9d5af5072dbd
890 changeset: 5:9d5af5072dbd
891 user: test
891 user: test
892 date: Thu Jan 01 00:00:00 1970 +0000
892 date: Thu Jan 01 00:00:00 1970 +0000
893 summary: edit files again
893 summary: edit files again
894
894
895 diff -r 74c02385b94c -r 9d5af5072dbd .hglf/sub/large4
895 diff -r 74c02385b94c -r 9d5af5072dbd .hglf/sub/large4
896 --- a/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
896 --- a/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
897 +++ b/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
897 +++ b/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
898 @@ -1,1 +1,1 @@
898 @@ -1,1 +1,1 @@
899 -eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
899 -eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
900 +aeb2210d19f02886dde00dac279729a48471e2f9
900 +aeb2210d19f02886dde00dac279729a48471e2f9
901
901
902 changeset: 4:74c02385b94c
902 changeset: 4:74c02385b94c
903 user: test
903 user: test
904 date: Thu Jan 01 00:00:00 1970 +0000
904 date: Thu Jan 01 00:00:00 1970 +0000
905 summary: move files
905 summary: move files
906
906
907 diff -r 9e8fbc4bce62 -r 74c02385b94c .hglf/sub/large4
907 diff -r 9e8fbc4bce62 -r 74c02385b94c .hglf/sub/large4
908 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
908 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
909 +++ b/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
909 +++ b/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
910 @@ -0,0 +1,1 @@
910 @@ -0,0 +1,1 @@
911 +eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
911 +eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
912
912
913 changeset: 1:ce8896473775
913 changeset: 1:ce8896473775
914 user: test
914 user: test
915 date: Thu Jan 01 00:00:00 1970 +0000
915 date: Thu Jan 01 00:00:00 1970 +0000
916 summary: edit files
916 summary: edit files
917
917
918 diff -r 30d30fe6a5be -r ce8896473775 .hglf/sub/large2
918 diff -r 30d30fe6a5be -r ce8896473775 .hglf/sub/large2
919 --- a/.hglf/sub/large2 Thu Jan 01 00:00:00 1970 +0000
919 --- a/.hglf/sub/large2 Thu Jan 01 00:00:00 1970 +0000
920 +++ b/.hglf/sub/large2 Thu Jan 01 00:00:00 1970 +0000
920 +++ b/.hglf/sub/large2 Thu Jan 01 00:00:00 1970 +0000
921 @@ -1,1 +1,1 @@
921 @@ -1,1 +1,1 @@
922 -1deebade43c8c498a3c8daddac0244dc55d1331d
922 -1deebade43c8c498a3c8daddac0244dc55d1331d
923 +eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
923 +eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
924
924
925 changeset: 0:30d30fe6a5be
925 changeset: 0:30d30fe6a5be
926 user: test
926 user: test
927 date: Thu Jan 01 00:00:00 1970 +0000
927 date: Thu Jan 01 00:00:00 1970 +0000
928 summary: add files
928 summary: add files
929
929
930 diff -r 000000000000 -r 30d30fe6a5be .hglf/sub/large2
930 diff -r 000000000000 -r 30d30fe6a5be .hglf/sub/large2
931 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
931 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
932 +++ b/.hglf/sub/large2 Thu Jan 01 00:00:00 1970 +0000
932 +++ b/.hglf/sub/large2 Thu Jan 01 00:00:00 1970 +0000
933 @@ -0,0 +1,1 @@
933 @@ -0,0 +1,1 @@
934 +1deebade43c8c498a3c8daddac0244dc55d1331d
934 +1deebade43c8c498a3c8daddac0244dc55d1331d
935
935
936 $ cat sub/normal4
936 $ cat sub/normal4
937 normal44
937 normal44
938 $ cat sub/large4
938 $ cat sub/large4
939 large44
939 large44
940 $ cat sub2/large6
940 $ cat sub2/large6
941 large6
941 large6
942 $ cat sub2/large7
942 $ cat sub2/large7
943 large7
943 large7
944 $ hg log -qf sub2/large7
944 $ hg log -qf sub2/large7
945 7:daea875e9014
945 7:daea875e9014
946 $ hg log -Gqf sub2/large7
946 $ hg log -Gqf sub2/large7
947 @ 7:daea875e9014
947 @ 7:daea875e9014
948 |
948 |
949 ~
949 ~
950 $ cd ..
950 $ cd ..
951
951
952 Test log from outside repo
952 Test log from outside repo
953
953
954 $ hg log b/sub -T '{rev}:{node|short} {desc|firstline}\n'
954 $ hg log b/sub -T '{rev}:{node|short} {desc|firstline}\n'
955 6:4355d653f84f edit files yet again
955 6:4355d653f84f edit files yet again
956 5:9d5af5072dbd edit files again
956 5:9d5af5072dbd edit files again
957 4:74c02385b94c move files
957 4:74c02385b94c move files
958 1:ce8896473775 edit files
958 1:ce8896473775 edit files
959 0:30d30fe6a5be add files
959 0:30d30fe6a5be add files
960
960
961 Test clone at revision
961 Test clone at revision
962
962
963 $ hg clone a -r 3 c
963 $ hg clone a -r 3 c
964 adding changesets
964 adding changesets
965 adding manifests
965 adding manifests
966 adding file changes
966 adding file changes
967 added 4 changesets with 10 changes to 4 files
967 added 4 changesets with 10 changes to 4 files
968 updating to branch default
968 updating to branch default
969 getting changed largefiles
969 getting changed largefiles
970 2 largefiles updated, 0 removed
970 2 largefiles updated, 0 removed
971 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
971 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
972 $ cd c
972 $ cd c
973 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
973 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
974 3:9e8fbc4bce62 copy files
974 3:9e8fbc4bce62 copy files
975 2:51a0ae4d5864 remove files
975 2:51a0ae4d5864 remove files
976 1:ce8896473775 edit files
976 1:ce8896473775 edit files
977 0:30d30fe6a5be add files
977 0:30d30fe6a5be add files
978 $ cat normal1
978 $ cat normal1
979 normal22
979 normal22
980 $ cat large1
980 $ cat large1
981 large22
981 large22
982 $ cat sub/normal2
982 $ cat sub/normal2
983 normal22
983 normal22
984 $ cat sub/large2
984 $ cat sub/large2
985 large22
985 large22
986
986
987 Old revisions of a clone have correct largefiles content (this also
987 Old revisions of a clone have correct largefiles content (this also
988 tests update).
988 tests update).
989
989
990 $ hg update -r 1
990 $ hg update -r 1
991 getting changed largefiles
991 getting changed largefiles
992 1 largefiles updated, 0 removed
992 1 largefiles updated, 0 removed
993 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
993 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
994 $ cat large1
994 $ cat large1
995 large11
995 large11
996 $ cat sub/large2
996 $ cat sub/large2
997 large22
997 large22
998 $ cd ..
998 $ cd ..
999
999
1000 Test cloning with --all-largefiles flag
1000 Test cloning with --all-largefiles flag
1001
1001
1002 $ rm "${USERCACHE}"/*
1002 $ rm "${USERCACHE}"/*
1003 $ hg clone --all-largefiles a a-backup
1003 $ hg clone --all-largefiles a a-backup
1004 updating to branch default
1004 updating to branch default
1005 getting changed largefiles
1005 getting changed largefiles
1006 3 largefiles updated, 0 removed
1006 3 largefiles updated, 0 removed
1007 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1007 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1008 8 additional largefiles cached
1008 8 additional largefiles cached
1009
1009
1010 $ rm "${USERCACHE}"/*
1010 $ rm "${USERCACHE}"/*
1011 $ hg clone --all-largefiles -u 0 a a-clone0
1011 $ hg clone --all-largefiles -u 0 a a-clone0
1012 updating to branch default
1012 updating to branch default
1013 getting changed largefiles
1013 getting changed largefiles
1014 2 largefiles updated, 0 removed
1014 2 largefiles updated, 0 removed
1015 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
1015 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
1016 9 additional largefiles cached
1016 9 additional largefiles cached
1017 $ hg -R a-clone0 sum
1017 $ hg -R a-clone0 sum
1018 parent: 0:30d30fe6a5be
1018 parent: 0:30d30fe6a5be
1019 add files
1019 add files
1020 branch: default
1020 branch: default
1021 commit: (clean)
1021 commit: (clean)
1022 update: 7 new changesets (update)
1022 update: 7 new changesets (update)
1023 phases: 8 draft
1023 phases: 8 draft
1024
1024
1025 $ rm "${USERCACHE}"/*
1025 $ rm "${USERCACHE}"/*
1026 $ hg clone --all-largefiles -u 1 a a-clone1
1026 $ hg clone --all-largefiles -u 1 a a-clone1
1027 updating to branch default
1027 updating to branch default
1028 getting changed largefiles
1028 getting changed largefiles
1029 2 largefiles updated, 0 removed
1029 2 largefiles updated, 0 removed
1030 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
1030 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
1031 8 additional largefiles cached
1031 8 additional largefiles cached
1032 $ hg -R a-clone1 verify --large --lfa --lfc
1032 $ hg -R a-clone1 verify --large --lfa --lfc
1033 checking changesets
1033 checking changesets
1034 checking manifests
1034 checking manifests
1035 crosschecking files in changesets and manifests
1035 crosschecking files in changesets and manifests
1036 checking files
1036 checking files
1037 10 files, 8 changesets, 24 total revisions
1037 10 files, 8 changesets, 24 total revisions
1038 searching 8 changesets for largefiles
1038 searching 8 changesets for largefiles
1039 verified contents of 13 revisions of 6 largefiles
1039 verified contents of 13 revisions of 6 largefiles
1040 $ hg -R a-clone1 sum
1040 $ hg -R a-clone1 sum
1041 parent: 1:ce8896473775
1041 parent: 1:ce8896473775
1042 edit files
1042 edit files
1043 branch: default
1043 branch: default
1044 commit: (clean)
1044 commit: (clean)
1045 update: 6 new changesets (update)
1045 update: 6 new changesets (update)
1046 phases: 8 draft
1046 phases: 8 draft
1047
1047
1048 $ rm "${USERCACHE}"/*
1048 $ rm "${USERCACHE}"/*
1049 $ hg clone --all-largefiles -U a a-clone-u
1049 $ hg clone --all-largefiles -U a a-clone-u
1050 11 additional largefiles cached
1050 11 additional largefiles cached
1051 $ hg -R a-clone-u sum
1051 $ hg -R a-clone-u sum
1052 parent: -1:000000000000 (no revision checked out)
1052 parent: -1:000000000000 (no revision checked out)
1053 branch: default
1053 branch: default
1054 commit: (clean)
1054 commit: (clean)
1055 update: 8 new changesets (update)
1055 update: 8 new changesets (update)
1056 phases: 8 draft
1056 phases: 8 draft
1057
1057
1058 Show computed destination directory:
1058 Show computed destination directory:
1059
1059
1060 $ mkdir xyz
1060 $ mkdir xyz
1061 $ cd xyz
1061 $ cd xyz
1062 $ hg clone ../a
1062 $ hg clone ../a
1063 destination directory: a
1063 destination directory: a
1064 updating to branch default
1064 updating to branch default
1065 getting changed largefiles
1065 getting changed largefiles
1066 3 largefiles updated, 0 removed
1066 3 largefiles updated, 0 removed
1067 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1067 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1068 $ cd ..
1068 $ cd ..
1069
1069
1070 Clone URL without path:
1070 Clone URL without path:
1071
1071
1072 $ hg clone file://
1072 $ hg clone file://
1073 abort: repository / not found!
1073 abort: repository / not found!
1074 [255]
1074 [255]
1075
1075
1076 Ensure base clone command argument validation
1076 Ensure base clone command argument validation
1077
1077
1078 $ hg clone -U -u 0 a a-clone-failure
1078 $ hg clone -U -u 0 a a-clone-failure
1079 abort: cannot specify both --noupdate and --updaterev
1079 abort: cannot specify both --noupdate and --updaterev
1080 [255]
1080 [255]
1081
1081
1082 $ hg clone --all-largefiles a ssh://localhost/a
1082 $ hg clone --all-largefiles a ssh://localhost/a
1083 abort: --all-largefiles is incompatible with non-local destination ssh://localhost/a
1083 abort: --all-largefiles is incompatible with non-local destination ssh://localhost/a
1084 [255]
1084 [255]
1085
1085
1086 Test pulling with --all-largefiles flag. Also test that the largefiles are
1086 Test pulling with --all-largefiles flag. Also test that the largefiles are
1087 downloaded from 'default' instead of 'default-push' when no source is specified
1087 downloaded from 'default' instead of 'default-push' when no source is specified
1088 (issue3584)
1088 (issue3584)
1089
1089
1090 $ rm -Rf a-backup
1090 $ rm -Rf a-backup
1091 $ hg clone -r 1 a a-backup
1091 $ hg clone -r 1 a a-backup
1092 adding changesets
1092 adding changesets
1093 adding manifests
1093 adding manifests
1094 adding file changes
1094 adding file changes
1095 added 2 changesets with 8 changes to 4 files
1095 added 2 changesets with 8 changes to 4 files
1096 updating to branch default
1096 updating to branch default
1097 getting changed largefiles
1097 getting changed largefiles
1098 2 largefiles updated, 0 removed
1098 2 largefiles updated, 0 removed
1099 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
1099 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
1100 $ rm "${USERCACHE}"/*
1100 $ rm "${USERCACHE}"/*
1101 $ cd a-backup
1101 $ cd a-backup
1102 $ hg pull --all-largefiles --config paths.default-push=bogus/path
1102 $ hg pull --all-largefiles --config paths.default-push=bogus/path
1103 pulling from $TESTTMP/a (glob)
1103 pulling from $TESTTMP/a (glob)
1104 searching for changes
1104 searching for changes
1105 adding changesets
1105 adding changesets
1106 adding manifests
1106 adding manifests
1107 adding file changes
1107 adding file changes
1108 added 6 changesets with 16 changes to 8 files
1108 added 6 changesets with 16 changes to 8 files
1109 (run 'hg update' to get a working copy)
1109 (run 'hg update' to get a working copy)
1110 6 largefiles cached
1110 6 largefiles cached
1111
1111
1112 redo pull with --lfrev and check it pulls largefiles for the right revs
1112 redo pull with --lfrev and check it pulls largefiles for the right revs
1113
1113
1114 $ hg rollback
1114 $ hg rollback
1115 repository tip rolled back to revision 1 (undo pull)
1115 repository tip rolled back to revision 1 (undo pull)
1116 $ hg pull -v --lfrev 'heads(pulled())+min(pulled())'
1116 $ hg pull -v --lfrev 'heads(pulled())+min(pulled())'
1117 pulling from $TESTTMP/a (glob)
1117 pulling from $TESTTMP/a (glob)
1118 searching for changes
1118 searching for changes
1119 all local heads known remotely
1119 all local heads known remotely
1120 6 changesets found
1120 6 changesets found
1121 uncompressed size of bundle content:
1121 uncompressed size of bundle content:
1122 1389 (changelog)
1122 1389 (changelog)
1123 1599 (manifests)
1123 1599 (manifests)
1124 254 .hglf/large1
1124 254 .hglf/large1
1125 564 .hglf/large3
1125 564 .hglf/large3
1126 572 .hglf/sub/large4
1126 572 .hglf/sub/large4
1127 182 .hglf/sub2/large6
1127 182 .hglf/sub2/large6
1128 182 .hglf/sub2/large7
1128 182 .hglf/sub2/large7
1129 212 normal1
1129 212 normal1
1130 457 normal3
1130 457 normal3
1131 465 sub/normal4
1131 465 sub/normal4
1132 adding changesets
1132 adding changesets
1133 adding manifests
1133 adding manifests
1134 adding file changes
1134 adding file changes
1135 added 6 changesets with 16 changes to 8 files
1135 added 6 changesets with 16 changes to 8 files
1136 calling hook changegroup.lfiles: hgext.largefiles.reposetup.checkrequireslfiles
1136 calling hook changegroup.lfiles: hgext.largefiles.reposetup.checkrequireslfiles
1137 (run 'hg update' to get a working copy)
1137 (run 'hg update' to get a working copy)
1138 pulling largefiles for revision 7
1138 pulling largefiles for revision 7
1139 found 971fb41e78fea4f8e0ba5244784239371cb00591 in store
1139 found 971fb41e78fea4f8e0ba5244784239371cb00591 in store
1140 found 0d6d75887db61b2c7e6c74b5dd8fc6ad50c0cc30 in store
1140 found 0d6d75887db61b2c7e6c74b5dd8fc6ad50c0cc30 in store
1141 found bb3151689acb10f0c3125c560d5e63df914bc1af in store
1141 found bb3151689acb10f0c3125c560d5e63df914bc1af in store
1142 pulling largefiles for revision 2
1142 pulling largefiles for revision 2
1143 found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store
1143 found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store
1144 0 largefiles cached
1144 0 largefiles cached
1145
1145
1146 lfpull
1146 lfpull
1147
1147
1148 $ hg lfpull -r : --config largefiles.usercache=usercache-lfpull
1148 $ hg lfpull -r : --config largefiles.usercache=usercache-lfpull
1149 2 largefiles cached
1149 2 largefiles cached
1150 $ hg lfpull -v -r 4+2 --config largefiles.usercache=usercache-lfpull
1150 $ hg lfpull -v -r 4+2 --config largefiles.usercache=usercache-lfpull
1151 pulling largefiles for revision 4
1151 pulling largefiles for revision 4
1152 found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store
1152 found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store
1153 found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store
1153 found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store
1154 pulling largefiles for revision 2
1154 pulling largefiles for revision 2
1155 found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store
1155 found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store
1156 0 largefiles cached
1156 0 largefiles cached
1157
1157
1158 $ ls usercache-lfpull/* | sort
1158 $ ls usercache-lfpull/* | sort
1159 usercache-lfpull/1deebade43c8c498a3c8daddac0244dc55d1331d
1159 usercache-lfpull/1deebade43c8c498a3c8daddac0244dc55d1331d
1160 usercache-lfpull/4669e532d5b2c093a78eca010077e708a071bb64
1160 usercache-lfpull/4669e532d5b2c093a78eca010077e708a071bb64
1161
1161
1162 $ cd ..
1162 $ cd ..
1163
1163
1164 Rebasing between two repositories does not revert largefiles to old
1164 Rebasing between two repositories does not revert largefiles to old
1165 revisions (this was a very bad bug that took a lot of work to fix).
1165 revisions (this was a very bad bug that took a lot of work to fix).
1166
1166
1167 $ hg clone a d
1167 $ hg clone a d
1168 updating to branch default
1168 updating to branch default
1169 getting changed largefiles
1169 getting changed largefiles
1170 3 largefiles updated, 0 removed
1170 3 largefiles updated, 0 removed
1171 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1171 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1172 $ cd b
1172 $ cd b
1173 $ echo large4-modified > sub/large4
1173 $ echo large4-modified > sub/large4
1174 $ echo normal3-modified > normal3
1174 $ echo normal3-modified > normal3
1175 $ hg commit -m "modify normal file and largefile in repo b"
1175 $ hg commit -m "modify normal file and largefile in repo b"
1176 Invoking status precommit hook
1176 Invoking status precommit hook
1177 M normal3
1177 M normal3
1178 M sub/large4
1178 M sub/large4
1179 $ cd ../d
1179 $ cd ../d
1180 $ echo large6-modified > sub2/large6
1180 $ echo large6-modified > sub2/large6
1181 $ echo normal4-modified > sub/normal4
1181 $ echo normal4-modified > sub/normal4
1182 $ hg commit -m "modify normal file largefile in repo d"
1182 $ hg commit -m "modify normal file largefile in repo d"
1183 Invoking status precommit hook
1183 Invoking status precommit hook
1184 M sub/normal4
1184 M sub/normal4
1185 M sub2/large6
1185 M sub2/large6
1186 $ cd ..
1186 $ cd ..
1187 $ hg clone d e
1187 $ hg clone d e
1188 updating to branch default
1188 updating to branch default
1189 getting changed largefiles
1189 getting changed largefiles
1190 3 largefiles updated, 0 removed
1190 3 largefiles updated, 0 removed
1191 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1191 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1192 $ cd d
1192 $ cd d
1193
1193
1194 More rebase testing, but also test that the largefiles are downloaded from
1194 More rebase testing, but also test that the largefiles are downloaded from
1195 'default-push' when no source is specified (issue3584). (The largefile from the
1195 'default-push' when no source is specified (issue3584). (The largefile from the
1196 pulled revision is however not downloaded but found in the local cache.)
1196 pulled revision is however not downloaded but found in the local cache.)
1197 Largefiles are fetched for the new pulled revision, not for existing revisions,
1197 Largefiles are fetched for the new pulled revision, not for existing revisions,
1198 rebased or not.
1198 rebased or not.
1199
1199
1200 $ [ ! -f .hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 ]
1200 $ [ ! -f .hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 ]
1201 $ hg pull --rebase --all-largefiles --config paths.default-push=bogus/path --config paths.default=../b
1201 $ hg pull --rebase --all-largefiles --config paths.default-push=bogus/path --config paths.default=../b
1202 pulling from $TESTTMP/b (glob)
1202 pulling from $TESTTMP/b (glob)
1203 searching for changes
1203 searching for changes
1204 adding changesets
1204 adding changesets
1205 adding manifests
1205 adding manifests
1206 adding file changes
1206 adding file changes
1207 added 1 changesets with 2 changes to 2 files (+1 heads)
1207 added 1 changesets with 2 changes to 2 files (+1 heads)
1208 rebasing 8:f574fb32bb45 "modify normal file largefile in repo d"
1208 rebasing 8:f574fb32bb45 "modify normal file largefile in repo d"
1209 Invoking status precommit hook
1209 Invoking status precommit hook
1210 M sub/normal4
1210 M sub/normal4
1211 M sub2/large6
1211 M sub2/large6
1212 saved backup bundle to $TESTTMP/d/.hg/strip-backup/f574fb32bb45-dd1d9f80-backup.hg (glob)
1212 saved backup bundle to $TESTTMP/d/.hg/strip-backup/f574fb32bb45-dd1d9f80-backup.hg (glob)
1213 0 largefiles cached
1213 0 largefiles cached
1214 $ [ -f .hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 ]
1214 $ [ -f .hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 ]
1215 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
1215 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
1216 9:598410d3eb9a modify normal file largefile in repo d
1216 9:598410d3eb9a modify normal file largefile in repo d
1217 8:a381d2c8c80e modify normal file and largefile in repo b
1217 8:a381d2c8c80e modify normal file and largefile in repo b
1218 7:daea875e9014 add/edit more largefiles
1218 7:daea875e9014 add/edit more largefiles
1219 6:4355d653f84f edit files yet again
1219 6:4355d653f84f edit files yet again
1220 5:9d5af5072dbd edit files again
1220 5:9d5af5072dbd edit files again
1221 4:74c02385b94c move files
1221 4:74c02385b94c move files
1222 3:9e8fbc4bce62 copy files
1222 3:9e8fbc4bce62 copy files
1223 2:51a0ae4d5864 remove files
1223 2:51a0ae4d5864 remove files
1224 1:ce8896473775 edit files
1224 1:ce8896473775 edit files
1225 0:30d30fe6a5be add files
1225 0:30d30fe6a5be add files
1226 $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n'
1226 $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n'
1227 @ 9:598410d3eb9a modify normal file largefile in repo d
1227 @ 9:598410d3eb9a modify normal file largefile in repo d
1228 |
1228 |
1229 o 8:a381d2c8c80e modify normal file and largefile in repo b
1229 o 8:a381d2c8c80e modify normal file and largefile in repo b
1230 |
1230 |
1231 o 7:daea875e9014 add/edit more largefiles
1231 o 7:daea875e9014 add/edit more largefiles
1232 |
1232 |
1233 o 6:4355d653f84f edit files yet again
1233 o 6:4355d653f84f edit files yet again
1234 |
1234 |
1235 o 5:9d5af5072dbd edit files again
1235 o 5:9d5af5072dbd edit files again
1236 |
1236 |
1237 o 4:74c02385b94c move files
1237 o 4:74c02385b94c move files
1238 |
1238 |
1239 o 3:9e8fbc4bce62 copy files
1239 o 3:9e8fbc4bce62 copy files
1240 |
1240 |
1241 o 2:51a0ae4d5864 remove files
1241 o 2:51a0ae4d5864 remove files
1242 |
1242 |
1243 o 1:ce8896473775 edit files
1243 o 1:ce8896473775 edit files
1244 |
1244 |
1245 o 0:30d30fe6a5be add files
1245 o 0:30d30fe6a5be add files
1246
1246
1247 $ cat normal3
1247 $ cat normal3
1248 normal3-modified
1248 normal3-modified
1249 $ cat sub/normal4
1249 $ cat sub/normal4
1250 normal4-modified
1250 normal4-modified
1251 $ cat sub/large4
1251 $ cat sub/large4
1252 large4-modified
1252 large4-modified
1253 $ cat sub2/large6
1253 $ cat sub2/large6
1254 large6-modified
1254 large6-modified
1255 $ cat sub2/large7
1255 $ cat sub2/large7
1256 large7
1256 large7
1257 $ cd ../e
1257 $ cd ../e
1258 $ hg pull ../b
1258 $ hg pull ../b
1259 pulling from ../b
1259 pulling from ../b
1260 searching for changes
1260 searching for changes
1261 adding changesets
1261 adding changesets
1262 adding manifests
1262 adding manifests
1263 adding file changes
1263 adding file changes
1264 added 1 changesets with 2 changes to 2 files (+1 heads)
1264 added 1 changesets with 2 changes to 2 files (+1 heads)
1265 (run 'hg heads' to see heads, 'hg merge' to merge)
1265 (run 'hg heads' to see heads, 'hg merge' to merge)
1266 $ hg rebase
1266 $ hg rebase
1267 rebasing 8:f574fb32bb45 "modify normal file largefile in repo d"
1267 rebasing 8:f574fb32bb45 "modify normal file largefile in repo d"
1268 Invoking status precommit hook
1268 Invoking status precommit hook
1269 M sub/normal4
1269 M sub/normal4
1270 M sub2/large6
1270 M sub2/large6
1271 saved backup bundle to $TESTTMP/e/.hg/strip-backup/f574fb32bb45-dd1d9f80-backup.hg (glob)
1271 saved backup bundle to $TESTTMP/e/.hg/strip-backup/f574fb32bb45-dd1d9f80-backup.hg (glob)
1272 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
1272 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
1273 9:598410d3eb9a modify normal file largefile in repo d
1273 9:598410d3eb9a modify normal file largefile in repo d
1274 8:a381d2c8c80e modify normal file and largefile in repo b
1274 8:a381d2c8c80e modify normal file and largefile in repo b
1275 7:daea875e9014 add/edit more largefiles
1275 7:daea875e9014 add/edit more largefiles
1276 6:4355d653f84f edit files yet again
1276 6:4355d653f84f edit files yet again
1277 5:9d5af5072dbd edit files again
1277 5:9d5af5072dbd edit files again
1278 4:74c02385b94c move files
1278 4:74c02385b94c move files
1279 3:9e8fbc4bce62 copy files
1279 3:9e8fbc4bce62 copy files
1280 2:51a0ae4d5864 remove files
1280 2:51a0ae4d5864 remove files
1281 1:ce8896473775 edit files
1281 1:ce8896473775 edit files
1282 0:30d30fe6a5be add files
1282 0:30d30fe6a5be add files
1283 $ cat normal3
1283 $ cat normal3
1284 normal3-modified
1284 normal3-modified
1285 $ cat sub/normal4
1285 $ cat sub/normal4
1286 normal4-modified
1286 normal4-modified
1287 $ cat sub/large4
1287 $ cat sub/large4
1288 large4-modified
1288 large4-modified
1289 $ cat sub2/large6
1289 $ cat sub2/large6
1290 large6-modified
1290 large6-modified
1291 $ cat sub2/large7
1291 $ cat sub2/large7
1292 large7
1292 large7
1293
1293
1294 Log on largefiles
1294 Log on largefiles
1295
1295
1296 - same output
1296 - same output
1297 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub/large4
1297 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub/large4
1298 8:a381d2c8c80e modify normal file and largefile in repo b
1298 8:a381d2c8c80e modify normal file and largefile in repo b
1299 6:4355d653f84f edit files yet again
1299 6:4355d653f84f edit files yet again
1300 5:9d5af5072dbd edit files again
1300 5:9d5af5072dbd edit files again
1301 4:74c02385b94c move files
1301 4:74c02385b94c move files
1302 $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub/large4
1302 $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub/large4
1303 o 8:a381d2c8c80e modify normal file and largefile in repo b
1303 o 8:a381d2c8c80e modify normal file and largefile in repo b
1304 :
1304 :
1305 o 6:4355d653f84f edit files yet again
1305 o 6:4355d653f84f edit files yet again
1306 |
1306 |
1307 o 5:9d5af5072dbd edit files again
1307 o 5:9d5af5072dbd edit files again
1308 |
1308 |
1309 o 4:74c02385b94c move files
1309 o 4:74c02385b94c move files
1310 |
1310 |
1311 ~
1311 ~
1312 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' sub/large4
1312 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' sub/large4
1313 8:a381d2c8c80e modify normal file and largefile in repo b
1313 8:a381d2c8c80e modify normal file and largefile in repo b
1314 6:4355d653f84f edit files yet again
1314 6:4355d653f84f edit files yet again
1315 5:9d5af5072dbd edit files again
1315 5:9d5af5072dbd edit files again
1316 4:74c02385b94c move files
1316 4:74c02385b94c move files
1317 $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub/large4
1317 $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub/large4
1318 o 8:a381d2c8c80e modify normal file and largefile in repo b
1318 o 8:a381d2c8c80e modify normal file and largefile in repo b
1319 :
1319 :
1320 o 6:4355d653f84f edit files yet again
1320 o 6:4355d653f84f edit files yet again
1321 |
1321 |
1322 o 5:9d5af5072dbd edit files again
1322 o 5:9d5af5072dbd edit files again
1323 |
1323 |
1324 o 4:74c02385b94c move files
1324 o 4:74c02385b94c move files
1325 |
1325 |
1326 ~
1326 ~
1327
1327
1328 - .hglf only matches largefiles, without .hglf it matches 9 bco sub/normal
1328 - .hglf only matches largefiles, without .hglf it matches 9 bco sub/normal
1329 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub
1329 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub
1330 8:a381d2c8c80e modify normal file and largefile in repo b
1330 8:a381d2c8c80e modify normal file and largefile in repo b
1331 6:4355d653f84f edit files yet again
1331 6:4355d653f84f edit files yet again
1332 5:9d5af5072dbd edit files again
1332 5:9d5af5072dbd edit files again
1333 4:74c02385b94c move files
1333 4:74c02385b94c move files
1334 1:ce8896473775 edit files
1334 1:ce8896473775 edit files
1335 0:30d30fe6a5be add files
1335 0:30d30fe6a5be add files
1336 $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub
1336 $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub
1337 o 8:a381d2c8c80e modify normal file and largefile in repo b
1337 o 8:a381d2c8c80e modify normal file and largefile in repo b
1338 :
1338 :
1339 o 6:4355d653f84f edit files yet again
1339 o 6:4355d653f84f edit files yet again
1340 |
1340 |
1341 o 5:9d5af5072dbd edit files again
1341 o 5:9d5af5072dbd edit files again
1342 |
1342 |
1343 o 4:74c02385b94c move files
1343 o 4:74c02385b94c move files
1344 :
1344 :
1345 o 1:ce8896473775 edit files
1345 o 1:ce8896473775 edit files
1346 |
1346 |
1347 o 0:30d30fe6a5be add files
1347 o 0:30d30fe6a5be add files
1348
1348
1349 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' sub
1349 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' sub
1350 9:598410d3eb9a modify normal file largefile in repo d
1350 9:598410d3eb9a modify normal file largefile in repo d
1351 8:a381d2c8c80e modify normal file and largefile in repo b
1351 8:a381d2c8c80e modify normal file and largefile in repo b
1352 6:4355d653f84f edit files yet again
1352 6:4355d653f84f edit files yet again
1353 5:9d5af5072dbd edit files again
1353 5:9d5af5072dbd edit files again
1354 4:74c02385b94c move files
1354 4:74c02385b94c move files
1355 1:ce8896473775 edit files
1355 1:ce8896473775 edit files
1356 0:30d30fe6a5be add files
1356 0:30d30fe6a5be add files
1357 $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n' sub
1357 $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n' sub
1358 @ 9:598410d3eb9a modify normal file largefile in repo d
1358 @ 9:598410d3eb9a modify normal file largefile in repo d
1359 |
1359 |
1360 o 8:a381d2c8c80e modify normal file and largefile in repo b
1360 o 8:a381d2c8c80e modify normal file and largefile in repo b
1361 :
1361 :
1362 o 6:4355d653f84f edit files yet again
1362 o 6:4355d653f84f edit files yet again
1363 |
1363 |
1364 o 5:9d5af5072dbd edit files again
1364 o 5:9d5af5072dbd edit files again
1365 |
1365 |
1366 o 4:74c02385b94c move files
1366 o 4:74c02385b94c move files
1367 :
1367 :
1368 o 1:ce8896473775 edit files
1368 o 1:ce8896473775 edit files
1369 |
1369 |
1370 o 0:30d30fe6a5be add files
1370 o 0:30d30fe6a5be add files
1371
1371
1372 - globbing gives same result
1372 - globbing gives same result
1373 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' 'glob:sub/*'
1373 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' 'glob:sub/*'
1374 9:598410d3eb9a modify normal file largefile in repo d
1374 9:598410d3eb9a modify normal file largefile in repo d
1375 8:a381d2c8c80e modify normal file and largefile in repo b
1375 8:a381d2c8c80e modify normal file and largefile in repo b
1376 6:4355d653f84f edit files yet again
1376 6:4355d653f84f edit files yet again
1377 5:9d5af5072dbd edit files again
1377 5:9d5af5072dbd edit files again
1378 4:74c02385b94c move files
1378 4:74c02385b94c move files
1379 1:ce8896473775 edit files
1379 1:ce8896473775 edit files
1380 0:30d30fe6a5be add files
1380 0:30d30fe6a5be add files
1381 $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n' 'glob:sub/*'
1381 $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n' 'glob:sub/*'
1382 @ 9:598410d3eb9a modify normal file largefile in repo d
1382 @ 9:598410d3eb9a modify normal file largefile in repo d
1383 |
1383 |
1384 o 8:a381d2c8c80e modify normal file and largefile in repo b
1384 o 8:a381d2c8c80e modify normal file and largefile in repo b
1385 :
1385 :
1386 o 6:4355d653f84f edit files yet again
1386 o 6:4355d653f84f edit files yet again
1387 |
1387 |
1388 o 5:9d5af5072dbd edit files again
1388 o 5:9d5af5072dbd edit files again
1389 |
1389 |
1390 o 4:74c02385b94c move files
1390 o 4:74c02385b94c move files
1391 :
1391 :
1392 o 1:ce8896473775 edit files
1392 o 1:ce8896473775 edit files
1393 |
1393 |
1394 o 0:30d30fe6a5be add files
1394 o 0:30d30fe6a5be add files
1395
1395
1396 Rollback on largefiles.
1396 Rollback on largefiles.
1397
1397
1398 $ echo large4-modified-again > sub/large4
1398 $ echo large4-modified-again > sub/large4
1399 $ hg commit -m "Modify large4 again"
1399 $ hg commit -m "Modify large4 again"
1400 Invoking status precommit hook
1400 Invoking status precommit hook
1401 M sub/large4
1401 M sub/large4
1402 $ hg rollback
1402 $ hg rollback
1403 repository tip rolled back to revision 9 (undo commit)
1403 repository tip rolled back to revision 9 (undo commit)
1404 working directory now based on revision 9
1404 working directory now based on revision 9
1405 $ hg st
1405 $ hg st
1406 M sub/large4
1406 M sub/large4
1407 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
1407 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
1408 9:598410d3eb9a modify normal file largefile in repo d
1408 9:598410d3eb9a modify normal file largefile in repo d
1409 8:a381d2c8c80e modify normal file and largefile in repo b
1409 8:a381d2c8c80e modify normal file and largefile in repo b
1410 7:daea875e9014 add/edit more largefiles
1410 7:daea875e9014 add/edit more largefiles
1411 6:4355d653f84f edit files yet again
1411 6:4355d653f84f edit files yet again
1412 5:9d5af5072dbd edit files again
1412 5:9d5af5072dbd edit files again
1413 4:74c02385b94c move files
1413 4:74c02385b94c move files
1414 3:9e8fbc4bce62 copy files
1414 3:9e8fbc4bce62 copy files
1415 2:51a0ae4d5864 remove files
1415 2:51a0ae4d5864 remove files
1416 1:ce8896473775 edit files
1416 1:ce8896473775 edit files
1417 0:30d30fe6a5be add files
1417 0:30d30fe6a5be add files
1418 $ cat sub/large4
1418 $ cat sub/large4
1419 large4-modified-again
1419 large4-modified-again
1420
1420
1421 "update --check" refuses to update with uncommitted changes.
1421 "update --check" refuses to update with uncommitted changes.
1422 $ hg update --check 8
1422 $ hg update --check 8
1423 abort: uncommitted changes
1423 abort: uncommitted changes
1424 [255]
1424 [255]
1425
1425
1426 "update --clean" leaves correct largefiles in working copy, even when there is
1426 "update --clean" leaves correct largefiles in working copy, even when there is
1427 .orig files from revert in .hglf.
1427 .orig files from revert in .hglf.
1428
1428
1429 $ echo mistake > sub2/large7
1429 $ echo mistake > sub2/large7
1430 $ hg revert sub2/large7
1430 $ hg revert sub2/large7
1431 $ cat sub2/large7
1431 $ cat sub2/large7
1432 large7
1432 large7
1433 $ cat sub2/large7.orig
1433 $ cat sub2/large7.orig
1434 mistake
1434 mistake
1435 $ test ! -f .hglf/sub2/large7.orig
1435 $ test ! -f .hglf/sub2/large7.orig
1436
1436
1437 $ hg -q update --clean -r null
1437 $ hg -q update --clean -r null
1438 $ hg update --clean
1438 $ hg update --clean
1439 getting changed largefiles
1439 getting changed largefiles
1440 3 largefiles updated, 0 removed
1440 3 largefiles updated, 0 removed
1441 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1441 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1442 $ cat normal3
1442 $ cat normal3
1443 normal3-modified
1443 normal3-modified
1444 $ cat sub/normal4
1444 $ cat sub/normal4
1445 normal4-modified
1445 normal4-modified
1446 $ cat sub/large4
1446 $ cat sub/large4
1447 large4-modified
1447 large4-modified
1448 $ cat sub2/large6
1448 $ cat sub2/large6
1449 large6-modified
1449 large6-modified
1450 $ cat sub2/large7
1450 $ cat sub2/large7
1451 large7
1451 large7
1452 $ cat sub2/large7.orig
1452 $ cat sub2/large7.orig
1453 mistake
1453 mistake
1454 $ test ! -f .hglf/sub2/large7.orig
1454 $ test ! -f .hglf/sub2/large7.orig
1455
1455
1456 verify that largefile .orig file no longer is overwritten on every update -C:
1456 verify that largefile .orig file no longer is overwritten on every update -C:
1457 $ hg update --clean
1457 $ hg update --clean
1458 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1458 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1459 $ cat sub2/large7.orig
1459 $ cat sub2/large7.orig
1460 mistake
1460 mistake
1461 $ rm sub2/large7.orig
1461 $ rm sub2/large7.orig
1462
1462
1463 Now "update check" is happy.
1463 Now "update check" is happy.
1464 $ hg update --check 8
1464 $ hg update --check 8
1465 getting changed largefiles
1465 getting changed largefiles
1466 1 largefiles updated, 0 removed
1466 1 largefiles updated, 0 removed
1467 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1467 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1468 $ hg update --check
1468 $ hg update --check
1469 getting changed largefiles
1469 getting changed largefiles
1470 1 largefiles updated, 0 removed
1470 1 largefiles updated, 0 removed
1471 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1471 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1472
1472
1473 Test removing empty largefiles directories on update
1473 Test removing empty largefiles directories on update
1474 $ test -d sub2 && echo "sub2 exists"
1474 $ test -d sub2 && echo "sub2 exists"
1475 sub2 exists
1475 sub2 exists
1476 $ hg update -q null
1476 $ hg update -q null
1477 $ test -d sub2 && echo "error: sub2 should not exist anymore"
1477 $ test -d sub2 && echo "error: sub2 should not exist anymore"
1478 [1]
1478 [1]
1479 $ hg update -q
1479 $ hg update -q
1480
1480
1481 Test hg remove removes empty largefiles directories
1481 Test hg remove removes empty largefiles directories
1482 $ test -d sub2 && echo "sub2 exists"
1482 $ test -d sub2 && echo "sub2 exists"
1483 sub2 exists
1483 sub2 exists
1484 $ hg remove sub2/*
1484 $ hg remove sub2/*
1485 $ test -d sub2 && echo "error: sub2 should not exist anymore"
1485 $ test -d sub2 && echo "error: sub2 should not exist anymore"
1486 [1]
1486 [1]
1487 $ hg revert sub2/large6 sub2/large7
1487 $ hg revert sub2/large6 sub2/large7
1488
1488
1489 "revert" works on largefiles (and normal files too).
1489 "revert" works on largefiles (and normal files too).
1490 $ echo hack3 >> normal3
1490 $ echo hack3 >> normal3
1491 $ echo hack4 >> sub/normal4
1491 $ echo hack4 >> sub/normal4
1492 $ echo hack4 >> sub/large4
1492 $ echo hack4 >> sub/large4
1493 $ rm sub2/large6
1493 $ rm sub2/large6
1494 $ hg revert sub2/large6
1494 $ hg revert sub2/large6
1495 $ hg rm sub2/large6
1495 $ hg rm sub2/large6
1496 $ echo new >> sub2/large8
1496 $ echo new >> sub2/large8
1497 $ hg add --large sub2/large8
1497 $ hg add --large sub2/large8
1498 # XXX we don't really want to report that we're reverting the standin;
1498 # XXX we don't really want to report that we're reverting the standin;
1499 # that's just an implementation detail. But I don't see an obvious fix. ;-(
1499 # that's just an implementation detail. But I don't see an obvious fix. ;-(
1500 $ hg revert sub
1500 $ hg revert sub
1501 reverting .hglf/sub/large4 (glob)
1501 reverting .hglf/sub/large4 (glob)
1502 reverting sub/normal4 (glob)
1502 reverting sub/normal4 (glob)
1503 $ hg status
1503 $ hg status
1504 M normal3
1504 M normal3
1505 A sub2/large8
1505 A sub2/large8
1506 R sub2/large6
1506 R sub2/large6
1507 ? sub/large4.orig
1507 ? sub/large4.orig
1508 ? sub/normal4.orig
1508 ? sub/normal4.orig
1509 $ cat sub/normal4
1509 $ cat sub/normal4
1510 normal4-modified
1510 normal4-modified
1511 $ cat sub/large4
1511 $ cat sub/large4
1512 large4-modified
1512 large4-modified
1513 $ hg revert -a --no-backup
1513 $ hg revert -a --no-backup
1514 undeleting .hglf/sub2/large6 (glob)
1514 undeleting .hglf/sub2/large6 (glob)
1515 forgetting .hglf/sub2/large8 (glob)
1515 forgetting .hglf/sub2/large8 (glob)
1516 reverting normal3
1516 reverting normal3
1517 $ hg status
1517 $ hg status
1518 ? sub/large4.orig
1518 ? sub/large4.orig
1519 ? sub/normal4.orig
1519 ? sub/normal4.orig
1520 ? sub2/large8
1520 ? sub2/large8
1521 $ cat normal3
1521 $ cat normal3
1522 normal3-modified
1522 normal3-modified
1523 $ cat sub2/large6
1523 $ cat sub2/large6
1524 large6-modified
1524 large6-modified
1525 $ rm sub/*.orig sub2/large8
1525 $ rm sub/*.orig sub2/large8
1526
1526
1527 revert some files to an older revision
1527 revert some files to an older revision
1528 $ hg revert --no-backup -r 8 sub2
1528 $ hg revert --no-backup -r 8 sub2
1529 reverting .hglf/sub2/large6 (glob)
1529 reverting .hglf/sub2/large6 (glob)
1530 $ cat sub2/large6
1530 $ cat sub2/large6
1531 large6
1531 large6
1532 $ hg revert --no-backup -C -r '.^' sub2
1532 $ hg revert --no-backup -C -r '.^' sub2
1533 $ hg revert --no-backup sub2
1533 $ hg revert --no-backup sub2
1534 reverting .hglf/sub2/large6 (glob)
1534 reverting .hglf/sub2/large6 (glob)
1535 $ hg status
1535 $ hg status
1536
1536
1537 "verify --large" actually verifies largefiles
1537 "verify --large" actually verifies largefiles
1538
1538
1539 - Where Do We Come From? What Are We? Where Are We Going?
1539 - Where Do We Come From? What Are We? Where Are We Going?
1540 $ pwd
1540 $ pwd
1541 $TESTTMP/e
1541 $TESTTMP/e
1542 $ hg paths
1542 $ hg paths
1543 default = $TESTTMP/d (glob)
1543 default = $TESTTMP/d (glob)
1544
1544
1545 $ hg verify --large
1545 $ hg verify --large
1546 checking changesets
1546 checking changesets
1547 checking manifests
1547 checking manifests
1548 crosschecking files in changesets and manifests
1548 crosschecking files in changesets and manifests
1549 checking files
1549 checking files
1550 10 files, 10 changesets, 28 total revisions
1550 10 files, 10 changesets, 28 total revisions
1551 searching 1 changesets for largefiles
1551 searching 1 changesets for largefiles
1552 verified existence of 3 revisions of 3 largefiles
1552 verified existence of 3 revisions of 3 largefiles
1553
1553
1554 - introduce missing blob in local store repo and remote store
1554 - introduce missing blob in local store repo and remote store
1555 and make sure that this is caught:
1555 and make sure that this is caught:
1556
1556
1557 $ mv $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 .
1557 $ mv $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 .
1558 $ rm .hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928
1558 $ rm .hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928
1559 $ hg verify --large
1559 $ hg verify --large
1560 checking changesets
1560 checking changesets
1561 checking manifests
1561 checking manifests
1562 crosschecking files in changesets and manifests
1562 crosschecking files in changesets and manifests
1563 checking files
1563 checking files
1564 10 files, 10 changesets, 28 total revisions
1564 10 files, 10 changesets, 28 total revisions
1565 searching 1 changesets for largefiles
1565 searching 1 changesets for largefiles
1566 changeset 9:598410d3eb9a: sub/large4 references missing $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 (glob)
1566 changeset 9:598410d3eb9a: sub/large4 references missing $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 (glob)
1567 verified existence of 3 revisions of 3 largefiles
1567 verified existence of 3 revisions of 3 largefiles
1568 [1]
1568 [1]
1569
1569
1570 - introduce corruption and make sure that it is caught when checking content:
1570 - introduce corruption and make sure that it is caught when checking content:
1571 $ echo '5 cents' > $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928
1571 $ echo '5 cents' > $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928
1572 $ hg verify -q --large --lfc
1572 $ hg verify -q --large --lfc
1573 changeset 9:598410d3eb9a: sub/large4 references corrupted $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 (glob)
1573 changeset 9:598410d3eb9a: sub/large4 references corrupted $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 (glob)
1574 [1]
1574 [1]
1575
1575
1576 - cleanup
1576 - cleanup
1577 $ cp e166e74c7303192238d60af5a9c4ce9bef0b7928 $TESTTMP/d/.hg/largefiles/
1577 $ cp e166e74c7303192238d60af5a9c4ce9bef0b7928 $TESTTMP/d/.hg/largefiles/
1578 $ mv e166e74c7303192238d60af5a9c4ce9bef0b7928 .hg/largefiles/
1578 $ mv e166e74c7303192238d60af5a9c4ce9bef0b7928 .hg/largefiles/
1579
1579
1580 - verifying all revisions will fail because we didn't clone all largefiles to d:
1580 - verifying all revisions will fail because we didn't clone all largefiles to d:
1581 $ echo 'T-shirt' > $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
1581 $ echo 'T-shirt' > $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
1582 $ hg verify -q --lfa --lfc
1582 $ hg verify -q --lfa --lfc
1583 changeset 0:30d30fe6a5be: large1 references missing $TESTTMP/d/.hg/largefiles/4669e532d5b2c093a78eca010077e708a071bb64 (glob)
1583 changeset 0:30d30fe6a5be: large1 references missing $TESTTMP/d/.hg/largefiles/4669e532d5b2c093a78eca010077e708a071bb64 (glob)
1584 changeset 0:30d30fe6a5be: sub/large2 references missing $TESTTMP/d/.hg/largefiles/1deebade43c8c498a3c8daddac0244dc55d1331d (glob)
1584 changeset 0:30d30fe6a5be: sub/large2 references missing $TESTTMP/d/.hg/largefiles/1deebade43c8c498a3c8daddac0244dc55d1331d (glob)
1585 changeset 1:ce8896473775: large1 references missing $TESTTMP/d/.hg/largefiles/5f78770c0e77ba4287ad6ef3071c9bf9c379742f (glob)
1585 changeset 1:ce8896473775: large1 references missing $TESTTMP/d/.hg/largefiles/5f78770c0e77ba4287ad6ef3071c9bf9c379742f (glob)
1586 changeset 1:ce8896473775: sub/large2 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 (glob)
1586 changeset 1:ce8896473775: sub/large2 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 (glob)
1587 changeset 3:9e8fbc4bce62: large1 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 (glob)
1587 changeset 3:9e8fbc4bce62: large1 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 (glob)
1588 changeset 4:74c02385b94c: large3 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 (glob)
1588 changeset 4:74c02385b94c: large3 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 (glob)
1589 changeset 4:74c02385b94c: sub/large4 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 (glob)
1589 changeset 4:74c02385b94c: sub/large4 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 (glob)
1590 changeset 5:9d5af5072dbd: large3 references missing $TESTTMP/d/.hg/largefiles/baaf12afde9d8d67f25dab6dced0d2bf77dba47c (glob)
1590 changeset 5:9d5af5072dbd: large3 references missing $TESTTMP/d/.hg/largefiles/baaf12afde9d8d67f25dab6dced0d2bf77dba47c (glob)
1591 changeset 5:9d5af5072dbd: sub/large4 references missing $TESTTMP/d/.hg/largefiles/aeb2210d19f02886dde00dac279729a48471e2f9 (glob)
1591 changeset 5:9d5af5072dbd: sub/large4 references missing $TESTTMP/d/.hg/largefiles/aeb2210d19f02886dde00dac279729a48471e2f9 (glob)
1592 changeset 6:4355d653f84f: large3 references missing $TESTTMP/d/.hg/largefiles/7838695e10da2bb75ac1156565f40a2595fa2fa0 (glob)
1592 changeset 6:4355d653f84f: large3 references missing $TESTTMP/d/.hg/largefiles/7838695e10da2bb75ac1156565f40a2595fa2fa0 (glob)
1593 [1]
1593 [1]
1594
1594
1595 - cleanup
1595 - cleanup
1596 $ rm $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
1596 $ rm $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
1597 $ rm -f .hglf/sub/*.orig
1597 $ rm -f .hglf/sub/*.orig
1598
1598
1599 Update to revision with missing largefile - and make sure it really is missing
1599 Update to revision with missing largefile - and make sure it really is missing
1600
1600
1601 $ rm ${USERCACHE}/7838695e10da2bb75ac1156565f40a2595fa2fa0
1601 $ rm ${USERCACHE}/7838695e10da2bb75ac1156565f40a2595fa2fa0
1602 $ hg up -r 6
1602 $ hg up -r 6
1603 getting changed largefiles
1603 getting changed largefiles
1604 large3: largefile 7838695e10da2bb75ac1156565f40a2595fa2fa0 not available from file:/*/$TESTTMP/d (glob)
1604 large3: largefile 7838695e10da2bb75ac1156565f40a2595fa2fa0 not available from file:/*/$TESTTMP/d (glob)
1605 1 largefiles updated, 2 removed
1605 1 largefiles updated, 2 removed
1606 4 files updated, 0 files merged, 2 files removed, 0 files unresolved
1606 4 files updated, 0 files merged, 2 files removed, 0 files unresolved
1607 $ rm normal3
1607 $ rm normal3
1608 $ echo >> sub/normal4
1608 $ echo >> sub/normal4
1609 $ hg ci -m 'commit with missing files'
1609 $ hg ci -m 'commit with missing files'
1610 Invoking status precommit hook
1610 Invoking status precommit hook
1611 M sub/normal4
1611 M sub/normal4
1612 ! large3
1612 ! large3
1613 ! normal3
1613 ! normal3
1614 created new head
1614 created new head
1615 $ hg st
1615 $ hg st
1616 ! large3
1616 ! large3
1617 ! normal3
1617 ! normal3
1618 $ hg up -r.
1618 $ hg up -r.
1619 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1619 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1620 $ hg st
1620 $ hg st
1621 ! large3
1621 ! large3
1622 ! normal3
1622 ! normal3
1623 $ hg up -Cr.
1623 $ hg up -Cr.
1624 getting changed largefiles
1624 getting changed largefiles
1625 large3: largefile 7838695e10da2bb75ac1156565f40a2595fa2fa0 not available from file:/*/$TESTTMP/d (glob)
1625 large3: largefile 7838695e10da2bb75ac1156565f40a2595fa2fa0 not available from file:/*/$TESTTMP/d (glob)
1626 0 largefiles updated, 0 removed
1626 0 largefiles updated, 0 removed
1627 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1627 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1628 $ hg st
1628 $ hg st
1629 ! large3
1629 ! large3
1630 $ hg rollback
1630 $ hg rollback
1631 repository tip rolled back to revision 9 (undo commit)
1631 repository tip rolled back to revision 9 (undo commit)
1632 working directory now based on revision 6
1632 working directory now based on revision 6
1633
1633
1634 Merge with revision with missing largefile - and make sure it tries to fetch it.
1634 Merge with revision with missing largefile - and make sure it tries to fetch it.
1635
1635
1636 $ hg up -Cqr null
1636 $ hg up -Cqr null
1637 $ echo f > f
1637 $ echo f > f
1638 $ hg ci -Am branch
1638 $ hg ci -Am branch
1639 adding f
1639 adding f
1640 Invoking status precommit hook
1640 Invoking status precommit hook
1641 A f
1641 A f
1642 created new head
1642 created new head
1643 $ hg merge -r 6
1643 $ hg merge -r 6
1644 getting changed largefiles
1644 getting changed largefiles
1645 large3: largefile 7838695e10da2bb75ac1156565f40a2595fa2fa0 not available from file:/*/$TESTTMP/d (glob)
1645 large3: largefile 7838695e10da2bb75ac1156565f40a2595fa2fa0 not available from file:/*/$TESTTMP/d (glob)
1646 1 largefiles updated, 0 removed
1646 1 largefiles updated, 0 removed
1647 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
1647 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
1648 (branch merge, don't forget to commit)
1648 (branch merge, don't forget to commit)
1649
1649
1650 $ hg rollback -q
1650 $ hg rollback -q
1651 $ hg up -Cq
1651 $ hg up -Cq
1652
1652
1653 Pulling 0 revisions with --all-largefiles should not fetch for all revisions
1653 Pulling 0 revisions with --all-largefiles should not fetch for all revisions
1654
1654
1655 $ hg pull --all-largefiles
1655 $ hg pull --all-largefiles
1656 pulling from $TESTTMP/d (glob)
1656 pulling from $TESTTMP/d (glob)
1657 searching for changes
1657 searching for changes
1658 no changes found
1658 no changes found
1659
1659
1660 Merging does not revert to old versions of largefiles and also check
1660 Merging does not revert to old versions of largefiles and also check
1661 that merging after having pulled from a non-default remote works
1661 that merging after having pulled from a non-default remote works
1662 correctly.
1662 correctly.
1663
1663
1664 $ cd ..
1664 $ cd ..
1665 $ hg clone -r 7 e temp
1665 $ hg clone -r 7 e temp
1666 adding changesets
1666 adding changesets
1667 adding manifests
1667 adding manifests
1668 adding file changes
1668 adding file changes
1669 added 8 changesets with 24 changes to 10 files
1669 added 8 changesets with 24 changes to 10 files
1670 updating to branch default
1670 updating to branch default
1671 getting changed largefiles
1671 getting changed largefiles
1672 3 largefiles updated, 0 removed
1672 3 largefiles updated, 0 removed
1673 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1673 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1674 $ hg clone temp f
1674 $ hg clone temp f
1675 updating to branch default
1675 updating to branch default
1676 getting changed largefiles
1676 getting changed largefiles
1677 3 largefiles updated, 0 removed
1677 3 largefiles updated, 0 removed
1678 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1678 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1679 # Delete the largefiles in the largefiles system cache so that we have an
1679 # Delete the largefiles in the largefiles system cache so that we have an
1680 # opportunity to test that caching after a pull works.
1680 # opportunity to test that caching after a pull works.
1681 $ rm "${USERCACHE}"/*
1681 $ rm "${USERCACHE}"/*
1682 $ cd f
1682 $ cd f
1683 $ echo "large4-merge-test" > sub/large4
1683 $ echo "large4-merge-test" > sub/large4
1684 $ hg commit -m "Modify large4 to test merge"
1684 $ hg commit -m "Modify large4 to test merge"
1685 Invoking status precommit hook
1685 Invoking status precommit hook
1686 M sub/large4
1686 M sub/large4
1687 # Test --cache-largefiles flag
1687 # Test --cache-largefiles flag
1688 $ hg pull --lfrev 'heads(pulled())' ../e
1688 $ hg pull --lfrev 'heads(pulled())' ../e
1689 pulling from ../e
1689 pulling from ../e
1690 searching for changes
1690 searching for changes
1691 adding changesets
1691 adding changesets
1692 adding manifests
1692 adding manifests
1693 adding file changes
1693 adding file changes
1694 added 2 changesets with 4 changes to 4 files (+1 heads)
1694 added 2 changesets with 4 changes to 4 files (+1 heads)
1695 (run 'hg heads' to see heads, 'hg merge' to merge)
1695 (run 'hg heads' to see heads, 'hg merge' to merge)
1696 2 largefiles cached
1696 2 largefiles cached
1697 $ hg merge
1697 $ hg merge
1698 largefile sub/large4 has a merge conflict
1698 largefile sub/large4 has a merge conflict
1699 ancestor was 971fb41e78fea4f8e0ba5244784239371cb00591
1699 ancestor was 971fb41e78fea4f8e0ba5244784239371cb00591
1700 keep (l)ocal d846f26643bfa8ec210be40cc93cc6b7ff1128ea or
1700 keep (l)ocal d846f26643bfa8ec210be40cc93cc6b7ff1128ea or
1701 take (o)ther e166e74c7303192238d60af5a9c4ce9bef0b7928? l
1701 take (o)ther e166e74c7303192238d60af5a9c4ce9bef0b7928? l
1702 getting changed largefiles
1702 getting changed largefiles
1703 1 largefiles updated, 0 removed
1703 1 largefiles updated, 0 removed
1704 3 files updated, 1 files merged, 0 files removed, 0 files unresolved
1704 3 files updated, 1 files merged, 0 files removed, 0 files unresolved
1705 (branch merge, don't forget to commit)
1705 (branch merge, don't forget to commit)
1706 $ hg commit -m "Merge repos e and f"
1706 $ hg commit -m "Merge repos e and f"
1707 Invoking status precommit hook
1707 Invoking status precommit hook
1708 M normal3
1708 M normal3
1709 M sub/normal4
1709 M sub/normal4
1710 M sub2/large6
1710 M sub2/large6
1711 $ cat normal3
1711 $ cat normal3
1712 normal3-modified
1712 normal3-modified
1713 $ cat sub/normal4
1713 $ cat sub/normal4
1714 normal4-modified
1714 normal4-modified
1715 $ cat sub/large4
1715 $ cat sub/large4
1716 large4-merge-test
1716 large4-merge-test
1717 $ cat sub2/large6
1717 $ cat sub2/large6
1718 large6-modified
1718 large6-modified
1719 $ cat sub2/large7
1719 $ cat sub2/large7
1720 large7
1720 large7
1721
1721
1722 Test status after merging with a branch that introduces a new largefile:
1722 Test status after merging with a branch that introduces a new largefile:
1723
1723
1724 $ echo large > large
1724 $ echo large > large
1725 $ hg add --large large
1725 $ hg add --large large
1726 $ hg commit -m 'add largefile'
1726 $ hg commit -m 'add largefile'
1727 Invoking status precommit hook
1727 Invoking status precommit hook
1728 A large
1728 A large
1729 $ hg update -q ".^"
1729 $ hg update -q ".^"
1730 $ echo change >> normal3
1730 $ echo change >> normal3
1731 $ hg commit -m 'some change'
1731 $ hg commit -m 'some change'
1732 Invoking status precommit hook
1732 Invoking status precommit hook
1733 M normal3
1733 M normal3
1734 created new head
1734 created new head
1735 $ hg merge
1735 $ hg merge
1736 getting changed largefiles
1736 getting changed largefiles
1737 1 largefiles updated, 0 removed
1737 1 largefiles updated, 0 removed
1738 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1738 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1739 (branch merge, don't forget to commit)
1739 (branch merge, don't forget to commit)
1740 $ hg status
1740 $ hg status
1741 M large
1741 M large
1742
1742
1743 - make sure update of merge with removed largefiles fails as expected
1743 - make sure update of merge with removed largefiles fails as expected
1744 $ hg rm sub2/large6
1744 $ hg rm sub2/large6
1745 $ hg up -r.
1745 $ hg up -r.
1746 abort: outstanding uncommitted merge
1746 abort: outstanding uncommitted merge
1747 [255]
1747 [255]
1748
1748
1749 - revert should be able to revert files introduced in a pending merge
1749 - revert should be able to revert files introduced in a pending merge
1750 $ hg revert --all -r .
1750 $ hg revert --all -r .
1751 removing .hglf/large (glob)
1751 removing .hglf/large (glob)
1752 undeleting .hglf/sub2/large6 (glob)
1752 undeleting .hglf/sub2/large6 (glob)
1753
1753
1754 Test that a normal file and a largefile with the same name and path cannot
1754 Test that a normal file and a largefile with the same name and path cannot
1755 coexist.
1755 coexist.
1756
1756
1757 $ rm sub2/large7
1757 $ rm sub2/large7
1758 $ echo "largeasnormal" > sub2/large7
1758 $ echo "largeasnormal" > sub2/large7
1759 $ hg add sub2/large7
1759 $ hg add sub2/large7
1760 sub2/large7 already a largefile (glob)
1760 sub2/large7 already a largefile (glob)
1761
1761
1762 Test that transplanting a largefile change works correctly.
1762 Test that transplanting a largefile change works correctly.
1763
1763
1764 $ cd ..
1764 $ cd ..
1765 $ hg clone -r 8 d g
1765 $ hg clone -r 8 d g
1766 adding changesets
1766 adding changesets
1767 adding manifests
1767 adding manifests
1768 adding file changes
1768 adding file changes
1769 added 9 changesets with 26 changes to 10 files
1769 added 9 changesets with 26 changes to 10 files
1770 updating to branch default
1770 updating to branch default
1771 getting changed largefiles
1771 getting changed largefiles
1772 3 largefiles updated, 0 removed
1772 3 largefiles updated, 0 removed
1773 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1773 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1774 $ cd g
1774 $ cd g
1775 $ hg transplant -s ../d 598410d3eb9a
1775 $ hg transplant -s ../d 598410d3eb9a
1776 searching for changes
1776 searching for changes
1777 searching for changes
1777 searching for changes
1778 adding changesets
1778 adding changesets
1779 adding manifests
1779 adding manifests
1780 adding file changes
1780 adding file changes
1781 added 1 changesets with 2 changes to 2 files
1781 added 1 changesets with 2 changes to 2 files
1782 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
1782 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
1783 9:598410d3eb9a modify normal file largefile in repo d
1783 9:598410d3eb9a modify normal file largefile in repo d
1784 8:a381d2c8c80e modify normal file and largefile in repo b
1784 8:a381d2c8c80e modify normal file and largefile in repo b
1785 7:daea875e9014 add/edit more largefiles
1785 7:daea875e9014 add/edit more largefiles
1786 6:4355d653f84f edit files yet again
1786 6:4355d653f84f edit files yet again
1787 5:9d5af5072dbd edit files again
1787 5:9d5af5072dbd edit files again
1788 4:74c02385b94c move files
1788 4:74c02385b94c move files
1789 3:9e8fbc4bce62 copy files
1789 3:9e8fbc4bce62 copy files
1790 2:51a0ae4d5864 remove files
1790 2:51a0ae4d5864 remove files
1791 1:ce8896473775 edit files
1791 1:ce8896473775 edit files
1792 0:30d30fe6a5be add files
1792 0:30d30fe6a5be add files
1793 $ cat normal3
1793 $ cat normal3
1794 normal3-modified
1794 normal3-modified
1795 $ cat sub/normal4
1795 $ cat sub/normal4
1796 normal4-modified
1796 normal4-modified
1797 $ cat sub/large4
1797 $ cat sub/large4
1798 large4-modified
1798 large4-modified
1799 $ cat sub2/large6
1799 $ cat sub2/large6
1800 large6-modified
1800 large6-modified
1801 $ cat sub2/large7
1801 $ cat sub2/large7
1802 large7
1802 large7
1803
1803
1804 Cat a largefile
1804 Cat a largefile
1805 $ hg cat normal3
1805 $ hg cat normal3
1806 normal3-modified
1806 normal3-modified
1807 $ hg cat sub/large4
1807 $ hg cat sub/large4
1808 large4-modified
1808 large4-modified
1809 $ rm "${USERCACHE}"/*
1809 $ rm "${USERCACHE}"/*
1810 $ hg cat -r a381d2c8c80e -o cat.out sub/large4
1810 $ hg cat -r a381d2c8c80e -o cat.out sub/large4
1811 $ cat cat.out
1811 $ cat cat.out
1812 large4-modified
1812 large4-modified
1813 $ rm cat.out
1813 $ rm cat.out
1814 $ hg cat -r a381d2c8c80e normal3
1814 $ hg cat -r a381d2c8c80e normal3
1815 normal3-modified
1815 normal3-modified
1816 $ hg cat -r '.^' normal3
1816 $ hg cat -r '.^' normal3
1817 normal3-modified
1817 normal3-modified
1818 $ hg cat -r '.^' sub/large4 doesntexist
1818 $ hg cat -r '.^' sub/large4 doesntexist
1819 large4-modified
1819 large4-modified
1820 doesntexist: no such file in rev a381d2c8c80e
1820 doesntexist: no such file in rev a381d2c8c80e
1821 $ hg --cwd sub cat -r '.^' large4
1821 $ hg --cwd sub cat -r '.^' large4
1822 large4-modified
1822 large4-modified
1823 $ hg --cwd sub cat -r '.^' ../normal3
1823 $ hg --cwd sub cat -r '.^' ../normal3
1824 normal3-modified
1824 normal3-modified
1825 Cat a standin
1825 Cat a standin
1826 $ hg cat .hglf/sub/large4
1826 $ hg cat .hglf/sub/large4
1827 e166e74c7303192238d60af5a9c4ce9bef0b7928
1827 e166e74c7303192238d60af5a9c4ce9bef0b7928
1828 $ hg cat .hglf/normal3
1828 $ hg cat .hglf/normal3
1829 .hglf/normal3: no such file in rev 598410d3eb9a (glob)
1829 .hglf/normal3: no such file in rev 598410d3eb9a (glob)
1830 [1]
1830 [1]
1831
1831
1832 Test that renaming a largefile results in correct output for status
1832 Test that renaming a largefile results in correct output for status
1833
1833
1834 $ hg rename sub/large4 large4-renamed
1834 $ hg rename sub/large4 large4-renamed
1835 $ hg commit -m "test rename output"
1835 $ hg commit -m "test rename output"
1836 Invoking status precommit hook
1836 Invoking status precommit hook
1837 A large4-renamed
1837 A large4-renamed
1838 R sub/large4
1838 R sub/large4
1839 $ cat large4-renamed
1839 $ cat large4-renamed
1840 large4-modified
1840 large4-modified
1841 $ cd sub2
1841 $ cd sub2
1842 $ hg rename large6 large6-renamed
1842 $ hg rename large6 large6-renamed
1843 $ hg st
1843 $ hg st
1844 A sub2/large6-renamed
1844 A sub2/large6-renamed
1845 R sub2/large6
1845 R sub2/large6
1846 $ cd ..
1846 $ cd ..
1847
1847
1848 Test --normal flag
1848 Test --normal flag
1849
1849
1850 $ dd if=/dev/zero bs=2k count=11k > new-largefile 2> /dev/null
1850 $ dd if=/dev/zero bs=2k count=11k > new-largefile 2> /dev/null
1851 $ hg add --normal --large new-largefile
1851 $ hg add --normal --large new-largefile
1852 abort: --normal cannot be used with --large
1852 abort: --normal cannot be used with --large
1853 [255]
1853 [255]
1854 $ hg add --normal new-largefile
1854 $ hg add --normal new-largefile
1855 new-largefile: up to 69 MB of RAM may be required to manage this file
1855 new-largefile: up to 69 MB of RAM may be required to manage this file
1856 (use 'hg revert new-largefile' to cancel the pending addition)
1856 (use 'hg revert new-largefile' to cancel the pending addition)
1857
1857
1858 Test explicit commit of switch between normal and largefile - make sure both
1858 Test explicit commit of switch between normal and largefile - make sure both
1859 the add and the remove is committed.
1859 the add and the remove is committed.
1860
1860
1861 $ hg up -qC
1861 $ hg up -qC
1862 $ hg forget normal3 large4-renamed
1862 $ hg forget normal3 large4-renamed
1863 $ hg add --large normal3
1863 $ hg add --large normal3
1864 $ hg add large4-renamed
1864 $ hg add large4-renamed
1865 $ hg commit -m 'swap' normal3 large4-renamed
1865 $ hg commit -m 'swap' normal3 large4-renamed
1866 Invoking status precommit hook
1866 Invoking status precommit hook
1867 A large4-renamed
1867 A large4-renamed
1868 A normal3
1868 A normal3
1869 ? new-largefile
1869 ? new-largefile
1870 ? sub2/large6-renamed
1870 ? sub2/large6-renamed
1871 $ hg mani
1871 $ hg mani
1872 .hglf/normal3
1872 .hglf/normal3
1873 .hglf/sub2/large6
1873 .hglf/sub2/large6
1874 .hglf/sub2/large7
1874 .hglf/sub2/large7
1875 large4-renamed
1875 large4-renamed
1876 sub/normal4
1876 sub/normal4
1877
1877
1878 $ cd ..
1878 $ cd ..
1879
1879
1880
1880
1881
1881
@@ -1,63 +1,63 b''
1 $ cat > echo.py <<EOF
1 $ cat > echo.py <<EOF
2 > #!/usr/bin/env python
2 > #!$PYTHON
3 > import os, sys
3 > import os, sys
4 > try:
4 > try:
5 > import msvcrt
5 > import msvcrt
6 > msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY)
6 > msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY)
7 > msvcrt.setmode(sys.stderr.fileno(), os.O_BINARY)
7 > msvcrt.setmode(sys.stderr.fileno(), os.O_BINARY)
8 > except ImportError:
8 > except ImportError:
9 > pass
9 > pass
10 >
10 >
11 > for k in ('HG_FILE', 'HG_MY_ISLINK', 'HG_OTHER_ISLINK', 'HG_BASE_ISLINK'):
11 > for k in ('HG_FILE', 'HG_MY_ISLINK', 'HG_OTHER_ISLINK', 'HG_BASE_ISLINK'):
12 > print k, os.environ[k]
12 > print k, os.environ[k]
13 > EOF
13 > EOF
14
14
15 Create 2 heads containing the same file, once as
15 Create 2 heads containing the same file, once as
16 a file, once as a link. Bundle was generated with:
16 a file, once as a link. Bundle was generated with:
17
17
18 # hg init t
18 # hg init t
19 # cd t
19 # cd t
20 # echo a > a
20 # echo a > a
21 # hg ci -qAm t0 -d '0 0'
21 # hg ci -qAm t0 -d '0 0'
22 # echo l > l
22 # echo l > l
23 # hg ci -qAm t1 -d '1 0'
23 # hg ci -qAm t1 -d '1 0'
24 # hg up -C 0
24 # hg up -C 0
25 # ln -s a l
25 # ln -s a l
26 # hg ci -qAm t2 -d '2 0'
26 # hg ci -qAm t2 -d '2 0'
27 # echo l2 > l2
27 # echo l2 > l2
28 # hg ci -qAm t3 -d '3 0'
28 # hg ci -qAm t3 -d '3 0'
29
29
30 $ hg init t
30 $ hg init t
31 $ cd t
31 $ cd t
32 $ hg -q pull "$TESTDIR/bundles/test-merge-symlinks.hg"
32 $ hg -q pull "$TESTDIR/bundles/test-merge-symlinks.hg"
33 $ hg up -C 3
33 $ hg up -C 3
34 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
34 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
35
35
36 Merge them and display *_ISLINK vars
36 Merge them and display *_ISLINK vars
37 merge heads
37 merge heads
38
38
39 $ hg merge --tool="python ../echo.py"
39 $ hg merge --tool="python ../echo.py"
40 merging l
40 merging l
41 HG_FILE l
41 HG_FILE l
42 HG_MY_ISLINK 1
42 HG_MY_ISLINK 1
43 HG_OTHER_ISLINK 0
43 HG_OTHER_ISLINK 0
44 HG_BASE_ISLINK 0
44 HG_BASE_ISLINK 0
45 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
45 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
46 (branch merge, don't forget to commit)
46 (branch merge, don't forget to commit)
47
47
48 Test working directory symlink bit calculation wrt copies,
48 Test working directory symlink bit calculation wrt copies,
49 especially on non-supporting systems.
49 especially on non-supporting systems.
50 merge working directory
50 merge working directory
51
51
52 $ hg up -C 2
52 $ hg up -C 2
53 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
53 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
54 $ hg copy l l2
54 $ hg copy l l2
55 $ HGMERGE="python ../echo.py" hg up 3
55 $ HGMERGE="python ../echo.py" hg up 3
56 merging l2
56 merging l2
57 HG_FILE l2
57 HG_FILE l2
58 HG_MY_ISLINK 1
58 HG_MY_ISLINK 1
59 HG_OTHER_ISLINK 0
59 HG_OTHER_ISLINK 0
60 HG_BASE_ISLINK 0
60 HG_BASE_ISLINK 0
61 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
61 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
62
62
63 $ cd ..
63 $ cd ..
@@ -1,66 +1,66 b''
1 #require no-msys # MSYS will translate web paths as if they were file paths
1 #require no-msys # MSYS will translate web paths as if they were file paths
2
2
3 This tests if CGI files from after d0db3462d568 but
3 This tests if CGI files from after d0db3462d568 but
4 before d74fc8dec2b4 still work.
4 before d74fc8dec2b4 still work.
5
5
6 $ hg init test
6 $ hg init test
7 $ cat >hgweb.cgi <<HGWEB
7 $ cat >hgweb.cgi <<HGWEB
8 > #!/usr/bin/env python
8 > #!$PYTHON
9 > #
9 > #
10 > # An example CGI script to use hgweb, edit as necessary
10 > # An example CGI script to use hgweb, edit as necessary
11 >
11 >
12 > import cgitb
12 > import cgitb
13 > cgitb.enable()
13 > cgitb.enable()
14 >
14 >
15 > from mercurial import demandimport; demandimport.enable()
15 > from mercurial import demandimport; demandimport.enable()
16 > from mercurial.hgweb import hgweb
16 > from mercurial.hgweb import hgweb
17 > from mercurial.hgweb import wsgicgi
17 > from mercurial.hgweb import wsgicgi
18 > from mercurial.hgweb.request import wsgiapplication
18 > from mercurial.hgweb.request import wsgiapplication
19 >
19 >
20 > def make_web_app():
20 > def make_web_app():
21 > return hgweb("test", "Empty test repository")
21 > return hgweb("test", "Empty test repository")
22 >
22 >
23 > wsgicgi.launch(wsgiapplication(make_web_app))
23 > wsgicgi.launch(wsgiapplication(make_web_app))
24 > HGWEB
24 > HGWEB
25
25
26 $ chmod 755 hgweb.cgi
26 $ chmod 755 hgweb.cgi
27
27
28 $ cat >hgweb.config <<HGWEBDIRCONF
28 $ cat >hgweb.config <<HGWEBDIRCONF
29 > [paths]
29 > [paths]
30 > test = test
30 > test = test
31 > HGWEBDIRCONF
31 > HGWEBDIRCONF
32
32
33 $ cat >hgwebdir.cgi <<HGWEBDIR
33 $ cat >hgwebdir.cgi <<HGWEBDIR
34 > #!/usr/bin/env python
34 > #!$PYTHON
35 > #
35 > #
36 > # An example CGI script to export multiple hgweb repos, edit as necessary
36 > # An example CGI script to export multiple hgweb repos, edit as necessary
37 >
37 >
38 > import cgitb
38 > import cgitb
39 > cgitb.enable()
39 > cgitb.enable()
40 >
40 >
41 > from mercurial import demandimport; demandimport.enable()
41 > from mercurial import demandimport; demandimport.enable()
42 > from mercurial.hgweb import hgwebdir
42 > from mercurial.hgweb import hgwebdir
43 > from mercurial.hgweb import wsgicgi
43 > from mercurial.hgweb import wsgicgi
44 > from mercurial.hgweb.request import wsgiapplication
44 > from mercurial.hgweb.request import wsgiapplication
45 >
45 >
46 > def make_web_app():
46 > def make_web_app():
47 > return hgwebdir("hgweb.config")
47 > return hgwebdir("hgweb.config")
48 >
48 >
49 > wsgicgi.launch(wsgiapplication(make_web_app))
49 > wsgicgi.launch(wsgiapplication(make_web_app))
50 > HGWEBDIR
50 > HGWEBDIR
51
51
52 $ chmod 755 hgwebdir.cgi
52 $ chmod 755 hgwebdir.cgi
53
53
54 $ . "$TESTDIR/cgienv"
54 $ . "$TESTDIR/cgienv"
55 $ python hgweb.cgi > page1
55 $ python hgweb.cgi > page1
56 $ python hgwebdir.cgi > page2
56 $ python hgwebdir.cgi > page2
57
57
58 $ PATH_INFO="/test/"
58 $ PATH_INFO="/test/"
59 $ PATH_TRANSLATED="/var/something/test.cgi"
59 $ PATH_TRANSLATED="/var/something/test.cgi"
60 $ REQUEST_URI="/test/test/"
60 $ REQUEST_URI="/test/test/"
61 $ SCRIPT_URI="http://hg.omnifarious.org/test/test/"
61 $ SCRIPT_URI="http://hg.omnifarious.org/test/test/"
62 $ SCRIPT_URL="/test/test/"
62 $ SCRIPT_URL="/test/test/"
63 $ python hgwebdir.cgi > page3
63 $ python hgwebdir.cgi > page3
64
64
65 $ grep -i error page1 page2 page3
65 $ grep -i error page1 page2 page3
66 [1]
66 [1]
@@ -1,60 +1,60 b''
1 #require no-msys # MSYS will translate web paths as if they were file paths
1 #require no-msys # MSYS will translate web paths as if they were file paths
2
2
3 This is a rudimentary test of the CGI files as of d74fc8dec2b4.
3 This is a rudimentary test of the CGI files as of d74fc8dec2b4.
4
4
5 $ hg init test
5 $ hg init test
6
6
7 $ cat >hgweb.cgi <<HGWEB
7 $ cat >hgweb.cgi <<HGWEB
8 > #!/usr/bin/env python
8 > #!$PYTHON
9 > #
9 > #
10 > # An example CGI script to use hgweb, edit as necessary
10 > # An example CGI script to use hgweb, edit as necessary
11 >
11 >
12 > import cgitb
12 > import cgitb
13 > cgitb.enable()
13 > cgitb.enable()
14 >
14 >
15 > from mercurial import demandimport; demandimport.enable()
15 > from mercurial import demandimport; demandimport.enable()
16 > from mercurial.hgweb import hgweb
16 > from mercurial.hgweb import hgweb
17 > from mercurial.hgweb import wsgicgi
17 > from mercurial.hgweb import wsgicgi
18 >
18 >
19 > application = hgweb("test", "Empty test repository")
19 > application = hgweb("test", "Empty test repository")
20 > wsgicgi.launch(application)
20 > wsgicgi.launch(application)
21 > HGWEB
21 > HGWEB
22
22
23 $ chmod 755 hgweb.cgi
23 $ chmod 755 hgweb.cgi
24
24
25 $ cat >hgweb.config <<HGWEBDIRCONF
25 $ cat >hgweb.config <<HGWEBDIRCONF
26 > [paths]
26 > [paths]
27 > test = test
27 > test = test
28 > HGWEBDIRCONF
28 > HGWEBDIRCONF
29
29
30 $ cat >hgwebdir.cgi <<HGWEBDIR
30 $ cat >hgwebdir.cgi <<HGWEBDIR
31 > #!/usr/bin/env python
31 > #!$PYTHON
32 > #
32 > #
33 > # An example CGI script to export multiple hgweb repos, edit as necessary
33 > # An example CGI script to export multiple hgweb repos, edit as necessary
34 >
34 >
35 > import cgitb
35 > import cgitb
36 > cgitb.enable()
36 > cgitb.enable()
37 >
37 >
38 > from mercurial import demandimport; demandimport.enable()
38 > from mercurial import demandimport; demandimport.enable()
39 > from mercurial.hgweb import hgwebdir
39 > from mercurial.hgweb import hgwebdir
40 > from mercurial.hgweb import wsgicgi
40 > from mercurial.hgweb import wsgicgi
41 >
41 >
42 > application = hgwebdir("hgweb.config")
42 > application = hgwebdir("hgweb.config")
43 > wsgicgi.launch(application)
43 > wsgicgi.launch(application)
44 > HGWEBDIR
44 > HGWEBDIR
45
45
46 $ chmod 755 hgwebdir.cgi
46 $ chmod 755 hgwebdir.cgi
47
47
48 $ . "$TESTDIR/cgienv"
48 $ . "$TESTDIR/cgienv"
49 $ python hgweb.cgi > page1
49 $ python hgweb.cgi > page1
50 $ python hgwebdir.cgi > page2
50 $ python hgwebdir.cgi > page2
51
51
52 $ PATH_INFO="/test/"
52 $ PATH_INFO="/test/"
53 $ PATH_TRANSLATED="/var/something/test.cgi"
53 $ PATH_TRANSLATED="/var/something/test.cgi"
54 $ REQUEST_URI="/test/test/"
54 $ REQUEST_URI="/test/test/"
55 $ SCRIPT_URI="http://hg.omnifarious.org/test/test/"
55 $ SCRIPT_URI="http://hg.omnifarious.org/test/test/"
56 $ SCRIPT_URL="/test/test/"
56 $ SCRIPT_URL="/test/test/"
57 $ python hgwebdir.cgi > page3
57 $ python hgwebdir.cgi > page3
58
58
59 $ grep -i error page1 page2 page3
59 $ grep -i error page1 page2 page3
60 [1]
60 [1]
@@ -1,76 +1,76 b''
1 #require no-msys # MSYS will translate web paths as if they were file paths
1 #require no-msys # MSYS will translate web paths as if they were file paths
2
2
3 This tests if CGI files from before d0db3462d568 still work.
3 This tests if CGI files from before d0db3462d568 still work.
4
4
5 $ hg init test
5 $ hg init test
6 $ cat >hgweb.cgi <<HGWEB
6 $ cat >hgweb.cgi <<HGWEB
7 > #!/usr/bin/env python
7 > #!$PYTHON
8 > #
8 > #
9 > # An example CGI script to use hgweb, edit as necessary
9 > # An example CGI script to use hgweb, edit as necessary
10 >
10 >
11 > import cgitb, os, sys
11 > import cgitb, os, sys
12 > cgitb.enable()
12 > cgitb.enable()
13 >
13 >
14 > # sys.path.insert(0, "/path/to/python/lib") # if not a system-wide install
14 > # sys.path.insert(0, "/path/to/python/lib") # if not a system-wide install
15 > from mercurial import hgweb
15 > from mercurial import hgweb
16 >
16 >
17 > h = hgweb.hgweb("test", "Empty test repository")
17 > h = hgweb.hgweb("test", "Empty test repository")
18 > h.run()
18 > h.run()
19 > HGWEB
19 > HGWEB
20
20
21 $ chmod 755 hgweb.cgi
21 $ chmod 755 hgweb.cgi
22
22
23 $ cat >hgweb.config <<HGWEBDIRCONF
23 $ cat >hgweb.config <<HGWEBDIRCONF
24 > [paths]
24 > [paths]
25 > test = test
25 > test = test
26 > HGWEBDIRCONF
26 > HGWEBDIRCONF
27
27
28 $ cat >hgwebdir.cgi <<HGWEBDIR
28 $ cat >hgwebdir.cgi <<HGWEBDIR
29 > #!/usr/bin/env python
29 > #!$PYTHON
30 > #
30 > #
31 > # An example CGI script to export multiple hgweb repos, edit as necessary
31 > # An example CGI script to export multiple hgweb repos, edit as necessary
32 >
32 >
33 > import cgitb, sys
33 > import cgitb, sys
34 > cgitb.enable()
34 > cgitb.enable()
35 >
35 >
36 > # sys.path.insert(0, "/path/to/python/lib") # if not a system-wide install
36 > # sys.path.insert(0, "/path/to/python/lib") # if not a system-wide install
37 > from mercurial import hgweb
37 > from mercurial import hgweb
38 >
38 >
39 > # The config file looks like this. You can have paths to individual
39 > # The config file looks like this. You can have paths to individual
40 > # repos, collections of repos in a directory tree, or both.
40 > # repos, collections of repos in a directory tree, or both.
41 > #
41 > #
42 > # [paths]
42 > # [paths]
43 > # virtual/path = /real/path
43 > # virtual/path = /real/path
44 > # virtual/path = /real/path
44 > # virtual/path = /real/path
45 > #
45 > #
46 > # [collections]
46 > # [collections]
47 > # /prefix/to/strip/off = /root/of/tree/full/of/repos
47 > # /prefix/to/strip/off = /root/of/tree/full/of/repos
48 > #
48 > #
49 > # collections example: say directory tree /foo contains repos /foo/bar,
49 > # collections example: say directory tree /foo contains repos /foo/bar,
50 > # /foo/quux/baz. Give this config section:
50 > # /foo/quux/baz. Give this config section:
51 > # [collections]
51 > # [collections]
52 > # /foo = /foo
52 > # /foo = /foo
53 > # Then repos will list as bar and quux/baz.
53 > # Then repos will list as bar and quux/baz.
54 >
54 >
55 > # Alternatively you can pass a list of ('virtual/path', '/real/path') tuples
55 > # Alternatively you can pass a list of ('virtual/path', '/real/path') tuples
56 > # or use a dictionary with entries like 'virtual/path': '/real/path'
56 > # or use a dictionary with entries like 'virtual/path': '/real/path'
57 >
57 >
58 > h = hgweb.hgwebdir("hgweb.config")
58 > h = hgweb.hgwebdir("hgweb.config")
59 > h.run()
59 > h.run()
60 > HGWEBDIR
60 > HGWEBDIR
61
61
62 $ chmod 755 hgwebdir.cgi
62 $ chmod 755 hgwebdir.cgi
63
63
64 $ . "$TESTDIR/cgienv"
64 $ . "$TESTDIR/cgienv"
65 $ python hgweb.cgi > page1
65 $ python hgweb.cgi > page1
66 $ python hgwebdir.cgi > page2
66 $ python hgwebdir.cgi > page2
67
67
68 $ PATH_INFO="/test/"
68 $ PATH_INFO="/test/"
69 $ PATH_TRANSLATED="/var/something/test.cgi"
69 $ PATH_TRANSLATED="/var/something/test.cgi"
70 $ REQUEST_URI="/test/test/"
70 $ REQUEST_URI="/test/test/"
71 $ SCRIPT_URI="http://hg.omnifarious.org/test/test/"
71 $ SCRIPT_URI="http://hg.omnifarious.org/test/test/"
72 $ SCRIPT_URL="/test/test/"
72 $ SCRIPT_URL="/test/test/"
73 $ python hgwebdir.cgi > page3
73 $ python hgwebdir.cgi > page3
74
74
75 $ grep -i error page1 page2 page3
75 $ grep -i error page1 page2 page3
76 [1]
76 [1]
General Comments 0
You need to be logged in to leave comments. Login now