# # # patch "std_hooks.lua" # from [476117cb5843a576bc2cfb7f989eba32fd0524c4] # to [8b8346d7daed249ce06343071caf597162a37e80] # ============================================================ --- std_hooks.lua 476117cb5843a576bc2cfb7f989eba32fd0524c4 +++ std_hooks.lua 8b8346d7daed249ce06343071caf597162a37e80 @@ -946,28 +946,56 @@ function get_netsync_connect_command(uri argv = { } end - if argv then + if uri["scheme"] == "ssh+ux" + and uri["host"] + and uri["path"] then - table.insert(argv, get_mtn_command(uri["host"])) + argv = { "ssh" } + if uri["user"] then + table.insert(argv, "-l") + table.insert(argv, uri["user"]) + end + if uri["port"] then + table.insert(argv, "-p") + table.insert(argv, uri["port"]) + end - if args["debug"] then - table.insert(argv, "--debug") - else - table.insert(argv, "--quiet") + -- ssh://host/~/dir/file.mtn or + -- ssh://host/~user/dir/file.mtn should be home-relative + if string.find(uri["path"], "^/~") then + uri["path"] = string.sub(uri["path"], 2) end - table.insert(argv, "--db") - table.insert(argv, uri["path"]) - table.insert(argv, "serve") - table.insert(argv, "--stdio") - table.insert(argv, "--no-transport-auth") + table.insert(argv, uri["host"]) + table.insert(argv, get_remote_unix_socket_command(uri["host"])) + table.insert(argv, "-") + table.insert(argv, "UNIX-CONNECT:" .. uri["path"]) + else + -- start remote monotone process + if argv then + table.insert(argv, get_mtn_command(uri["host"])) + + if args["debug"] then + table.insert(argv, "--debug") + else + table.insert(argv, "--quiet") + end + + table.insert(argv, "--db") + table.insert(argv, uri["path"]) + table.insert(argv, "serve") + table.insert(argv, "--stdio") + table.insert(argv, "--no-transport-auth") + + end end return argv end function use_transport_auth(uri) if uri["scheme"] == "ssh" + or uri["scheme"] == "ssh+ux" or uri["scheme"] == "file" then return false else @@ -978,3 +1006,8 @@ end function get_mtn_command(host) return "mtn" end + +function get_remote_unix_socket_command(host) + return "socat" +end +