Show More
@@ -18,6 +18,10 b' class remotelock(object):' | |||
|
18 | 18 | if self.repo: |
|
19 | 19 | self.release() |
|
20 | 20 | |
|
21 | def _serverquote(s): | |
|
22 | '''quote a string for the remote shell ... which we assume is sh''' | |
|
23 | return "'%s'" % s.replace("'", "'\\''") | |
|
24 | ||
|
21 | 25 | class sshrepository(wireproto.wirerepository): |
|
22 | 26 | def __init__(self, ui, path, create=False): |
|
23 | 27 | self._url = path |
@@ -40,9 +44,9 b' class sshrepository(wireproto.wirereposi' | |||
|
40 | 44 | args = util.sshargs(sshcmd, self.host, self.user, self.port) |
|
41 | 45 | |
|
42 | 46 | if create: |
|
43 |
cmd = '%s %s |
|
|
44 | cmd = cmd % (sshcmd, args, remotecmd, self.path) | |
|
45 | ||
|
47 | cmd = '%s %s %s' % (sshcmd, args, | |
|
48 | util.shellquote("%s init %s" % | |
|
49 | (_serverquote(remotecmd), _serverquote(self.path)))) | |
|
46 | 50 | ui.note(_('running %s\n') % cmd) |
|
47 | 51 | res = util.system(cmd) |
|
48 | 52 | if res != 0: |
@@ -57,11 +61,11 b' class sshrepository(wireproto.wirereposi' | |||
|
57 | 61 | # cleanup up previous run |
|
58 | 62 | self.cleanup() |
|
59 | 63 | |
|
60 |
cmd = '%s %s |
|
|
61 | cmd = cmd % (sshcmd, args, remotecmd, self.path) | |
|
62 | ||
|
64 | cmd = '%s %s %s' % (sshcmd, args, | |
|
65 | util.shellquote("%s -R %s serve --stdio" % | |
|
66 | (_serverquote(remotecmd), _serverquote(self.path)))) | |
|
67 | ui.note(_('running %s\n') % cmd) | |
|
63 | 68 | cmd = util.quotecommand(cmd) |
|
64 | ui.note(_('running %s\n') % cmd) | |
|
65 | 69 | self.pipeo, self.pipei, self.pipee = util.popen3(cmd) |
|
66 | 70 | |
|
67 | 71 | # skip any noise generated by remote shell |
@@ -105,13 +105,13 b' clone to existing repo' | |||
|
105 | 105 | output of dummyssh |
|
106 | 106 | |
|
107 | 107 | $ cat dummylog |
|
108 | Got arguments 1:user@dummy 2:hg init remote2 | |
|
109 | Got arguments 1:user@dummy 2:hg -R remote2 serve --stdio | |
|
110 | Got arguments 1:user@dummy 2:hg -R remote2 serve --stdio | |
|
111 | Got arguments 1:user@dummy 2:hg init remote1 | |
|
112 | Got arguments 1:user@dummy 2:hg -R remote1 serve --stdio | |
|
113 | Got arguments 1:user@dummy 2:hg init remote1 | |
|
114 | Got arguments 1:user@dummy 2:hg init remote1 | |
|
108 | Got arguments 1:user@dummy 2:'hg' init 'remote2' | |
|
109 | Got arguments 1:user@dummy 2:'hg' -R 'remote2' serve --stdio | |
|
110 | Got arguments 1:user@dummy 2:'hg' -R 'remote2' serve --stdio | |
|
111 | Got arguments 1:user@dummy 2:'hg' init 'remote1' | |
|
112 | Got arguments 1:user@dummy 2:'hg' -R 'remote1' serve --stdio | |
|
113 | Got arguments 1:user@dummy 2:'hg' init 'remote1' | |
|
114 | Got arguments 1:user@dummy 2:'hg' init 'remote1' | |
|
115 | 115 | |
|
116 | 116 | comparing repositories |
|
117 | 117 |
@@ -266,25 +266,36 b' results here)' | |||
|
266 | 266 | [255] |
|
267 | 267 | |
|
268 | 268 | $ cd .. |
|
269 | ||
|
270 | Test remote paths with spaces (issue2983): | |
|
271 | ||
|
272 | $ hg init --ssh "python $TESTDIR/dummyssh" "ssh://user@dummy/a repo" | |
|
273 | $ hg -R 'a repo' tag tag | |
|
274 | $ hg id --ssh "python $TESTDIR/dummyssh" "ssh://user@dummy/a repo" | |
|
275 | 3fb238f49e8c | |
|
276 | ||
|
269 | 277 | $ cat dummylog |
|
270 | Got arguments 1:user@dummy 2:hg -R nonexistent serve --stdio | |
|
271 | Got arguments 1:user@dummy 2:hg -R /$TESTTMP/nonexistent serve --stdio | |
|
272 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio | |
|
273 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio | |
|
274 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio | |
|
275 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio | |
|
276 | Got arguments 1:user@dummy 2:hg -R local serve --stdio | |
|
277 | Got arguments 1:user@dummy 2:hg -R $TESTTMP/local serve --stdio | |
|
278 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio | |
|
278 | Got arguments 1:user@dummy 2:'hg' -R 'nonexistent' serve --stdio | |
|
279 | Got arguments 1:user@dummy 2:'hg' -R '/$TESTTMP/nonexistent' serve --stdio | |
|
280 | Got arguments 1:user@dummy 2:'hg' -R 'remote' serve --stdio | |
|
281 | Got arguments 1:user@dummy 2:'hg' -R 'remote' serve --stdio | |
|
282 | Got arguments 1:user@dummy 2:'hg' -R 'remote' serve --stdio | |
|
283 | Got arguments 1:user@dummy 2:'hg' -R 'remote' serve --stdio | |
|
284 | Got arguments 1:user@dummy 2:'hg' -R 'local' serve --stdio | |
|
285 | Got arguments 1:user@dummy 2:'hg' -R '$TESTTMP/local' serve --stdio | |
|
286 | Got arguments 1:user@dummy 2:'hg' -R 'remote' serve --stdio | |
|
279 | 287 | changegroup-in-remote hook: HG_NODE=a28a9d1a809cab7d4e2fde4bee738a9ede948b60 HG_SOURCE=serve HG_URL=remote:ssh:127.0.0.1 |
|
280 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio | |
|
281 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio | |
|
282 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio | |
|
283 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio | |
|
284 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio | |
|
285 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio | |
|
286 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio | |
|
287 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio | |
|
288 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio | |
|
288 | Got arguments 1:user@dummy 2:'hg' -R 'remote' serve --stdio | |
|
289 | Got arguments 1:user@dummy 2:'hg' -R 'remote' serve --stdio | |
|
290 | Got arguments 1:user@dummy 2:'hg' -R 'remote' serve --stdio | |
|
291 | Got arguments 1:user@dummy 2:'hg' -R 'remote' serve --stdio | |
|
292 | Got arguments 1:user@dummy 2:'hg' -R 'remote' serve --stdio | |
|
293 | Got arguments 1:user@dummy 2:'hg' -R 'remote' serve --stdio | |
|
294 | Got arguments 1:user@dummy 2:'hg' -R 'remote' serve --stdio | |
|
295 | Got arguments 1:user@dummy 2:'hg' -R 'remote' serve --stdio | |
|
296 | Got arguments 1:user@dummy 2:'hg' -R 'remote' serve --stdio | |
|
289 | 297 | changegroup-in-remote hook: HG_NODE=1383141674ec756a6056f6a9097618482fe0f4a6 HG_SOURCE=serve HG_URL=remote:ssh:127.0.0.1 |
|
290 | Got arguments 1:user@dummy 2:hg -R remote serve --stdio | |
|
298 | Got arguments 1:user@dummy 2:'hg' -R 'remote' serve --stdio | |
|
299 | Got arguments 1:user@dummy 2:'hg' init 'a repo' | |
|
300 | Got arguments 1:user@dummy 2:'hg' -R 'a repo' serve --stdio | |
|
301 | Got arguments 1:user@dummy 2:'hg' -R 'a repo' serve --stdio |
@@ -98,8 +98,8 b' subrepo paths with ssh urls' | |||
|
98 | 98 | no changes found |
|
99 | 99 | |
|
100 | 100 | $ cat dummylog |
|
101 | Got arguments 1:user@dummy 2:hg -R cloned serve --stdio | |
|
102 | Got arguments 1:user@dummy 2:hg -R sub serve --stdio | |
|
103 | Got arguments 1:user@dummy 2:hg -R $TESTTMP/cloned serve --stdio | |
|
104 | Got arguments 1:user@dummy 2:hg -R $TESTTMP/sub serve --stdio | |
|
101 | Got arguments 1:user@dummy 2:'hg' -R 'cloned' serve --stdio | |
|
102 | Got arguments 1:user@dummy 2:'hg' -R 'sub' serve --stdio | |
|
103 | Got arguments 1:user@dummy 2:'hg' -R '$TESTTMP/cloned' serve --stdio | |
|
104 | Got arguments 1:user@dummy 2:'hg' -R '$TESTTMP/sub' serve --stdio | |
|
105 | 105 | $ rm $BINDIR/ssh |
General Comments 0
You need to be logged in to leave comments.
Login now