Mercurial > hg
comparison tests/test-rhg.t @ 45437:e339693addc0
rhg: add harness tests for rhg files
Differential Revision: https://phab.mercurial-scm.org/D8873
author | Antoine Cezar <antoine.cezar@octobus.net> |
---|---|
date | Mon, 03 Aug 2020 11:55:59 +0200 |
parents | 18f8d3b31baa |
children | a6a000ab135b |
comparison
equal
deleted
inserted
replaced
45436:1b3197047f5c | 45437:e339693addc0 |
---|---|
1 #require rust | 1 #require rust |
2 | 2 |
3 Define an rhg function that will only run if rhg exists | |
3 $ rhg() { | 4 $ rhg() { |
4 > if [ -f "$RUNTESTDIR/../rust/target/debug/rhg" ]; then | 5 > if [ -f "$RUNTESTDIR/../rust/target/debug/rhg" ]; then |
5 > "$RUNTESTDIR/../rust/target/debug/rhg" "$@" | 6 > "$RUNTESTDIR/../rust/target/debug/rhg" "$@" |
6 > else | 7 > else |
7 > echo "skipped: Cannot find rhg. Try to run cargo build in rust/rhg." | 8 > echo "skipped: Cannot find rhg. Try to run cargo build in rust/rhg." |
8 > exit 80 | 9 > exit 80 |
9 > fi | 10 > fi |
10 > } | 11 > } |
12 | |
13 Unimplemented command | |
11 $ rhg unimplemented-command | 14 $ rhg unimplemented-command |
12 [252] | 15 [252] |
16 | |
17 Finding root | |
13 $ rhg root | 18 $ rhg root |
14 abort: no repository found in '$TESTTMP' (.hg not found)! | 19 abort: no repository found in '$TESTTMP' (.hg not found)! |
15 [255] | 20 [255] |
21 | |
16 $ hg init repository | 22 $ hg init repository |
17 $ cd repository | 23 $ cd repository |
18 $ rhg root | 24 $ rhg root |
19 $TESTTMP/repository | 25 $TESTTMP/repository |
26 | |
27 Unwritable file descriptor | |
20 $ rhg root > /dev/full | 28 $ rhg root > /dev/full |
21 abort: No space left on device (os error 28) | 29 abort: No space left on device (os error 28) |
22 [255] | 30 [255] |
31 | |
32 Deleted repository | |
23 $ rm -rf `pwd` | 33 $ rm -rf `pwd` |
24 $ rhg root | 34 $ rhg root |
25 abort: error getting current working directory: $ENOENT$ | 35 abort: error getting current working directory: $ENOENT$ |
26 [255] | 36 [255] |
37 | |
38 Listing tracked files | |
39 $ cd $TESTTMP | |
40 $ hg init repository | |
41 $ cd repository | |
42 $ for i in 1 2 3; do | |
43 > echo $i >> file$i | |
44 > hg add file$i | |
45 > done | |
46 > hg commit -m "commit $i" -q | |
47 | |
48 Listing tracked files from root | |
49 $ rhg files | |
50 file1 | |
51 file2 | |
52 file3 | |
53 | |
54 Listing tracked files from subdirectory | |
55 $ mkdir -p path/to/directory | |
56 $ cd path/to/directory | |
57 $ rhg files | |
58 ../../../file1 | |
59 ../../../file2 | |
60 ../../../file3 | |
61 | |
62 Listing tracked files through broken pipe | |
63 $ rhg files | head -n 1 | |
64 ../../../file1 |