##// END OF EJS Templates
Add --ssh and --remotecmd to push...
mpm@selenic.com -
r961:3e11d503 default
parent child Browse files
Show More
@@ -926,11 +926,16 b' def pull(ui, repo, source="default", **o'
926
926
927 return r
927 return r
928
928
929 def push(ui, repo, dest="default-push", force=False):
929 def push(ui, repo, dest="default-push", force=False, ssh=None, remotecmd=None):
930 """push changes to the specified destination"""
930 """push changes to the specified destination"""
931 dest = ui.expandpath(dest)
931 dest = ui.expandpath(dest)
932 ui.status('pushing to %s\n' % (dest))
932 ui.status('pushing to %s\n' % (dest))
933
933
934 if ssh:
935 ui.setconfig("ui", "ssh", ssh)
936 if remotecmd:
937 ui.setconfig("ui", "remotecmd", remotecmd)
938
934 other = hg.repository(ui, dest)
939 other = hg.repository(ui, dest)
935 r = repo.push(other, force)
940 r = repo.push(other, force)
936 return r
941 return r
@@ -1339,7 +1344,9 b' table = {'
1339 'hg pull [-u] [SOURCE]'),
1344 'hg pull [-u] [SOURCE]'),
1340 "^push":
1345 "^push":
1341 (push,
1346 (push,
1342 [('f', 'force', None, 'force push')],
1347 [('f', 'force', None, 'force push'),
1348 ('e', 'ssh', "", 'ssh command'),
1349 ('', 'remotecmd', "", 'remote hg command')],
1343 'hg push [-f] [DEST]'),
1350 'hg push [-f] [DEST]'),
1344 "rawcommit":
1351 "rawcommit":
1345 (rawcommit,
1352 (rawcommit,
@@ -2106,8 +2106,10 b' class sshrepository(remoterepository):'
2106 if not path:
2106 if not path:
2107 raise RepoError("no remote repository path specified")
2107 raise RepoError("no remote repository path specified")
2108
2108
2109 cmd = "ssh %s 'hg -R %s serve --stdio'"
2109 sshcmd = self.ui.config("ui", "ssh", "ssh")
2110 cmd = cmd % (args, path)
2110 remotecmd = self.ui.config("ui", "remotecmd", "hg")
2111 cmd = "%s %s '%s -R %s serve --stdio'"
2112 cmd = cmd % (sshcmd, args, remotecmd, path)
2111
2113
2112 self.pipeo, self.pipei, self.pipee = os.popen3(cmd)
2114 self.pipeo, self.pipei, self.pipee = os.popen3(cmd)
2113
2115
General Comments 0
You need to be logged in to leave comments. Login now