##// END OF EJS Templates
clone: do not make streaming default. add --stream option instead.
Vadim Gelfer -
r2613:479e26af default
parent child Browse files
Show More
@@ -959,6 +959,7 b' def clone(ui, source, dest=None, **opts)'
959 959 ui.setconfig_remoteopts(**opts)
960 960 hg.clone(ui, ui.expandpath(source), dest,
961 961 pull=opts['pull'],
962 stream=opts['stream'],
962 963 rev=opts['rev'],
963 964 update=not opts['noupdate'])
964 965
@@ -2850,6 +2851,7 b' table = {'
2850 2851 ('r', 'rev', [],
2851 2852 _('a changeset you would like to have after cloning')),
2852 2853 ('', 'pull', None, _('use pull protocol to copy metadata')),
2854 ('', 'stream', None, _('use streaming protocol (fast over LAN)')),
2853 2855 ('e', 'ssh', '', _('specify ssh command to use')),
2854 2856 ('', 'remotecmd', '',
2855 2857 _('specify hg command to run on the remote side'))],
@@ -74,7 +74,8 b' def repository(ui, path=None, create=0):'
74 74 scheme)
75 75 return ctor(ui, path)
76 76
77 def clone(ui, source, dest=None, pull=False, rev=None, update=True):
77 def clone(ui, source, dest=None, pull=False, rev=None, update=True,
78 stream=False):
78 79 """Make a copy of an existing repository.
79 80
80 81 Create a copy of an existing repository in a new directory. The
@@ -96,6 +97,8 b' def clone(ui, source, dest=None, pull=Fa'
96 97
97 98 pull: always pull from source repository, even in local case
98 99
100 stream: stream from repository (fast over LAN, slow over WAN)
101
99 102 rev: revision to clone up to (implies pull=True)
100 103
101 104 update: update working directory after clone completes, if
@@ -179,7 +182,7 b' def clone(ui, source, dest=None, pull=Fa'
179 182 revs = [src_repo.lookup(r) for r in rev]
180 183
181 184 if dest_repo.local():
182 dest_repo.clone(src_repo, heads=revs, pull=pull)
185 dest_repo.clone(src_repo, heads=revs, stream=stream)
183 186 elif src_repo.local():
184 187 src_repo.push(dest_repo, revs=revs)
185 188 else:
@@ -2225,9 +2225,8 b' class localrepository(repo.repository):'
2225 2225 self.reload()
2226 2226 return len(self.heads()) + 1
2227 2227
2228 def clone(self, remote, heads=[], pull=False):
2228 def clone(self, remote, heads=[], stream=False):
2229 2229 '''clone remote repository.
2230 if possible, changes are streamed from remote server.
2231 2230
2232 2231 keyword arguments:
2233 2232 heads: list of revs to clone (forces use of pull)
@@ -2240,7 +2239,7 b' class localrepository(repo.repository):'
2240 2239 # and format flags on "stream" capability, and stream only if
2241 2240 # compatible.
2242 2241
2243 if not pull and not heads and remote.capable('stream'):
2242 if stream and not heads and remote.capable('stream'):
2244 2243 return self.stream_in(remote)
2245 2244 return self.pull(remote, heads)
2246 2245
@@ -12,7 +12,7 b' cat hg.pid >> $DAEMON_PIDS'
12 12 cd ..
13 13
14 14 echo % clone via stream
15 http_proxy= hg clone http://localhost:20059/ copy 2>&1 | \
15 http_proxy= hg clone --stream http://localhost:20059/ copy 2>&1 | \
16 16 sed -e 's/[0-9][0-9.]*/XXX/g'
17 17 cd copy
18 18 hg verify
@@ -20,6 +20,6 b' hg verify'
20 20 cd ..
21 21
22 22 echo % clone via pull
23 http_proxy= hg clone --pull http://localhost:20059/ copy-pull
23 http_proxy= hg clone http://localhost:20059/ copy-pull
24 24 cd copy-pull
25 25 hg verify
@@ -14,26 +14,26 b' cat proxy.pid >> $DAEMON_PIDS'
14 14 sleep 2
15 15
16 16 echo %% url for proxy, stream
17 http_proxy=http://localhost:20060/ hg --config http_proxy.always=True clone http://localhost:20059/ b | \
17 http_proxy=http://localhost:20060/ hg --config http_proxy.always=True clone --stream http://localhost:20059/ b | \
18 18 sed -e 's/[0-9][0-9.]*/XXX/g'
19 19 cd b
20 20 hg verify
21 21 cd ..
22 22
23 23 echo %% url for proxy, pull
24 http_proxy=http://localhost:20060/ hg --config http_proxy.always=True clone --pull http://localhost:20059/ b-pull
24 http_proxy=http://localhost:20060/ hg --config http_proxy.always=True clone http://localhost:20059/ b-pull
25 25 cd b-pull
26 26 hg verify
27 27 cd ..
28 28
29 29 echo %% host:port for proxy
30 http_proxy=localhost:20060 hg clone --pull --config http_proxy.always=True http://localhost:20059/ c
30 http_proxy=localhost:20060 hg clone --config http_proxy.always=True http://localhost:20059/ c
31 31
32 32 echo %% proxy url with user name and password
33 http_proxy=http://user:passwd@localhost:20060 hg clone --pull --config http_proxy.always=True http://localhost:20059/ d
33 http_proxy=http://user:passwd@localhost:20060 hg clone --config http_proxy.always=True http://localhost:20059/ d
34 34
35 35 echo %% url with user name and password
36 http_proxy=http://user:passwd@localhost:20060 hg clone --pull --config http_proxy.always=True http://user:passwd@localhost:20059/ e
36 http_proxy=http://user:passwd@localhost:20060 hg clone --config http_proxy.always=True http://user:passwd@localhost:20059/ e
37 37
38 38 echo %% bad host:port for proxy
39 39 http_proxy=localhost:20061 hg clone --config http_proxy.always=True http://localhost:20059/ f
@@ -31,14 +31,14 b' hg ci -A -m "init" -d "1000000 0" foo'
31 31 cd ..
32 32
33 33 echo "# clone remote via stream"
34 hg clone -e ./dummyssh ssh://user@dummy/remote local-stream 2>&1 | \
34 hg clone -e ./dummyssh --stream ssh://user@dummy/remote local-stream 2>&1 | \
35 35 sed -e 's/[0-9][0-9.]*/XXX/g'
36 36 cd local-stream
37 37 hg verify
38 38 cd ..
39 39
40 40 echo "# clone remote via pull"
41 hg clone -e ./dummyssh --pull ssh://user@dummy/remote local
41 hg clone -e ./dummyssh ssh://user@dummy/remote local
42 42
43 43 echo "# verify"
44 44 cd local
General Comments 0
You need to be logged in to leave comments. Login now