Alphare created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  We do not handle subrepos yet, the addition of the support for `-r .` will
  break if we don't fall back.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  rust/rhg/src/main.rs
  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
@@ -367,3 +367,12 @@
   $ cat .hg/blackbox.log.1
   ????/??/?? ??:??:??.??? * @d3873e73d99ef67873dac33fbcc66268d5d2b6f4 (*)> 
(rust) files (glob)
 
+Subrepos are not supported
+
+  $ touch .hgsub
+  $ $NO_FALLBACK rhg files
+  unsupported feature: subrepos (.hgsub is present)
+  [252]
+  $ rhg files
+  a
+  $ rm .hgsub
diff --git a/rust/rhg/src/main.rs b/rust/rhg/src/main.rs
--- a/rust/rhg/src/main.rs
+++ b/rust/rhg/src/main.rs
@@ -98,6 +98,15 @@
         config,
         repo,
     };
+
+    if let Ok(repo) = repo {
+        // We don't support subrepos, fallback if the subrepos file is present
+        if repo.working_directory_vfs().join(".hgsub").exists() {
+            let msg = "subrepos (.hgsub is present)";
+            return Err(CommandError::unsupported(msg));
+        }
+    }
+
     let blackbox = blackbox::Blackbox::new(&invocation, process_start_time)?;
     blackbox.log_command_start();
     let result = run(&invocation);



To: Alphare, #hg-reviewers
Cc: mercurial-patches, mercurial-devel
_______________________________________________
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Reply via email to