##// END OF EJS Templates
Allow using a ssh repository without a path....
Thomas Arendsen Hein -
r1069:4337cd84 default
parent child Browse files
Show More
@@ -2157,26 +2157,22 b' class sshrepository(remoterepository):'
2157 2157 self.url = path
2158 2158 self.ui = ui
2159 2159
2160 m = re.match(r'ssh://(([^@]+)@)?([^:/]+)(:(\d+))?(/(.*))', path)
2160 m = re.match(r'ssh://(([^@]+)@)?([^:/]+)(:(\d+))?(/(.*))?', path)
2161 2161 if not m:
2162 2162 raise RepoError("couldn't parse destination %s" % path)
2163 2163
2164 2164 self.user = m.group(2)
2165 2165 self.host = m.group(3)
2166 2166 self.port = m.group(5)
2167 self.path = m.group(7)
2167 self.path = m.group(7) or "."
2168 2168
2169 2169 args = self.user and ("%s@%s" % (self.user, self.host)) or self.host
2170 2170 args = self.port and ("%s -p %s") % (args, self.port) or args
2171 path = self.path or ""
2172
2173 if not path:
2174 raise RepoError("no remote repository path specified")
2175 2171
2176 2172 sshcmd = self.ui.config("ui", "ssh", "ssh")
2177 2173 remotecmd = self.ui.config("ui", "remotecmd", "hg")
2178 2174 cmd = "%s %s '%s -R %s serve --stdio'"
2179 cmd = cmd % (sshcmd, args, remotecmd, path)
2175 cmd = cmd % (sshcmd, args, remotecmd, self.path)
2180 2176
2181 2177 self.pipeo, self.pipei, self.pipee = os.popen3(cmd)
2182 2178
General Comments 0
You need to be logged in to leave comments. Login now