##// END OF EJS Templates
tests: reproduce the nullrev bug in an end-to-end test
Arseniy Alekseyev -
r51877:2dcb6a6c stable
parent child Browse files
Show More
@@ -1,420 +1,429 b''
1 1 #require rhg
2 2
3 3 $ NO_FALLBACK="env RHG_ON_UNSUPPORTED=abort"
4 4
5 5 Unimplemented command
6 6 $ $NO_FALLBACK rhg unimplemented-command
7 7 unsupported feature: error: The subcommand 'unimplemented-command' wasn't recognized
8 8
9 9 Usage: rhg [OPTIONS] <COMMAND>
10 10
11 11 For more information try '--help'
12 12
13 13 [252]
14 14 $ rhg unimplemented-command --config rhg.on-unsupported=abort-silent
15 15 [252]
16 16
17 17 Finding root
18 18 $ $NO_FALLBACK rhg root
19 19 abort: no repository found in '$TESTTMP' (.hg not found)!
20 20 [255]
21 21
22 22 $ hg init repository
23 23 $ cd repository
24 24 $ $NO_FALLBACK rhg root
25 25 $TESTTMP/repository
26 26
27 27 Reading and setting configuration
28 28 $ echo "[ui]" >> $HGRCPATH
29 29 $ echo "username = user1" >> $HGRCPATH
30 $ echo "[extensions]" >> $HGRCPATH
31 $ echo "sparse =" >> $HGRCPATH
30 32 $ $NO_FALLBACK rhg config ui.username
31 33 user1
32 34 $ echo "[ui]" >> .hg/hgrc
33 35 $ echo "username = user2" >> .hg/hgrc
34 36 $ $NO_FALLBACK rhg config ui.username
35 37 user2
36 38 $ $NO_FALLBACK rhg --config ui.username=user3 config ui.username
37 39 user3
38 40
39 41 Unwritable file descriptor
40 42 $ $NO_FALLBACK rhg root > /dev/full
41 43 abort: No space left on device (os error 28)
42 44 [255]
43 45
44 46 Deleted repository
45 47 $ rm -rf `pwd`
46 48 $ $NO_FALLBACK rhg root
47 49 abort: error getting current working directory: $ENOENT$
48 50 [255]
49 51
50 52 Listing tracked files
51 53 $ cd $TESTTMP
52 54 $ hg init repository
53 55 $ cd repository
54 56 $ for i in 1 2 3; do
55 57 > echo $i >> file$i
56 58 > hg add file$i
57 59 > done
58 60 > hg commit -m "commit $i" -q
59 61
60 62 Listing tracked files from root
61 63 $ $NO_FALLBACK rhg files
62 64 file1
63 65 file2
64 66 file3
65 67
66 68 Listing tracked files from subdirectory
67 69 $ mkdir -p path/to/directory
68 70 $ cd path/to/directory
69 71 $ $NO_FALLBACK rhg files
70 72 ../../../file1
71 73 ../../../file2
72 74 ../../../file3
73 75
74 76 $ $NO_FALLBACK rhg files --config ui.relative-paths=legacy
75 77 ../../../file1
76 78 ../../../file2
77 79 ../../../file3
78 80
79 81 $ $NO_FALLBACK rhg files --config ui.relative-paths=false
80 82 file1
81 83 file2
82 84 file3
83 85
84 86 $ $NO_FALLBACK rhg files --config ui.relative-paths=true
85 87 ../../../file1
86 88 ../../../file2
87 89 ../../../file3
88 90
89 91 Listing tracked files through broken pipe
90 92 $ $NO_FALLBACK rhg files | head -n 1
91 93 ../../../file1
92 94
93 95 Debuging data in inline index
94 96 $ cd $TESTTMP
95 97 $ rm -rf repository
96 98 $ hg init repository
97 99 $ cd repository
98 100 $ for i in 1 2 3 4 5 6; do
99 101 > echo $i >> file-$i
100 102 > hg add file-$i
101 103 > hg commit -m "Commit $i" -q
102 104 > done
103 105 $ $NO_FALLBACK rhg debugdata -c 2
104 106 8d0267cb034247ebfa5ee58ce59e22e57a492297
105 107 test
106 108 0 0
107 109 file-3
108 110
109 111 Commit 3 (no-eol)
110 112 $ $NO_FALLBACK rhg debugdata -m 2
111 113 file-1\x00b8e02f6433738021a065f94175c7cd23db5f05be (esc)
112 114 file-2\x005d9299349fc01ddd25d0070d149b124d8f10411e (esc)
113 115 file-3\x002661d26c649684b482d10f91960cc3db683c38b4 (esc)
114 116
115 117 Debuging with full node id
116 118 $ $NO_FALLBACK rhg debugdata -c `hg log -r 0 -T '{node}'`
117 119 d1d1c679d3053e8926061b6f45ca52009f011e3f
118 120 test
119 121 0 0
120 122 file-1
121 123
122 124 Commit 1 (no-eol)
123 125
124 126 Specifying revisions by changeset ID
125 127 $ hg log -T '{node}\n'
126 128 c6ad58c44207b6ff8a4fbbca7045a5edaa7e908b
127 129 d654274993d0149eecc3cc03214f598320211900
128 130 f646af7e96481d3a5470b695cf30ad8e3ab6c575
129 131 cf8b83f14ead62b374b6e91a0e9303b85dfd9ed7
130 132 91c6f6e73e39318534dc415ea4e8a09c99cd74d6
131 133 6ae9681c6d30389694d8701faf24b583cf3ccafe
132 134 $ $NO_FALLBACK rhg files -r cf8b83
133 135 file-1
134 136 file-2
135 137 file-3
136 138 $ $NO_FALLBACK rhg cat -r cf8b83 file-2
137 139 2
138 140 $ $NO_FALLBACK rhg cat --rev cf8b83 file-2
139 141 2
140 142 $ $NO_FALLBACK rhg cat -r c file-2
141 143 abort: ambiguous revision identifier: c
142 144 [255]
143 145 $ $NO_FALLBACK rhg cat -r d file-2
144 146 2
145 147 $ $NO_FALLBACK rhg cat -r 0000 file-2
146 148 file-2: no such file in rev 000000000000
147 149 [1]
148 150
149 151 Cat files
150 152 $ cd $TESTTMP
151 153 $ rm -rf repository
152 154 $ hg init repository
153 155 $ cd repository
154 156 $ echo "original content" > original
155 157 $ hg add original
156 158 $ hg commit -m "add original" original
157 159 Without `--rev`
158 160 $ $NO_FALLBACK rhg cat original
159 161 original content
160 162 With `--rev`
161 163 $ $NO_FALLBACK rhg cat -r 0 original
162 164 original content
163 165 Cat copied file should not display copy metadata
164 166 $ hg copy original copy_of_original
165 167 $ hg commit -m "add copy of original"
166 168 $ $NO_FALLBACK rhg cat original
167 169 original content
168 170 $ $NO_FALLBACK rhg cat -r 1 copy_of_original
169 171 original content
170 172
171 173
172 174 Fallback to Python
173 175 $ $NO_FALLBACK rhg cat original --exclude="*.rs"
174 176 unsupported feature: error: Found argument '--exclude' which wasn't expected, or isn't valid in this context
175 177
176 178 If you tried to supply '--exclude' as a value rather than a flag, use '-- --exclude'
177 179
178 180 Usage: rhg cat <FILE>...
179 181
180 182 For more information try '--help'
181 183
182 184 [252]
183 185 $ rhg cat original --exclude="*.rs"
184 186 original content
185 187
186 188 Check that `fallback-immediately` overrides `$NO_FALLBACK`
187 189 $ $NO_FALLBACK rhg cat original --exclude="*.rs" --config rhg.fallback-immediately=1
188 190 original content
189 191
190 192 $ (unset RHG_FALLBACK_EXECUTABLE; rhg cat original --exclude="*.rs")
191 193 abort: 'rhg.on-unsupported=fallback' without 'rhg.fallback-executable' set.
192 194 [255]
193 195
194 196 $ (unset RHG_FALLBACK_EXECUTABLE; rhg cat original)
195 197 original content
196 198
197 199 $ rhg cat original --exclude="*.rs" --config rhg.fallback-executable=false
198 200 [1]
199 201
200 202 $ rhg cat original --exclude="*.rs" --config rhg.fallback-executable=hg-non-existent
201 203 abort: invalid fallback 'hg-non-existent': cannot find binary path
202 204 [253]
203 205
204 206 $ rhg cat original --exclude="*.rs" --config rhg.fallback-executable=rhg
205 207 Blocking recursive fallback. The 'rhg.fallback-executable = rhg' config points to `rhg` itself.
206 208 unsupported feature: error: Found argument '--exclude' which wasn't expected, or isn't valid in this context
207 209
208 210 If you tried to supply '--exclude' as a value rather than a flag, use '-- --exclude'
209 211
210 212 Usage: rhg cat <FILE>...
211 213
212 214 For more information try '--help'
213 215
214 216 [252]
215 217
216 218 Fallback with shell path segments
217 219 $ $NO_FALLBACK rhg cat .
218 220 unsupported feature: `..` or `.` path segment
219 221 [252]
220 222 $ $NO_FALLBACK rhg cat ..
221 223 unsupported feature: `..` or `.` path segment
222 224 [252]
223 225 $ $NO_FALLBACK rhg cat ../..
224 226 unsupported feature: `..` or `.` path segment
225 227 [252]
226 228
227 229 Fallback with filesets
228 230 $ $NO_FALLBACK rhg cat "set:c or b"
229 231 unsupported feature: fileset
230 232 [252]
231 233
232 234 Fallback with generic hooks
233 235 $ $NO_FALLBACK rhg cat original --config hooks.pre-cat=something
234 236 unsupported feature: pre-cat hook defined
235 237 [252]
236 238
237 239 $ $NO_FALLBACK rhg cat original --config hooks.post-cat=something
238 240 unsupported feature: post-cat hook defined
239 241 [252]
240 242
241 243 $ $NO_FALLBACK rhg cat original --config hooks.fail-cat=something
242 244 unsupported feature: fail-cat hook defined
243 245 [252]
244 246
245 247 Fallback with [defaults]
246 248 $ $NO_FALLBACK rhg cat original --config "defaults.cat=-r null"
247 249 unsupported feature: `defaults` config set
248 250 [252]
249 251
250 252
251 253 Requirements
252 254 $ $NO_FALLBACK rhg debugrequirements
253 255 dotencode
254 256 fncache
255 257 generaldelta
256 258 persistent-nodemap
257 259 revlog-compression-zstd (zstd !)
258 260 revlogv1
259 261 share-safe
260 262 sparserevlog
261 263 store
262 264
263 265 $ echo indoor-pool >> .hg/requires
264 266 $ $NO_FALLBACK rhg files
265 267 unsupported feature: repository requires feature unknown to this Mercurial: indoor-pool
266 268 [252]
267 269
268 270 $ $NO_FALLBACK rhg cat -r 1 copy_of_original
269 271 unsupported feature: repository requires feature unknown to this Mercurial: indoor-pool
270 272 [252]
271 273
272 274 $ $NO_FALLBACK rhg debugrequirements
273 275 unsupported feature: repository requires feature unknown to this Mercurial: indoor-pool
274 276 [252]
275 277
276 278 $ echo -e '\xFF' >> .hg/requires
277 279 $ $NO_FALLBACK rhg debugrequirements
278 280 abort: parse error in 'requires' file
279 281 [255]
280 282
281 283 Persistent nodemap
282 284 $ cd $TESTTMP
283 285 $ rm -rf repository
284 286 $ hg --config format.use-persistent-nodemap=no init repository
285 287 $ cd repository
286 288 $ $NO_FALLBACK rhg debugrequirements | grep nodemap
287 289 [1]
288 290 $ hg debugbuilddag .+5000 --overwritten-file --config "storage.revlog.nodemap.mode=warn"
289 291 $ hg id -r tip
290 292 c3ae8dec9fad tip
291 293 $ ls .hg/store/00changelog*
292 294 .hg/store/00changelog.d
293 295 .hg/store/00changelog.i
294 296 $ $NO_FALLBACK rhg files -r c3ae8dec9fad
295 297 of
296 298
297 299 $ cd $TESTTMP
298 300 $ rm -rf repository
299 301 $ hg --config format.use-persistent-nodemap=True init repository
300 302 $ cd repository
301 303 $ $NO_FALLBACK rhg debugrequirements | grep nodemap
302 304 persistent-nodemap
303 305 $ hg debugbuilddag .+5000 --overwritten-file --config "storage.revlog.nodemap.mode=warn"
304 306 $ hg id -r tip
305 307 c3ae8dec9fad tip
306 308 $ ls .hg/store/00changelog*
307 309 .hg/store/00changelog-*.nd (glob)
308 310 .hg/store/00changelog.d
309 311 .hg/store/00changelog.i
310 312 .hg/store/00changelog.n
311 313
314 Rhg status on a sparse repo with nodemap (this specific combination used to crash in 6.5.2)
315
316 $ hg debugsparse -X excluded-dir
317 $ $NO_FALLBACK rhg status
318 abort: dirstate points to non-existent parent node
319 [255]
320
312 321 Specifying revisions by changeset ID
313 322 $ $NO_FALLBACK rhg files -r c3ae8dec9fad
314 323 of
315 324 $ $NO_FALLBACK rhg cat -r c3ae8dec9fad of
316 325 r5000
317 326
318 327 Crate a shared repository
319 328
320 329 $ echo "[extensions]" >> $HGRCPATH
321 330 $ echo "share = " >> $HGRCPATH
322 331
323 332 $ cd $TESTTMP
324 333 $ hg init repo1
325 334 $ echo a > repo1/a
326 335 $ hg -R repo1 commit -A -m'init'
327 336 adding a
328 337
329 338 $ hg share repo1 repo2
330 339 updating working directory
331 340 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
332 341
333 342 And check that basic rhg commands work with sharing
334 343
335 344 $ $NO_FALLBACK rhg files -R repo2
336 345 repo2/a
337 346 $ $NO_FALLBACK rhg -R repo2 cat -r 0 repo2/a
338 347 a
339 348
340 349 Same with relative sharing
341 350
342 351 $ hg share repo2 repo3 --relative
343 352 updating working directory
344 353 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
345 354
346 355 $ $NO_FALLBACK rhg files -R repo3
347 356 repo3/a
348 357 $ $NO_FALLBACK rhg -R repo3 cat -r 0 repo3/a
349 358 a
350 359
351 360 Same with share-safe
352 361
353 362 $ echo "[format]" >> $HGRCPATH
354 363 $ echo "use-share-safe = True" >> $HGRCPATH
355 364
356 365 $ cd $TESTTMP
357 366 $ hg init repo4
358 367 $ cd repo4
359 368 $ echo a > a
360 369 $ hg commit -A -m'init'
361 370 adding a
362 371
363 372 $ cd ..
364 373 $ hg share repo4 repo5
365 374 updating working directory
366 375 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
367 376
368 377 And check that basic rhg commands work with sharing
369 378
370 379 $ cd repo5
371 380 $ $NO_FALLBACK rhg files
372 381 a
373 382 $ $NO_FALLBACK rhg cat -r 0 a
374 383 a
375 384
376 385 The blackbox extension is supported
377 386
378 387 $ echo "[extensions]" >> $HGRCPATH
379 388 $ echo "blackbox =" >> $HGRCPATH
380 389 $ echo "[blackbox]" >> $HGRCPATH
381 390 $ echo "maxsize = 1" >> $HGRCPATH
382 391 $ $NO_FALLBACK rhg files > /dev/null
383 392 $ cat .hg/blackbox.log
384 393 ????-??-?? ??:??:??.??? * @d3873e73d99ef67873dac33fbcc66268d5d2b6f4 (*)> (rust) files exited 0 after * seconds (glob)
385 394 $ cat .hg/blackbox.log.1
386 395 ????-??-?? ??:??:??.??? * @d3873e73d99ef67873dac33fbcc66268d5d2b6f4 (*)> (rust) files (glob)
387 396
388 397 Subrepos are not supported
389 398
390 399 $ touch .hgsub
391 400 $ $NO_FALLBACK rhg files
392 401 unsupported feature: subrepos (.hgsub is present)
393 402 [252]
394 403 $ rhg files
395 404 a
396 405 $ rm .hgsub
397 406
398 407 The `:required` extension suboptions are correctly ignored
399 408
400 409 $ echo "[extensions]" >> $HGRCPATH
401 410 $ echo "blackbox:required = yes" >> $HGRCPATH
402 411 $ rhg files
403 412 a
404 413 $ echo "*:required = yes" >> $HGRCPATH
405 414 $ rhg files
406 415 a
407 416
408 417 We can ignore all extensions at once
409 418
410 419 $ echo "[extensions]" >> $HGRCPATH
411 420 $ echo "thisextensionbetternotexist=" >> $HGRCPATH
412 421 $ echo "thisextensionbetternotexisteither=" >> $HGRCPATH
413 422 $ $NO_FALLBACK rhg files
414 423 unsupported feature: extensions: thisextensionbetternotexist, thisextensionbetternotexisteither (consider adding them to 'rhg.ignored-extensions' config)
415 424 [252]
416 425
417 426 $ echo "[rhg]" >> $HGRCPATH
418 427 $ echo "ignored-extensions=*" >> $HGRCPATH
419 428 $ $NO_FALLBACK rhg files
420 429 a
General Comments 0
You need to be logged in to leave comments. Login now