Mercurial > hg
diff tests/test-rhg.t @ 48072:d919b0ca8449
rhg: add support for calling `rhg cat` without a revision
Turns out the necessary pieces were there already.
Like the Python implementation, we default to the first parent of the dirstate.
Differential Revision: https://phab.mercurial-scm.org/D11377
author | Raphaël Gomès <rgomes@octobus.net> |
---|---|
date | Wed, 01 Sep 2021 16:13:25 +0200 |
parents | 8c29af0f6d6e |
children | 1e00834491a5 |
line wrap: on
line diff
--- a/tests/test-rhg.t Thu Sep 30 17:34:28 2021 +0200 +++ b/tests/test-rhg.t Wed Sep 01 16:13:25 2021 +0200 @@ -138,40 +138,65 @@ $ echo "original content" > original $ hg add original $ hg commit -m "add original" original +Without `--rev` + $ $NO_FALLBACK rhg cat original + original content +With `--rev` $ $NO_FALLBACK rhg cat -r 0 original original content Cat copied file should not display copy metadata $ hg copy original copy_of_original $ hg commit -m "add copy of original" + $ $NO_FALLBACK rhg cat original + original content $ $NO_FALLBACK rhg cat -r 1 copy_of_original original content + Fallback to Python - $ $NO_FALLBACK rhg cat original - unsupported feature: `rhg cat` without `--rev` / `-r` + $ $NO_FALLBACK rhg cat original --exclude="*.rs" + unsupported feature: error: Found argument '--exclude' which wasn't expected, or isn't valid in this context + + USAGE: + rhg cat [OPTIONS] <FILE>... + + For more information try --help + [252] - $ rhg cat original + $ rhg cat original --exclude="*.rs" original content $ FALLBACK_EXE="$RHG_FALLBACK_EXECUTABLE" $ unset RHG_FALLBACK_EXECUTABLE - $ rhg cat original + $ rhg cat original --exclude="*.rs" abort: 'rhg.on-unsupported=fallback' without 'rhg.fallback-executable' set. [255] $ RHG_FALLBACK_EXECUTABLE="$FALLBACK_EXE" $ export RHG_FALLBACK_EXECUTABLE - $ rhg cat original --config rhg.fallback-executable=false + $ rhg cat original --exclude="*.rs" --config rhg.fallback-executable=false [1] - $ rhg cat original --config rhg.fallback-executable=hg-non-existent + $ rhg cat original --exclude="*.rs" --config rhg.fallback-executable=hg-non-existent tried to fall back to a 'hg-non-existent' sub-process but got error $ENOENT$ - unsupported feature: `rhg cat` without `--rev` / `-r` + unsupported feature: error: Found argument '--exclude' which wasn't expected, or isn't valid in this context + + USAGE: + rhg cat [OPTIONS] <FILE>... + + For more information try --help + [252] - $ rhg cat original --config rhg.fallback-executable=rhg + $ rhg cat original --exclude="*.rs" --config rhg.fallback-executable=rhg Blocking recursive fallback. The 'rhg.fallback-executable = rhg' config points to `rhg` itself. - unsupported feature: `rhg cat` without `--rev` / `-r` + unsupported feature: error: Found argument '--exclude' which wasn't expected, or isn't valid in this context + + USAGE: + rhg cat [OPTIONS] <FILE>... + + For more information try --help + [252] Requirements