clarified signature;
authorwenzelm
Wed, 18 Dec 2019 16:31:42 +0100
changeset 71310 fd644fb7871b
parent 71309 072e585ba238
child 71311 e169a04e4d3b
clarified signature;
src/Pure/Tools/phabricator.scala
--- a/src/Pure/Tools/phabricator.scala	Wed Dec 18 16:22:10 2019 +0100
+++ b/src/Pure/Tools/phabricator.scala	Wed Dec 18 16:31:42 2019 +0100
@@ -914,7 +914,7 @@
       short_name: String = "",  // unique name
       description: String = "",
       public: Boolean = false,
-      vcs: API.VCS.Value = API.VCS.hg): String =
+      vcs: API.VCS.Value = API.VCS.hg): API.Repository =
     {
       require(name.nonEmpty)
 
@@ -928,14 +928,16 @@
          else API.edits("view", user_phid) ::: API.edits("policy.push", user_phid)) :::
         API.edits("status", "active")
 
-      val repo_phid =
+      val phid =
         execute("diffusion.repository.edit", params = JSON.Object("transactions" -> transactions))
           .get_value(JSON.value(_, "object", JSON.string(_, "phid")))
 
-      execute("diffusion.looksoon",
-        params = JSON.Object("repositories" -> List(repo_phid))).get
+      execute("diffusion.looksoon", params = JSON.Object("repositories" -> List(phid))).get
 
-      repo_phid
+      get_repositories(phid = phid) match {
+        case List(repo) => repo
+        case _ => error("Failed to access new repository: " + quote(phid))
+      }
     }
   }