rhg-cat: fallback in presence of a fileset
authorRaphaël Gomès <rgomes@octobus.net>
Wed, 01 Sep 2021 17:41:08 +0200
changeset 48074 4a6fa6b6f079
parent 48073 1e00834491a5
child 48075 f11f233546ce
rhg-cat: fallback in presence of a fileset These are unsupported so far. Differential Revision: https://phab.mercurial-scm.org/D11379
rust/rhg/src/commands/cat.rs
tests/test-rhg.t
--- 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