This instance will be upgraded to Heptapod 0.31.0rc on 2022-05-19 at 11:00 UTC+2 (a few minutes of down time)

Commit b48afc2e authored by Antoine Cezar's avatar Antoine Cezar
Browse files

rhg: add harness tests for rhg files

Differential Revision: https://phab.mercurial-scm.org/D8873
parent 072c4731414a
Pipeline #10042 failed with stage
in 25 minutes and 31 seconds
#require rust
Define an rhg function that will only run if rhg exists
$ rhg() {
> if [ -f "$RUNTESTDIR/../rust/target/debug/rhg" ]; then
> "$RUNTESTDIR/../rust/target/debug/rhg" "$@"
......@@ -8,5 +9,7 @@
> exit 80
> fi
> }
Unimplemented command
$ rhg unimplemented-command
[252]
......@@ -11,5 +14,7 @@
$ rhg unimplemented-command
[252]
Finding root
$ rhg root
abort: no repository found in '$TESTTMP' (.hg not found)!
[255]
......@@ -13,7 +18,8 @@
$ rhg root
abort: no repository found in '$TESTTMP' (.hg not found)!
[255]
$ hg init repository
$ cd repository
$ rhg root
$TESTTMP/repository
......@@ -16,7 +22,9 @@
$ hg init repository
$ cd repository
$ rhg root
$TESTTMP/repository
Unwritable file descriptor
$ rhg root > /dev/full
abort: No space left on device (os error 28)
[255]
......@@ -20,7 +28,9 @@
$ rhg root > /dev/full
abort: No space left on device (os error 28)
[255]
Deleted repository
$ rm -rf `pwd`
$ rhg root
abort: error getting current working directory: $ENOENT$
[255]
......@@ -23,4 +33,32 @@
$ rm -rf `pwd`
$ rhg root
abort: error getting current working directory: $ENOENT$
[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
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment