[Updated] [++ ] D8873: rhg: add harness tests for rhg files

acezar (Antoine Cezar) phabricator at mercurial-scm.org
Tue Aug 4 08:28:07 UTC 2020


acezar updated this revision to Diff 22243.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D8873?vs=22238&id=22243

BRANCH
  default

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D8873/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D8873

AFFECTED FILES
  tests/test-rhg.t

CHANGE DETAILS

diff --git a/tests/test-rhg.t b/tests/test-rhg.t
--- a/tests/test-rhg.t
+++ b/tests/test-rhg.t
@@ -1,5 +1,6 @@
 #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,19 +9,56 @@
   >   exit 80
   > fi
   > }
+
+Unimplemented command
   $ rhg unimplemented-command
   [252]
+
+Finding root
   $ rhg root
   abort: no repository found in '$TESTTMP' (.hg not found)!
   [255]
+
   $ 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]
+
+Deleted repository
   $ 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



To: acezar, #hg-reviewers, Alphare
Cc: Alphare, mercurial-patches
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-patches/attachments/20200804/3a4fbe0c/attachment-0002.html>


More information about the Mercurial-patches mailing list