Details
Details
- Reviewers
Alphare pulkit - Group Reviewers
hg-reviewers - Commits
- rHGe339693addc0: rhg: add harness tests for rhg files
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Branch
- default
- Lint
No Linters Available - Unit
No Unit Test Coverage
( )
Alphare | |
pulkit |
hg-reviewers |
No Linters Available |
No Unit Test Coverage |
Path | Packages | |||
---|---|---|---|---|
M | tests/test-rhg.t (38 lines) |
Commit | Parents | Author | Summary | Date |
---|---|---|---|---|
3a24a3b9cb11 | 13c1aae1f185 | Antoine Cezar | Aug 3 2020, 5:55 AM |
Status | Author | Revision | |
---|---|---|---|
Closed | acezar | ||
Closed | acezar | ||
Closed | acezar | ||
Closed | acezar | D9049 hg-core: add path_encode | |
Closed | acezar | ||
Closed | acezar | ||
Closed | acezar | ||
Closed | acezar | ||
Closed | acezar | ||
Closed | acezar | ||
Closed | acezar | ||
Closed | acezar | ||
Closed | acezar | D8962 rhg: Add debug timing | |
Closed | acezar | ||
Closed | acezar | ||
Closed | acezar | ||
Closed | acezar | ||
Closed | acezar | ||
Closed | acezar | ||
Closed | acezar | ||
Closed | acezar | ||
Closed | acezar | ||
Closed | acezar | ||
Closed | acezar | ||
Closed | acezar | ||
Closed | acezar | ||
Closed | acezar | ||
Closed | acezar | ||
Closed | acezar | ||
Closed | acezar | ||
Closed | acezar | ||
Closed | acezar | ||
Closed | acezar | ||
Closed | acezar | ||
Closed | acezar |
#require rust | #require rust | ||||
Define an rhg function that will only run if rhg exists | |||||
$ rhg() { | $ rhg() { | ||||
> if [ -f "$RUNTESTDIR/../rust/target/debug/rhg" ]; then | > if [ -f "$RUNTESTDIR/../rust/target/debug/rhg" ]; then | ||||
> "$RUNTESTDIR/../rust/target/debug/rhg" "$@" | > "$RUNTESTDIR/../rust/target/debug/rhg" "$@" | ||||
> else | > else | ||||
> echo "skipped: Cannot find rhg. Try to run cargo build in rust/rhg." | > echo "skipped: Cannot find rhg. Try to run cargo build in rust/rhg." | ||||
> exit 80 | > exit 80 | ||||
> fi | > fi | ||||
> } | > } | ||||
Unimplemented command | |||||
$ rhg unimplemented-command | $ rhg unimplemented-command | ||||
[252] | [252] | ||||
Finding root | |||||
$ rhg root | $ rhg root | ||||
abort: no repository found in '$TESTTMP' (.hg not found)! | abort: no repository found in '$TESTTMP' (.hg not found)! | ||||
[255] | [255] | ||||
$ hg init repository | $ hg init repository | ||||
$ cd repository | $ cd repository | ||||
$ rhg root | $ rhg root | ||||
$TESTTMP/repository | $TESTTMP/repository | ||||
Unwritable file descriptor | |||||
$ rhg root > /dev/full | $ rhg root > /dev/full | ||||
abort: No space left on device (os error 28) | abort: No space left on device (os error 28) | ||||
[255] | [255] | ||||
Deleted repository | |||||
$ rm -rf `pwd` | $ rm -rf `pwd` | ||||
$ rhg root | $ rhg root | ||||
abort: error getting current working directory: $ENOENT$ | abort: error getting current working directory: $ENOENT$ | ||||
[255] | [255] | ||||
Listing tracked files | |||||
$ cd $TESTTMP | |||||
$ hg init repository | |||||
$ cd repository | |||||
$ for i in 1 2 3; do | |||||
> echo $i >> file$i | |||||
> hg add file$i | |||||
> done | |||||
> hg commit -m "commit $i" -q | |||||
Listing tracked files from root | |||||
$ rhg files | |||||
file1 | |||||
file2 | |||||
file3 | |||||
Listing tracked files from subdirectory | |||||
$ mkdir -p path/to/directory | |||||
$ cd path/to/directory | |||||
$ rhg files | |||||
../../../file1 | |||||
../../../file2 | |||||
../../../file3 | |||||
Listing tracked files through broken pipe | |||||
$ rhg files | head -n 1 | |||||
../../../file1 |