src/Pure/General/mercurial.scala
changeset 66558 37b16f8af351
parent 66105 8889aad1ff92
child 66569 1a475e59c70f
--- a/src/Pure/General/mercurial.scala	Wed Aug 30 20:50:45 2017 +0200
+++ b/src/Pure/General/mercurial.scala	Wed Aug 30 22:48:50 2017 +0200
@@ -29,7 +29,15 @@
   /* repository access */
 
   def is_repository(root: Path, ssh: Option[SSH.Session] = None): Boolean =
-    new Repository(root, ssh).command("root").ok
+  {
+    val root_hg = root + Path.explode(".hg")
+    val root_hg_present =
+      ssh match {
+        case None => root_hg.is_dir
+        case Some(ssh) => ssh.is_dir(root_hg)
+      }
+    root_hg_present && new Repository(root, ssh).command("root").ok
+  }
 
   def repository(root: Path, ssh: Option[SSH.Session] = None): Repository =
   {