changeset 48088:4a6fa6b6f079

rhg-cat: fallback in presence of a fileset These are unsupported so far. Differential Revision: https://phab.mercurial-scm.org/D11379
author Raphaël Gomès <rgomes@octobus.net>
date Wed, 01 Sep 2021 17:41:08 +0200
parents 1e00834491a5
children f11f233546ce
files rust/rhg/src/commands/cat.rs tests/test-rhg.t
diffstat 2 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/rust/rhg/src/commands/cat.rs	Wed Sep 01 17:40:25 2021 +0200
+++ b/rust/rhg/src/commands/cat.rs	Wed Sep 01 17:41:08 2021 +0200
@@ -46,6 +46,11 @@
 
     let mut files = vec![];
     for file in file_args.iter() {
+        if file.starts_with("set:") {
+            let message = "fileset";
+            return Err(CommandError::unsupported(message));
+        }
+
         let normalized = cwd.join(&file);
         // TODO: actually normalize `..` path segments etc?
         let dotted = normalized.components().any(|c| c.as_os_str() == "..");
--- a/tests/test-rhg.t	Wed Sep 01 17:40:25 2021 +0200
+++ b/tests/test-rhg.t	Wed Sep 01 17:41:08 2021 +0200
@@ -210,6 +210,11 @@
   unsupported feature: `..` or `.` path segment
   [252]
 
+Fallback with filesets
+  $ $NO_FALLBACK rhg cat "set:c or b"
+  unsupported feature: fileset
+  [252]
+
 Requirements
   $ $NO_FALLBACK rhg debugrequirements
   dotencode