equal
deleted
inserted
replaced
925 |
925 |
926 final class API private(ssh_user: String, ssh_host: String, ssh_port: Int) |
926 final class API private(ssh_user: String, ssh_host: String, ssh_port: Int) |
927 { |
927 { |
928 /* connection */ |
928 /* connection */ |
929 |
929 |
930 require(ssh_host.nonEmpty && ssh_port >= 0) |
930 require(ssh_host.nonEmpty && ssh_port >= 0, "bad ssh host or port") |
931 |
931 |
932 private def ssh_user_prefix: String = SSH.user_prefix(ssh_user) |
932 private def ssh_user_prefix: String = SSH.user_prefix(ssh_user) |
933 private def ssh_port_suffix: String = SSH.port_suffix(ssh_port) |
933 private def ssh_port_suffix: String = SSH.port_suffix(ssh_port) |
934 |
934 |
935 override def toString: String = ssh_user_prefix + ssh_host + ssh_port_suffix |
935 override def toString: String = ssh_user_prefix + ssh_host + ssh_port_suffix |
1058 short_name: String = "", // unique name |
1058 short_name: String = "", // unique name |
1059 description: String = "", |
1059 description: String = "", |
1060 public: Boolean = false, |
1060 public: Boolean = false, |
1061 vcs: API.VCS.Value = API.VCS.hg): API.Repository = |
1061 vcs: API.VCS.Value = API.VCS.hg): API.Repository = |
1062 { |
1062 { |
1063 require(name.nonEmpty) |
1063 require(name.nonEmpty, "bad repository name") |
1064 |
1064 |
1065 val transactions = |
1065 val transactions = |
1066 API.edits("vcs", vcs.toString) ::: |
1066 API.edits("vcs", vcs.toString) ::: |
1067 API.edits("name", name) ::: |
1067 API.edits("name", name) ::: |
1068 API.opt_edits("callsign", proper_string(callsign)) ::: |
1068 API.opt_edits("callsign", proper_string(callsign)) ::: |