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