##// END OF EJS Templates
ssh: quote remote paths (issue2983)
Mads Kiilerich -
r15581:d8fa35c2 default
parent child Browse files
Show More
@@ -1,225 +1,229 b''
1 # sshrepo.py - ssh repository proxy class for mercurial
1 # sshrepo.py - ssh repository proxy class for mercurial
2 #
2 #
3 # Copyright 2005, 2006 Matt Mackall <mpm@selenic.com>
3 # Copyright 2005, 2006 Matt Mackall <mpm@selenic.com>
4 #
4 #
5 # This software may be used and distributed according to the terms of the
5 # This software may be used and distributed according to the terms of the
6 # GNU General Public License version 2 or any later version.
6 # GNU General Public License version 2 or any later version.
7
7
8 from i18n import _
8 from i18n import _
9 import util, error, wireproto
9 import util, error, wireproto
10
10
11 class remotelock(object):
11 class remotelock(object):
12 def __init__(self, repo):
12 def __init__(self, repo):
13 self.repo = repo
13 self.repo = repo
14 def release(self):
14 def release(self):
15 self.repo.unlock()
15 self.repo.unlock()
16 self.repo = None
16 self.repo = None
17 def __del__(self):
17 def __del__(self):
18 if self.repo:
18 if self.repo:
19 self.release()
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 class sshrepository(wireproto.wirerepository):
25 class sshrepository(wireproto.wirerepository):
22 def __init__(self, ui, path, create=False):
26 def __init__(self, ui, path, create=False):
23 self._url = path
27 self._url = path
24 self.ui = ui
28 self.ui = ui
25
29
26 u = util.url(path, parsequery=False, parsefragment=False)
30 u = util.url(path, parsequery=False, parsefragment=False)
27 if u.scheme != 'ssh' or not u.host or u.path is None:
31 if u.scheme != 'ssh' or not u.host or u.path is None:
28 self._abort(error.RepoError(_("couldn't parse location %s") % path))
32 self._abort(error.RepoError(_("couldn't parse location %s") % path))
29
33
30 self.user = u.user
34 self.user = u.user
31 if u.passwd is not None:
35 if u.passwd is not None:
32 self._abort(error.RepoError(_("password in URL not supported")))
36 self._abort(error.RepoError(_("password in URL not supported")))
33 self.host = u.host
37 self.host = u.host
34 self.port = u.port
38 self.port = u.port
35 self.path = u.path or "."
39 self.path = u.path or "."
36
40
37 sshcmd = self.ui.config("ui", "ssh", "ssh")
41 sshcmd = self.ui.config("ui", "ssh", "ssh")
38 remotecmd = self.ui.config("ui", "remotecmd", "hg")
42 remotecmd = self.ui.config("ui", "remotecmd", "hg")
39
43
40 args = util.sshargs(sshcmd, self.host, self.user, self.port)
44 args = util.sshargs(sshcmd, self.host, self.user, self.port)
41
45
42 if create:
46 if create:
43 cmd = '%s %s "%s init %s"'
47 cmd = '%s %s %s' % (sshcmd, args,
44 cmd = cmd % (sshcmd, args, remotecmd, self.path)
48 util.shellquote("%s init %s" %
45
49 (_serverquote(remotecmd), _serverquote(self.path))))
46 ui.note(_('running %s\n') % cmd)
50 ui.note(_('running %s\n') % cmd)
47 res = util.system(cmd)
51 res = util.system(cmd)
48 if res != 0:
52 if res != 0:
49 self._abort(error.RepoError(_("could not create remote repo")))
53 self._abort(error.RepoError(_("could not create remote repo")))
50
54
51 self.validate_repo(ui, sshcmd, args, remotecmd)
55 self.validate_repo(ui, sshcmd, args, remotecmd)
52
56
53 def url(self):
57 def url(self):
54 return self._url
58 return self._url
55
59
56 def validate_repo(self, ui, sshcmd, args, remotecmd):
60 def validate_repo(self, ui, sshcmd, args, remotecmd):
57 # cleanup up previous run
61 # cleanup up previous run
58 self.cleanup()
62 self.cleanup()
59
63
60 cmd = '%s %s "%s -R %s serve --stdio"'
64 cmd = '%s %s %s' % (sshcmd, args,
61 cmd = cmd % (sshcmd, args, remotecmd, self.path)
65 util.shellquote("%s -R %s serve --stdio" %
62
66 (_serverquote(remotecmd), _serverquote(self.path))))
67 ui.note(_('running %s\n') % cmd)
63 cmd = util.quotecommand(cmd)
68 cmd = util.quotecommand(cmd)
64 ui.note(_('running %s\n') % cmd)
65 self.pipeo, self.pipei, self.pipee = util.popen3(cmd)
69 self.pipeo, self.pipei, self.pipee = util.popen3(cmd)
66
70
67 # skip any noise generated by remote shell
71 # skip any noise generated by remote shell
68 self._callstream("hello")
72 self._callstream("hello")
69 r = self._callstream("between", pairs=("%s-%s" % ("0"*40, "0"*40)))
73 r = self._callstream("between", pairs=("%s-%s" % ("0"*40, "0"*40)))
70 lines = ["", "dummy"]
74 lines = ["", "dummy"]
71 max_noise = 500
75 max_noise = 500
72 while lines[-1] and max_noise:
76 while lines[-1] and max_noise:
73 l = r.readline()
77 l = r.readline()
74 self.readerr()
78 self.readerr()
75 if lines[-1] == "1\n" and l == "\n":
79 if lines[-1] == "1\n" and l == "\n":
76 break
80 break
77 if l:
81 if l:
78 ui.debug("remote: ", l)
82 ui.debug("remote: ", l)
79 lines.append(l)
83 lines.append(l)
80 max_noise -= 1
84 max_noise -= 1
81 else:
85 else:
82 self._abort(error.RepoError(_("no suitable response from remote hg")))
86 self._abort(error.RepoError(_("no suitable response from remote hg")))
83
87
84 self.capabilities = set()
88 self.capabilities = set()
85 for l in reversed(lines):
89 for l in reversed(lines):
86 if l.startswith("capabilities:"):
90 if l.startswith("capabilities:"):
87 self.capabilities.update(l[:-1].split(":")[1].split())
91 self.capabilities.update(l[:-1].split(":")[1].split())
88 break
92 break
89
93
90 def readerr(self):
94 def readerr(self):
91 while True:
95 while True:
92 size = util.fstat(self.pipee).st_size
96 size = util.fstat(self.pipee).st_size
93 if size == 0:
97 if size == 0:
94 break
98 break
95 s = self.pipee.read(size)
99 s = self.pipee.read(size)
96 if not s:
100 if not s:
97 break
101 break
98 for l in s.splitlines():
102 for l in s.splitlines():
99 self.ui.status(_("remote: "), l, '\n')
103 self.ui.status(_("remote: "), l, '\n')
100
104
101 def _abort(self, exception):
105 def _abort(self, exception):
102 self.cleanup()
106 self.cleanup()
103 raise exception
107 raise exception
104
108
105 def cleanup(self):
109 def cleanup(self):
106 try:
110 try:
107 self.pipeo.close()
111 self.pipeo.close()
108 self.pipei.close()
112 self.pipei.close()
109 # read the error descriptor until EOF
113 # read the error descriptor until EOF
110 for l in self.pipee:
114 for l in self.pipee:
111 self.ui.status(_("remote: "), l)
115 self.ui.status(_("remote: "), l)
112 self.pipee.close()
116 self.pipee.close()
113 except:
117 except:
114 pass
118 pass
115
119
116 __del__ = cleanup
120 __del__ = cleanup
117
121
118 def _callstream(self, cmd, **args):
122 def _callstream(self, cmd, **args):
119 self.ui.debug("sending %s command\n" % cmd)
123 self.ui.debug("sending %s command\n" % cmd)
120 self.pipeo.write("%s\n" % cmd)
124 self.pipeo.write("%s\n" % cmd)
121 _func, names = wireproto.commands[cmd]
125 _func, names = wireproto.commands[cmd]
122 keys = names.split()
126 keys = names.split()
123 wireargs = {}
127 wireargs = {}
124 for k in keys:
128 for k in keys:
125 if k == '*':
129 if k == '*':
126 wireargs['*'] = args
130 wireargs['*'] = args
127 break
131 break
128 else:
132 else:
129 wireargs[k] = args[k]
133 wireargs[k] = args[k]
130 del args[k]
134 del args[k]
131 for k, v in sorted(wireargs.iteritems()):
135 for k, v in sorted(wireargs.iteritems()):
132 self.pipeo.write("%s %d\n" % (k, len(v)))
136 self.pipeo.write("%s %d\n" % (k, len(v)))
133 if isinstance(v, dict):
137 if isinstance(v, dict):
134 for dk, dv in v.iteritems():
138 for dk, dv in v.iteritems():
135 self.pipeo.write("%s %d\n" % (dk, len(dv)))
139 self.pipeo.write("%s %d\n" % (dk, len(dv)))
136 self.pipeo.write(dv)
140 self.pipeo.write(dv)
137 else:
141 else:
138 self.pipeo.write(v)
142 self.pipeo.write(v)
139 self.pipeo.flush()
143 self.pipeo.flush()
140
144
141 return self.pipei
145 return self.pipei
142
146
143 def _call(self, cmd, **args):
147 def _call(self, cmd, **args):
144 self._callstream(cmd, **args)
148 self._callstream(cmd, **args)
145 return self._recv()
149 return self._recv()
146
150
147 def _callpush(self, cmd, fp, **args):
151 def _callpush(self, cmd, fp, **args):
148 r = self._call(cmd, **args)
152 r = self._call(cmd, **args)
149 if r:
153 if r:
150 return '', r
154 return '', r
151 while True:
155 while True:
152 d = fp.read(4096)
156 d = fp.read(4096)
153 if not d:
157 if not d:
154 break
158 break
155 self._send(d)
159 self._send(d)
156 self._send("", flush=True)
160 self._send("", flush=True)
157 r = self._recv()
161 r = self._recv()
158 if r:
162 if r:
159 return '', r
163 return '', r
160 return self._recv(), ''
164 return self._recv(), ''
161
165
162 def _decompress(self, stream):
166 def _decompress(self, stream):
163 return stream
167 return stream
164
168
165 def _recv(self):
169 def _recv(self):
166 l = self.pipei.readline()
170 l = self.pipei.readline()
167 if l == '\n':
171 if l == '\n':
168 err = []
172 err = []
169 while True:
173 while True:
170 line = self.pipee.readline()
174 line = self.pipee.readline()
171 if line == '-\n':
175 if line == '-\n':
172 break
176 break
173 err.extend([line])
177 err.extend([line])
174 if len(err) > 0:
178 if len(err) > 0:
175 # strip the trailing newline added to the last line server-side
179 # strip the trailing newline added to the last line server-side
176 err[-1] = err[-1][:-1]
180 err[-1] = err[-1][:-1]
177 self._abort(error.OutOfBandError(*err))
181 self._abort(error.OutOfBandError(*err))
178 self.readerr()
182 self.readerr()
179 try:
183 try:
180 l = int(l)
184 l = int(l)
181 except ValueError:
185 except ValueError:
182 self._abort(error.ResponseError(_("unexpected response:"), l))
186 self._abort(error.ResponseError(_("unexpected response:"), l))
183 return self.pipei.read(l)
187 return self.pipei.read(l)
184
188
185 def _send(self, data, flush=False):
189 def _send(self, data, flush=False):
186 self.pipeo.write("%d\n" % len(data))
190 self.pipeo.write("%d\n" % len(data))
187 if data:
191 if data:
188 self.pipeo.write(data)
192 self.pipeo.write(data)
189 if flush:
193 if flush:
190 self.pipeo.flush()
194 self.pipeo.flush()
191 self.readerr()
195 self.readerr()
192
196
193 def lock(self):
197 def lock(self):
194 self._call("lock")
198 self._call("lock")
195 return remotelock(self)
199 return remotelock(self)
196
200
197 def unlock(self):
201 def unlock(self):
198 self._call("unlock")
202 self._call("unlock")
199
203
200 def addchangegroup(self, cg, source, url, lock=None):
204 def addchangegroup(self, cg, source, url, lock=None):
201 '''Send a changegroup to the remote server. Return an integer
205 '''Send a changegroup to the remote server. Return an integer
202 similar to unbundle(). DEPRECATED, since it requires locking the
206 similar to unbundle(). DEPRECATED, since it requires locking the
203 remote.'''
207 remote.'''
204 d = self._call("addchangegroup")
208 d = self._call("addchangegroup")
205 if d:
209 if d:
206 self._abort(error.RepoError(_("push refused: %s") % d))
210 self._abort(error.RepoError(_("push refused: %s") % d))
207 while True:
211 while True:
208 d = cg.read(4096)
212 d = cg.read(4096)
209 if not d:
213 if not d:
210 break
214 break
211 self.pipeo.write(d)
215 self.pipeo.write(d)
212 self.readerr()
216 self.readerr()
213
217
214 self.pipeo.flush()
218 self.pipeo.flush()
215
219
216 self.readerr()
220 self.readerr()
217 r = self._recv()
221 r = self._recv()
218 if not r:
222 if not r:
219 return 1
223 return 1
220 try:
224 try:
221 return int(r)
225 return int(r)
222 except ValueError:
226 except ValueError:
223 self._abort(error.ResponseError(_("unexpected response:"), r))
227 self._abort(error.ResponseError(_("unexpected response:"), r))
224
228
225 instance = sshrepository
229 instance = sshrepository
@@ -1,196 +1,196 b''
1 $ "$TESTDIR/hghave" no-windows || exit 80
1 $ "$TESTDIR/hghave" no-windows || exit 80
2
2
3 This test tries to exercise the ssh functionality with a dummy script
3 This test tries to exercise the ssh functionality with a dummy script
4
4
5 $ checknewrepo()
5 $ checknewrepo()
6 > {
6 > {
7 > name=$1
7 > name=$1
8 > if [ -d "$name"/.hg/store ]; then
8 > if [ -d "$name"/.hg/store ]; then
9 > echo store created
9 > echo store created
10 > fi
10 > fi
11 > if [ -f "$name"/.hg/00changelog.i ]; then
11 > if [ -f "$name"/.hg/00changelog.i ]; then
12 > echo 00changelog.i created
12 > echo 00changelog.i created
13 > fi
13 > fi
14 > cat "$name"/.hg/requires
14 > cat "$name"/.hg/requires
15 > }
15 > }
16
16
17 creating 'local'
17 creating 'local'
18
18
19 $ hg init local
19 $ hg init local
20 $ checknewrepo local
20 $ checknewrepo local
21 store created
21 store created
22 00changelog.i created
22 00changelog.i created
23 revlogv1
23 revlogv1
24 fncache
24 fncache
25 store
25 store
26 dotencode
26 dotencode
27 $ echo this > local/foo
27 $ echo this > local/foo
28 $ hg ci --cwd local -A -m "init"
28 $ hg ci --cwd local -A -m "init"
29 adding foo
29 adding foo
30
30
31 creating repo with format.usestore=false
31 creating repo with format.usestore=false
32
32
33 $ hg --config format.usestore=false init old
33 $ hg --config format.usestore=false init old
34 $ checknewrepo old
34 $ checknewrepo old
35 revlogv1
35 revlogv1
36
36
37 creating repo with format.usefncache=false
37 creating repo with format.usefncache=false
38
38
39 $ hg --config format.usefncache=false init old2
39 $ hg --config format.usefncache=false init old2
40 $ checknewrepo old2
40 $ checknewrepo old2
41 store created
41 store created
42 00changelog.i created
42 00changelog.i created
43 revlogv1
43 revlogv1
44 store
44 store
45
45
46 creating repo with format.dotencode=false
46 creating repo with format.dotencode=false
47
47
48 $ hg --config format.dotencode=false init old3
48 $ hg --config format.dotencode=false init old3
49 $ checknewrepo old3
49 $ checknewrepo old3
50 store created
50 store created
51 00changelog.i created
51 00changelog.i created
52 revlogv1
52 revlogv1
53 fncache
53 fncache
54 store
54 store
55
55
56 test failure
56 test failure
57
57
58 $ hg init local
58 $ hg init local
59 abort: repository local already exists!
59 abort: repository local already exists!
60 [255]
60 [255]
61
61
62 init+push to remote2
62 init+push to remote2
63
63
64 $ hg init -e "python $TESTDIR/dummyssh" ssh://user@dummy/remote2
64 $ hg init -e "python $TESTDIR/dummyssh" ssh://user@dummy/remote2
65 $ hg incoming -R remote2 local
65 $ hg incoming -R remote2 local
66 comparing with local
66 comparing with local
67 changeset: 0:08b9e9f63b32
67 changeset: 0:08b9e9f63b32
68 tag: tip
68 tag: tip
69 user: test
69 user: test
70 date: Thu Jan 01 00:00:00 1970 +0000
70 date: Thu Jan 01 00:00:00 1970 +0000
71 summary: init
71 summary: init
72
72
73
73
74 $ hg push -R local -e "python $TESTDIR/dummyssh" ssh://user@dummy/remote2
74 $ hg push -R local -e "python $TESTDIR/dummyssh" ssh://user@dummy/remote2
75 pushing to ssh://user@dummy/remote2
75 pushing to ssh://user@dummy/remote2
76 searching for changes
76 searching for changes
77 remote: adding changesets
77 remote: adding changesets
78 remote: adding manifests
78 remote: adding manifests
79 remote: adding file changes
79 remote: adding file changes
80 remote: added 1 changesets with 1 changes to 1 files
80 remote: added 1 changesets with 1 changes to 1 files
81
81
82 clone to remote1
82 clone to remote1
83
83
84 $ hg clone -e "python $TESTDIR/dummyssh" local ssh://user@dummy/remote1
84 $ hg clone -e "python $TESTDIR/dummyssh" local ssh://user@dummy/remote1
85 searching for changes
85 searching for changes
86 remote: adding changesets
86 remote: adding changesets
87 remote: adding manifests
87 remote: adding manifests
88 remote: adding file changes
88 remote: adding file changes
89 remote: added 1 changesets with 1 changes to 1 files
89 remote: added 1 changesets with 1 changes to 1 files
90
90
91 init to existing repo
91 init to existing repo
92
92
93 $ hg init -e "python $TESTDIR/dummyssh" ssh://user@dummy/remote1
93 $ hg init -e "python $TESTDIR/dummyssh" ssh://user@dummy/remote1
94 abort: repository remote1 already exists!
94 abort: repository remote1 already exists!
95 abort: could not create remote repo!
95 abort: could not create remote repo!
96 [255]
96 [255]
97
97
98 clone to existing repo
98 clone to existing repo
99
99
100 $ hg clone -e "python $TESTDIR/dummyssh" local ssh://user@dummy/remote1
100 $ hg clone -e "python $TESTDIR/dummyssh" local ssh://user@dummy/remote1
101 abort: repository remote1 already exists!
101 abort: repository remote1 already exists!
102 abort: could not create remote repo!
102 abort: could not create remote repo!
103 [255]
103 [255]
104
104
105 output of dummyssh
105 output of dummyssh
106
106
107 $ cat dummylog
107 $ cat dummylog
108 Got arguments 1:user@dummy 2:hg init remote2
108 Got arguments 1:user@dummy 2:'hg' init 'remote2'
109 Got arguments 1:user@dummy 2:hg -R remote2 serve --stdio
109 Got arguments 1:user@dummy 2:'hg' -R 'remote2' serve --stdio
110 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
111 Got arguments 1:user@dummy 2:'hg' init 'remote1'
112 Got arguments 1:user@dummy 2:hg -R remote1 serve --stdio
112 Got arguments 1:user@dummy 2:'hg' -R 'remote1' serve --stdio
113 Got arguments 1:user@dummy 2:hg init remote1
113 Got arguments 1:user@dummy 2:'hg' init 'remote1'
114 Got arguments 1:user@dummy 2:hg init remote1
114 Got arguments 1:user@dummy 2:'hg' init 'remote1'
115
115
116 comparing repositories
116 comparing repositories
117
117
118 $ hg tip -q -R local
118 $ hg tip -q -R local
119 0:08b9e9f63b32
119 0:08b9e9f63b32
120 $ hg tip -q -R remote1
120 $ hg tip -q -R remote1
121 0:08b9e9f63b32
121 0:08b9e9f63b32
122 $ hg tip -q -R remote2
122 $ hg tip -q -R remote2
123 0:08b9e9f63b32
123 0:08b9e9f63b32
124
124
125 check names for repositories (clashes with URL schemes, special chars)
125 check names for repositories (clashes with URL schemes, special chars)
126
126
127 $ for i in bundle file hg http https old-http ssh static-http " " "with space"; do
127 $ for i in bundle file hg http https old-http ssh static-http " " "with space"; do
128 > printf "hg init \"$i\"... "
128 > printf "hg init \"$i\"... "
129 > hg init "$i"
129 > hg init "$i"
130 > test -d "$i" -a -d "$i/.hg" && echo "ok" || echo "failed"
130 > test -d "$i" -a -d "$i/.hg" && echo "ok" || echo "failed"
131 > done
131 > done
132 hg init "bundle"... ok
132 hg init "bundle"... ok
133 hg init "file"... ok
133 hg init "file"... ok
134 hg init "hg"... ok
134 hg init "hg"... ok
135 hg init "http"... ok
135 hg init "http"... ok
136 hg init "https"... ok
136 hg init "https"... ok
137 hg init "old-http"... ok
137 hg init "old-http"... ok
138 hg init "ssh"... ok
138 hg init "ssh"... ok
139 hg init "static-http"... ok
139 hg init "static-http"... ok
140 hg init " "... ok
140 hg init " "... ok
141 hg init "with space"... ok
141 hg init "with space"... ok
142
142
143 creating 'local/sub/repo'
143 creating 'local/sub/repo'
144
144
145 $ hg init local/sub/repo
145 $ hg init local/sub/repo
146 $ checknewrepo local/sub/repo
146 $ checknewrepo local/sub/repo
147 store created
147 store created
148 00changelog.i created
148 00changelog.i created
149 revlogv1
149 revlogv1
150 fncache
150 fncache
151 store
151 store
152 dotencode
152 dotencode
153
153
154 prepare test of init of url configured from paths
154 prepare test of init of url configured from paths
155
155
156 $ echo '[paths]' >> $HGRCPATH
156 $ echo '[paths]' >> $HGRCPATH
157 $ echo "somewhere = `pwd`/url from paths" >> $HGRCPATH
157 $ echo "somewhere = `pwd`/url from paths" >> $HGRCPATH
158 $ echo "elsewhere = `pwd`/another paths url" >> $HGRCPATH
158 $ echo "elsewhere = `pwd`/another paths url" >> $HGRCPATH
159
159
160 init should (for consistency with clone) expand the url
160 init should (for consistency with clone) expand the url
161
161
162 $ hg init somewhere
162 $ hg init somewhere
163 $ checknewrepo "url from paths"
163 $ checknewrepo "url from paths"
164 store created
164 store created
165 00changelog.i created
165 00changelog.i created
166 revlogv1
166 revlogv1
167 fncache
167 fncache
168 store
168 store
169 dotencode
169 dotencode
170
170
171 verify that clone also expand urls
171 verify that clone also expand urls
172
172
173 $ hg clone somewhere elsewhere
173 $ hg clone somewhere elsewhere
174 updating to branch default
174 updating to branch default
175 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
175 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
176 $ checknewrepo "another paths url"
176 $ checknewrepo "another paths url"
177 store created
177 store created
178 00changelog.i created
178 00changelog.i created
179 revlogv1
179 revlogv1
180 fncache
180 fncache
181 store
181 store
182 dotencode
182 dotencode
183
183
184 clone bookmarks
184 clone bookmarks
185
185
186 $ hg -R local bookmark test
186 $ hg -R local bookmark test
187 $ hg -R local bookmarks
187 $ hg -R local bookmarks
188 * test 0:08b9e9f63b32
188 * test 0:08b9e9f63b32
189 $ hg clone -e "python $TESTDIR/dummyssh" local ssh://user@dummy/remote-bookmarks
189 $ hg clone -e "python $TESTDIR/dummyssh" local ssh://user@dummy/remote-bookmarks
190 searching for changes
190 searching for changes
191 remote: adding changesets
191 remote: adding changesets
192 remote: adding manifests
192 remote: adding manifests
193 remote: adding file changes
193 remote: adding file changes
194 remote: added 1 changesets with 1 changes to 1 files
194 remote: added 1 changesets with 1 changes to 1 files
195 $ hg -R remote-bookmarks bookmarks
195 $ hg -R remote-bookmarks bookmarks
196 test 0:08b9e9f63b32
196 test 0:08b9e9f63b32
@@ -1,290 +1,301 b''
1
1
2
2
3 This test tries to exercise the ssh functionality with a dummy script
3 This test tries to exercise the ssh functionality with a dummy script
4
4
5 creating 'remote' repo
5 creating 'remote' repo
6
6
7 $ hg init remote
7 $ hg init remote
8 $ cd remote
8 $ cd remote
9 $ echo this > foo
9 $ echo this > foo
10 $ echo this > fooO
10 $ echo this > fooO
11 $ hg ci -A -m "init" foo fooO
11 $ hg ci -A -m "init" foo fooO
12 $ cat <<EOF > .hg/hgrc
12 $ cat <<EOF > .hg/hgrc
13 > [server]
13 > [server]
14 > uncompressed = True
14 > uncompressed = True
15 >
15 >
16 > [hooks]
16 > [hooks]
17 > changegroup = python "$TESTDIR"/printenv.py changegroup-in-remote 0 ../dummylog
17 > changegroup = python "$TESTDIR"/printenv.py changegroup-in-remote 0 ../dummylog
18 > EOF
18 > EOF
19 $ cd ..
19 $ cd ..
20
20
21 repo not found error
21 repo not found error
22
22
23 $ hg clone -e "python $TESTDIR/dummyssh" ssh://user@dummy/nonexistent local
23 $ hg clone -e "python $TESTDIR/dummyssh" ssh://user@dummy/nonexistent local
24 remote: abort: There is no Mercurial repository here (.hg not found)!
24 remote: abort: There is no Mercurial repository here (.hg not found)!
25 abort: no suitable response from remote hg!
25 abort: no suitable response from remote hg!
26 [255]
26 [255]
27
27
28 non-existent absolute path
28 non-existent absolute path
29
29
30 $ hg clone -e "python $TESTDIR/dummyssh" ssh://user@dummy//`pwd`/nonexistent local
30 $ hg clone -e "python $TESTDIR/dummyssh" ssh://user@dummy//`pwd`/nonexistent local
31 remote: abort: There is no Mercurial repository here (.hg not found)!
31 remote: abort: There is no Mercurial repository here (.hg not found)!
32 abort: no suitable response from remote hg!
32 abort: no suitable response from remote hg!
33 [255]
33 [255]
34
34
35 clone remote via stream
35 clone remote via stream
36
36
37 $ hg clone -e "python $TESTDIR/dummyssh" --uncompressed ssh://user@dummy/remote local-stream
37 $ hg clone -e "python $TESTDIR/dummyssh" --uncompressed ssh://user@dummy/remote local-stream
38 streaming all changes
38 streaming all changes
39 4 files to transfer, 392 bytes of data
39 4 files to transfer, 392 bytes of data
40 transferred 392 bytes in * seconds (*/sec) (glob)
40 transferred 392 bytes in * seconds (*/sec) (glob)
41 updating to branch default
41 updating to branch default
42 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
42 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
43 $ cd local-stream
43 $ cd local-stream
44 $ hg verify
44 $ hg verify
45 checking changesets
45 checking changesets
46 checking manifests
46 checking manifests
47 crosschecking files in changesets and manifests
47 crosschecking files in changesets and manifests
48 checking files
48 checking files
49 2 files, 1 changesets, 2 total revisions
49 2 files, 1 changesets, 2 total revisions
50 $ cd ..
50 $ cd ..
51
51
52 clone remote via pull
52 clone remote via pull
53
53
54 $ hg clone -e "python $TESTDIR/dummyssh" ssh://user@dummy/remote local
54 $ hg clone -e "python $TESTDIR/dummyssh" ssh://user@dummy/remote local
55 requesting all changes
55 requesting all changes
56 adding changesets
56 adding changesets
57 adding manifests
57 adding manifests
58 adding file changes
58 adding file changes
59 added 1 changesets with 2 changes to 2 files
59 added 1 changesets with 2 changes to 2 files
60 updating to branch default
60 updating to branch default
61 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
61 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
62
62
63 verify
63 verify
64
64
65 $ cd local
65 $ cd local
66 $ hg verify
66 $ hg verify
67 checking changesets
67 checking changesets
68 checking manifests
68 checking manifests
69 crosschecking files in changesets and manifests
69 crosschecking files in changesets and manifests
70 checking files
70 checking files
71 2 files, 1 changesets, 2 total revisions
71 2 files, 1 changesets, 2 total revisions
72 $ echo '[hooks]' >> .hg/hgrc
72 $ echo '[hooks]' >> .hg/hgrc
73 $ echo 'changegroup = python "$TESTDIR"/printenv.py changegroup-in-local 0 ../dummylog' >> .hg/hgrc
73 $ echo 'changegroup = python "$TESTDIR"/printenv.py changegroup-in-local 0 ../dummylog' >> .hg/hgrc
74
74
75 empty default pull
75 empty default pull
76
76
77 $ hg paths
77 $ hg paths
78 default = ssh://user@dummy/remote
78 default = ssh://user@dummy/remote
79 $ hg pull -e "python $TESTDIR/dummyssh"
79 $ hg pull -e "python $TESTDIR/dummyssh"
80 pulling from ssh://user@dummy/remote
80 pulling from ssh://user@dummy/remote
81 searching for changes
81 searching for changes
82 no changes found
82 no changes found
83
83
84 local change
84 local change
85
85
86 $ echo bleah > foo
86 $ echo bleah > foo
87 $ hg ci -m "add"
87 $ hg ci -m "add"
88
88
89 updating rc
89 updating rc
90
90
91 $ echo "default-push = ssh://user@dummy/remote" >> .hg/hgrc
91 $ echo "default-push = ssh://user@dummy/remote" >> .hg/hgrc
92 $ echo "[ui]" >> .hg/hgrc
92 $ echo "[ui]" >> .hg/hgrc
93 $ echo "ssh = python $TESTDIR/dummyssh" >> .hg/hgrc
93 $ echo "ssh = python $TESTDIR/dummyssh" >> .hg/hgrc
94
94
95 find outgoing
95 find outgoing
96
96
97 $ hg out ssh://user@dummy/remote
97 $ hg out ssh://user@dummy/remote
98 comparing with ssh://user@dummy/remote
98 comparing with ssh://user@dummy/remote
99 searching for changes
99 searching for changes
100 changeset: 1:a28a9d1a809c
100 changeset: 1:a28a9d1a809c
101 tag: tip
101 tag: tip
102 user: test
102 user: test
103 date: Thu Jan 01 00:00:00 1970 +0000
103 date: Thu Jan 01 00:00:00 1970 +0000
104 summary: add
104 summary: add
105
105
106
106
107 find incoming on the remote side
107 find incoming on the remote side
108
108
109 $ hg incoming -R ../remote -e "python $TESTDIR/dummyssh" ssh://user@dummy/local
109 $ hg incoming -R ../remote -e "python $TESTDIR/dummyssh" ssh://user@dummy/local
110 comparing with ssh://user@dummy/local
110 comparing with ssh://user@dummy/local
111 searching for changes
111 searching for changes
112 changeset: 1:a28a9d1a809c
112 changeset: 1:a28a9d1a809c
113 tag: tip
113 tag: tip
114 user: test
114 user: test
115 date: Thu Jan 01 00:00:00 1970 +0000
115 date: Thu Jan 01 00:00:00 1970 +0000
116 summary: add
116 summary: add
117
117
118
118
119 find incoming on the remote side (using absolute path)
119 find incoming on the remote side (using absolute path)
120
120
121 $ hg incoming -R ../remote -e "python $TESTDIR/dummyssh" "ssh://user@dummy/`pwd`"
121 $ hg incoming -R ../remote -e "python $TESTDIR/dummyssh" "ssh://user@dummy/`pwd`"
122 comparing with ssh://user@dummy/$TESTTMP/local
122 comparing with ssh://user@dummy/$TESTTMP/local
123 searching for changes
123 searching for changes
124 changeset: 1:a28a9d1a809c
124 changeset: 1:a28a9d1a809c
125 tag: tip
125 tag: tip
126 user: test
126 user: test
127 date: Thu Jan 01 00:00:00 1970 +0000
127 date: Thu Jan 01 00:00:00 1970 +0000
128 summary: add
128 summary: add
129
129
130
130
131 push
131 push
132
132
133 $ hg push
133 $ hg push
134 pushing to ssh://user@dummy/remote
134 pushing to ssh://user@dummy/remote
135 searching for changes
135 searching for changes
136 remote: adding changesets
136 remote: adding changesets
137 remote: adding manifests
137 remote: adding manifests
138 remote: adding file changes
138 remote: adding file changes
139 remote: added 1 changesets with 1 changes to 1 files
139 remote: added 1 changesets with 1 changes to 1 files
140 $ cd ../remote
140 $ cd ../remote
141
141
142 check remote tip
142 check remote tip
143
143
144 $ hg tip
144 $ hg tip
145 changeset: 1:a28a9d1a809c
145 changeset: 1:a28a9d1a809c
146 tag: tip
146 tag: tip
147 user: test
147 user: test
148 date: Thu Jan 01 00:00:00 1970 +0000
148 date: Thu Jan 01 00:00:00 1970 +0000
149 summary: add
149 summary: add
150
150
151 $ hg verify
151 $ hg verify
152 checking changesets
152 checking changesets
153 checking manifests
153 checking manifests
154 crosschecking files in changesets and manifests
154 crosschecking files in changesets and manifests
155 checking files
155 checking files
156 2 files, 2 changesets, 3 total revisions
156 2 files, 2 changesets, 3 total revisions
157 $ hg cat -r tip foo
157 $ hg cat -r tip foo
158 bleah
158 bleah
159 $ echo z > z
159 $ echo z > z
160 $ hg ci -A -m z z
160 $ hg ci -A -m z z
161 created new head
161 created new head
162
162
163 test pushkeys and bookmarks
163 test pushkeys and bookmarks
164
164
165 $ cd ../local
165 $ cd ../local
166 $ hg debugpushkey --config ui.ssh="python $TESTDIR/dummyssh" ssh://user@dummy/remote namespaces
166 $ hg debugpushkey --config ui.ssh="python $TESTDIR/dummyssh" ssh://user@dummy/remote namespaces
167 bookmarks
167 bookmarks
168 namespaces
168 namespaces
169 $ hg book foo -r 0
169 $ hg book foo -r 0
170 $ hg out -B
170 $ hg out -B
171 comparing with ssh://user@dummy/remote
171 comparing with ssh://user@dummy/remote
172 searching for changed bookmarks
172 searching for changed bookmarks
173 foo 1160648e36ce
173 foo 1160648e36ce
174 $ hg push -B foo
174 $ hg push -B foo
175 pushing to ssh://user@dummy/remote
175 pushing to ssh://user@dummy/remote
176 searching for changes
176 searching for changes
177 no changes found
177 no changes found
178 exporting bookmark foo
178 exporting bookmark foo
179 $ hg debugpushkey --config ui.ssh="python $TESTDIR/dummyssh" ssh://user@dummy/remote bookmarks
179 $ hg debugpushkey --config ui.ssh="python $TESTDIR/dummyssh" ssh://user@dummy/remote bookmarks
180 foo 1160648e36cec0054048a7edc4110c6f84fde594
180 foo 1160648e36cec0054048a7edc4110c6f84fde594
181 $ hg book -f foo
181 $ hg book -f foo
182 $ hg push --traceback
182 $ hg push --traceback
183 pushing to ssh://user@dummy/remote
183 pushing to ssh://user@dummy/remote
184 searching for changes
184 searching for changes
185 no changes found
185 no changes found
186 updating bookmark foo
186 updating bookmark foo
187 $ hg book -d foo
187 $ hg book -d foo
188 $ hg in -B
188 $ hg in -B
189 comparing with ssh://user@dummy/remote
189 comparing with ssh://user@dummy/remote
190 searching for changed bookmarks
190 searching for changed bookmarks
191 foo a28a9d1a809c
191 foo a28a9d1a809c
192 $ hg book -f -r 0 foo
192 $ hg book -f -r 0 foo
193 $ hg pull -B foo
193 $ hg pull -B foo
194 pulling from ssh://user@dummy/remote
194 pulling from ssh://user@dummy/remote
195 no changes found
195 no changes found
196 updating bookmark foo
196 updating bookmark foo
197 importing bookmark foo
197 importing bookmark foo
198 $ hg book -d foo
198 $ hg book -d foo
199 $ hg push -B foo
199 $ hg push -B foo
200 pushing to ssh://user@dummy/remote
200 pushing to ssh://user@dummy/remote
201 searching for changes
201 searching for changes
202 no changes found
202 no changes found
203 deleting remote bookmark foo
203 deleting remote bookmark foo
204
204
205 a bad, evil hook that prints to stdout
205 a bad, evil hook that prints to stdout
206
206
207 $ cat <<EOF > $TESTTMP/badhook
207 $ cat <<EOF > $TESTTMP/badhook
208 > import sys
208 > import sys
209 > sys.stdout.write("KABOOM\n")
209 > sys.stdout.write("KABOOM\n")
210 > EOF
210 > EOF
211
211
212 $ echo '[hooks]' >> ../remote/.hg/hgrc
212 $ echo '[hooks]' >> ../remote/.hg/hgrc
213 $ echo "changegroup.stdout = python $TESTTMP/badhook" >> ../remote/.hg/hgrc
213 $ echo "changegroup.stdout = python $TESTTMP/badhook" >> ../remote/.hg/hgrc
214 $ echo r > r
214 $ echo r > r
215 $ hg ci -A -m z r
215 $ hg ci -A -m z r
216
216
217 push should succeed even though it has an unexpected response
217 push should succeed even though it has an unexpected response
218
218
219 $ hg push
219 $ hg push
220 pushing to ssh://user@dummy/remote
220 pushing to ssh://user@dummy/remote
221 searching for changes
221 searching for changes
222 note: unsynced remote changes!
222 note: unsynced remote changes!
223 remote: adding changesets
223 remote: adding changesets
224 remote: adding manifests
224 remote: adding manifests
225 remote: adding file changes
225 remote: adding file changes
226 remote: added 1 changesets with 1 changes to 1 files
226 remote: added 1 changesets with 1 changes to 1 files
227 remote: KABOOM
227 remote: KABOOM
228 $ hg -R ../remote heads
228 $ hg -R ../remote heads
229 changeset: 3:1383141674ec
229 changeset: 3:1383141674ec
230 tag: tip
230 tag: tip
231 parent: 1:a28a9d1a809c
231 parent: 1:a28a9d1a809c
232 user: test
232 user: test
233 date: Thu Jan 01 00:00:00 1970 +0000
233 date: Thu Jan 01 00:00:00 1970 +0000
234 summary: z
234 summary: z
235
235
236 changeset: 2:6c0482d977a3
236 changeset: 2:6c0482d977a3
237 parent: 0:1160648e36ce
237 parent: 0:1160648e36ce
238 user: test
238 user: test
239 date: Thu Jan 01 00:00:00 1970 +0000
239 date: Thu Jan 01 00:00:00 1970 +0000
240 summary: z
240 summary: z
241
241
242
242
243 clone bookmarks
243 clone bookmarks
244
244
245 $ hg -R ../remote bookmark test
245 $ hg -R ../remote bookmark test
246 $ hg -R ../remote bookmarks
246 $ hg -R ../remote bookmarks
247 * test 2:6c0482d977a3
247 * test 2:6c0482d977a3
248 $ hg clone -e "python $TESTDIR/dummyssh" ssh://user@dummy/remote local-bookmarks
248 $ hg clone -e "python $TESTDIR/dummyssh" ssh://user@dummy/remote local-bookmarks
249 requesting all changes
249 requesting all changes
250 adding changesets
250 adding changesets
251 adding manifests
251 adding manifests
252 adding file changes
252 adding file changes
253 added 4 changesets with 5 changes to 4 files (+1 heads)
253 added 4 changesets with 5 changes to 4 files (+1 heads)
254 updating to branch default
254 updating to branch default
255 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
255 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
256 $ hg -R local-bookmarks bookmarks
256 $ hg -R local-bookmarks bookmarks
257 test 2:6c0482d977a3
257 test 2:6c0482d977a3
258
258
259 passwords in ssh urls are not supported
259 passwords in ssh urls are not supported
260 (we use a glob here because different Python versions give different
260 (we use a glob here because different Python versions give different
261 results here)
261 results here)
262
262
263 $ hg push ssh://user:erroneouspwd@dummy/remote
263 $ hg push ssh://user:erroneouspwd@dummy/remote
264 pushing to ssh://user:*@dummy/remote (glob)
264 pushing to ssh://user:*@dummy/remote (glob)
265 abort: password in URL not supported!
265 abort: password in URL not supported!
266 [255]
266 [255]
267
267
268 $ cd ..
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 $ cat dummylog
277 $ cat dummylog
270 Got arguments 1:user@dummy 2:hg -R nonexistent serve --stdio
278 Got arguments 1:user@dummy 2:'hg' -R 'nonexistent' serve --stdio
271 Got arguments 1:user@dummy 2:hg -R /$TESTTMP/nonexistent serve --stdio
279 Got arguments 1:user@dummy 2:'hg' -R '/$TESTTMP/nonexistent' serve --stdio
272 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
280 Got arguments 1:user@dummy 2:'hg' -R 'remote' serve --stdio
273 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
281 Got arguments 1:user@dummy 2:'hg' -R 'remote' serve --stdio
274 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
282 Got arguments 1:user@dummy 2:'hg' -R 'remote' serve --stdio
275 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
283 Got arguments 1:user@dummy 2:'hg' -R 'remote' serve --stdio
276 Got arguments 1:user@dummy 2:hg -R local serve --stdio
284 Got arguments 1:user@dummy 2:'hg' -R 'local' serve --stdio
277 Got arguments 1:user@dummy 2:hg -R $TESTTMP/local serve --stdio
285 Got arguments 1:user@dummy 2:'hg' -R '$TESTTMP/local' serve --stdio
278 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
286 Got arguments 1:user@dummy 2:'hg' -R 'remote' serve --stdio
279 changegroup-in-remote hook: HG_NODE=a28a9d1a809cab7d4e2fde4bee738a9ede948b60 HG_SOURCE=serve HG_URL=remote:ssh:127.0.0.1
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
288 Got arguments 1:user@dummy 2:'hg' -R 'remote' serve --stdio
281 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
289 Got arguments 1:user@dummy 2:'hg' -R 'remote' serve --stdio
282 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
290 Got arguments 1:user@dummy 2:'hg' -R 'remote' serve --stdio
283 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
291 Got arguments 1:user@dummy 2:'hg' -R 'remote' serve --stdio
284 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
292 Got arguments 1:user@dummy 2:'hg' -R 'remote' serve --stdio
285 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
293 Got arguments 1:user@dummy 2:'hg' -R 'remote' serve --stdio
286 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
294 Got arguments 1:user@dummy 2:'hg' -R 'remote' serve --stdio
287 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
295 Got arguments 1:user@dummy 2:'hg' -R 'remote' serve --stdio
288 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
296 Got arguments 1:user@dummy 2:'hg' -R 'remote' serve --stdio
289 changegroup-in-remote hook: HG_NODE=1383141674ec756a6056f6a9097618482fe0f4a6 HG_SOURCE=serve HG_URL=remote:ssh:127.0.0.1
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
@@ -1,105 +1,105 b''
1 $ "$TESTDIR/hghave" serve || exit 80
1 $ "$TESTDIR/hghave" serve || exit 80
2
2
3 Preparing the subrepository 'sub'
3 Preparing the subrepository 'sub'
4
4
5 $ hg init sub
5 $ hg init sub
6 $ echo sub > sub/sub
6 $ echo sub > sub/sub
7 $ hg add -R sub
7 $ hg add -R sub
8 adding sub/sub (glob)
8 adding sub/sub (glob)
9 $ hg commit -R sub -m "sub import"
9 $ hg commit -R sub -m "sub import"
10
10
11 Preparing the 'main' repo which depends on the subrepo 'sub'
11 Preparing the 'main' repo which depends on the subrepo 'sub'
12
12
13 $ hg init main
13 $ hg init main
14 $ echo main > main/main
14 $ echo main > main/main
15 $ echo "sub = ../sub" > main/.hgsub
15 $ echo "sub = ../sub" > main/.hgsub
16 $ hg clone sub main/sub
16 $ hg clone sub main/sub
17 updating to branch default
17 updating to branch default
18 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
18 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
19 $ hg add -R main
19 $ hg add -R main
20 adding main/.hgsub (glob)
20 adding main/.hgsub (glob)
21 adding main/main (glob)
21 adding main/main (glob)
22 $ hg commit -R main -m "main import"
22 $ hg commit -R main -m "main import"
23 committing subrepository sub
23 committing subrepository sub
24
24
25 Cleaning both repositories, just as a clone -U
25 Cleaning both repositories, just as a clone -U
26
26
27 $ hg up -C -R sub null
27 $ hg up -C -R sub null
28 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
28 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
29 $ hg up -C -R main null
29 $ hg up -C -R main null
30 0 files updated, 0 files merged, 3 files removed, 0 files unresolved
30 0 files updated, 0 files merged, 3 files removed, 0 files unresolved
31 $ rm -rf main/sub
31 $ rm -rf main/sub
32
32
33 Serving them both using hgweb
33 Serving them both using hgweb
34
34
35 $ printf '[paths]\n/main = main\nsub = sub\n' > webdir.conf
35 $ printf '[paths]\n/main = main\nsub = sub\n' > webdir.conf
36 $ hg serve --webdir-conf webdir.conf -a localhost -p $HGPORT \
36 $ hg serve --webdir-conf webdir.conf -a localhost -p $HGPORT \
37 > -A /dev/null -E /dev/null --pid-file hg.pid -d
37 > -A /dev/null -E /dev/null --pid-file hg.pid -d
38 $ cat hg.pid >> $DAEMON_PIDS
38 $ cat hg.pid >> $DAEMON_PIDS
39
39
40 Clone main from hgweb
40 Clone main from hgweb
41
41
42 $ hg clone "http://localhost:$HGPORT/main" cloned
42 $ hg clone "http://localhost:$HGPORT/main" cloned
43 requesting all changes
43 requesting all changes
44 adding changesets
44 adding changesets
45 adding manifests
45 adding manifests
46 adding file changes
46 adding file changes
47 added 1 changesets with 3 changes to 3 files
47 added 1 changesets with 3 changes to 3 files
48 updating to branch default
48 updating to branch default
49 cloning subrepo sub from http://localhost:$HGPORT/sub
49 cloning subrepo sub from http://localhost:$HGPORT/sub
50 requesting all changes
50 requesting all changes
51 adding changesets
51 adding changesets
52 adding manifests
52 adding manifests
53 adding file changes
53 adding file changes
54 added 1 changesets with 1 changes to 1 files
54 added 1 changesets with 1 changes to 1 files
55 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
55 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
56
56
57 Checking cloned repo ids
57 Checking cloned repo ids
58
58
59 $ hg id -R cloned
59 $ hg id -R cloned
60 fdfeeb3e979e tip
60 fdfeeb3e979e tip
61 $ hg id -R cloned/sub
61 $ hg id -R cloned/sub
62 863c1745b441 tip
62 863c1745b441 tip
63
63
64 subrepo debug for 'main' clone
64 subrepo debug for 'main' clone
65
65
66 $ hg debugsub -R cloned
66 $ hg debugsub -R cloned
67 path sub
67 path sub
68 source ../sub
68 source ../sub
69 revision 863c1745b441bd97a8c4a096e87793073f4fb215
69 revision 863c1745b441bd97a8c4a096e87793073f4fb215
70
70
71 $ "$TESTDIR/killdaemons.py"
71 $ "$TESTDIR/killdaemons.py"
72
72
73 subrepo paths with ssh urls
73 subrepo paths with ssh urls
74
74
75 $ cp $TESTDIR/dummyssh $BINDIR/ssh
75 $ cp $TESTDIR/dummyssh $BINDIR/ssh
76
76
77 $ hg clone ssh://user@dummy/cloned sshclone
77 $ hg clone ssh://user@dummy/cloned sshclone
78 requesting all changes
78 requesting all changes
79 adding changesets
79 adding changesets
80 adding manifests
80 adding manifests
81 adding file changes
81 adding file changes
82 added 1 changesets with 3 changes to 3 files
82 added 1 changesets with 3 changes to 3 files
83 updating to branch default
83 updating to branch default
84 cloning subrepo sub from ssh://user@dummy/sub
84 cloning subrepo sub from ssh://user@dummy/sub
85 requesting all changes
85 requesting all changes
86 adding changesets
86 adding changesets
87 adding manifests
87 adding manifests
88 adding file changes
88 adding file changes
89 added 1 changesets with 1 changes to 1 files
89 added 1 changesets with 1 changes to 1 files
90 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
90 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
91
91
92 $ hg -R sshclone push ssh://user@dummy/$TESTTMP/cloned
92 $ hg -R sshclone push ssh://user@dummy/$TESTTMP/cloned
93 pushing to ssh://user@dummy/$TESTTMP/cloned
93 pushing to ssh://user@dummy/$TESTTMP/cloned
94 pushing subrepo sub to ssh://user@dummy/$TESTTMP/sub
94 pushing subrepo sub to ssh://user@dummy/$TESTTMP/sub
95 searching for changes
95 searching for changes
96 no changes found
96 no changes found
97 searching for changes
97 searching for changes
98 no changes found
98 no changes found
99
99
100 $ cat dummylog
100 $ cat dummylog
101 Got arguments 1:user@dummy 2:hg -R cloned 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
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
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
104 Got arguments 1:user@dummy 2:'hg' -R '$TESTTMP/sub' serve --stdio
105 $ rm $BINDIR/ssh
105 $ rm $BINDIR/ssh
General Comments 0
You need to be logged in to leave comments. Login now