Patchwork D11379: rhg-cat: fallback in presence of a fileset

login
register
mail settings
Submitter phabricator
Date Sept. 1, 2021, 4:43 p.m.
Message ID <differential-rev-PHID-DREV-6icpajwfp4y5t6mkrywc-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/49696/
State New
Headers show

Comments

phabricator - Sept. 1, 2021, 4:43 p.m.
Alphare created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  These are unsupported so far.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  rust/rhg/src/commands/cat.rs
  tests/test-rhg.t

CHANGE DETAILS




To: Alphare, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/tests/test-rhg.t b/tests/test-rhg.t
--- a/tests/test-rhg.t
+++ b/tests/test-rhg.t
@@ -207,6 +207,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
diff --git a/rust/rhg/src/commands/cat.rs b/rust/rhg/src/commands/cat.rs
--- a/rust/rhg/src/commands/cat.rs
+++ b/rust/rhg/src/commands/cat.rs
@@ -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() == "..");