Mercurial > public > mercurial-scm > hg
comparison mercurial/hg.py @ 14607:bd1acea552ff
hg: rename opts argument to peeropts in clone
This should make it clearer that the options are used with remoteui
only and are not used otherwise in hg.clone.
author | Martin Geisler <mg@aragost.com> |
---|---|
date | Tue, 14 Jun 2011 16:33:46 +0200 |
parents | 6e631c24c6d9 |
children | b39ed8c8e5e5 |
comparison
equal
deleted
inserted
replaced
14606:6e631c24c6d9 | 14607:bd1acea552ff |
---|---|
172 break | 172 break |
173 except error.RepoLookupError: | 173 except error.RepoLookupError: |
174 continue | 174 continue |
175 _update(r, uprev) | 175 _update(r, uprev) |
176 | 176 |
177 def clone(ui, opts, source, dest=None, pull=False, rev=None, update=True, | 177 def clone(ui, peeropts, source, dest=None, pull=False, rev=None, |
178 stream=False, branch=None): | 178 update=True, stream=False, branch=None): |
179 """Make a copy of an existing repository. | 179 """Make a copy of an existing repository. |
180 | 180 |
181 Create a copy of an existing repository in a new directory. The | 181 Create a copy of an existing repository in a new directory. The |
182 source and destination are URLs, as passed to the repository | 182 source and destination are URLs, as passed to the repository |
183 function. Returns a pair of repository objects, the source and | 183 function. Returns a pair of repository objects, the source and |
212 """ | 212 """ |
213 | 213 |
214 if isinstance(source, str): | 214 if isinstance(source, str): |
215 origsource = ui.expandpath(source) | 215 origsource = ui.expandpath(source) |
216 source, branch = parseurl(origsource, branch) | 216 source, branch = parseurl(origsource, branch) |
217 srcrepo = repository(remoteui(ui, opts), source) | 217 srcrepo = repository(remoteui(ui, peeropts), source) |
218 else: | 218 else: |
219 srcrepo = source | 219 srcrepo = source |
220 branch = (None, branch or []) | 220 branch = (None, branch or []) |
221 origsource = source = srcrepo.url() | 221 origsource = source = srcrepo.url() |
222 rev, checkout = addbranchrevs(srcrepo, srcrepo, branch, rev) | 222 rev, checkout = addbranchrevs(srcrepo, srcrepo, branch, rev) |
306 else: | 306 else: |
307 ui.debug("copied %d files\n" % num) | 307 ui.debug("copied %d files\n" % num) |
308 | 308 |
309 # we need to re-init the repo after manually copying the data | 309 # we need to re-init the repo after manually copying the data |
310 # into it | 310 # into it |
311 destrepo = repository(remoteui(ui, opts), dest) | 311 destrepo = repository(remoteui(ui, peeropts), dest) |
312 srcrepo.hook('outgoing', source='clone', | 312 srcrepo.hook('outgoing', source='clone', |
313 node=node.hex(node.nullid)) | 313 node=node.hex(node.nullid)) |
314 else: | 314 else: |
315 try: | 315 try: |
316 destrepo = repository(remoteui(ui, opts), dest, create=True) | 316 destrepo = repository(remoteui(ui, peeropts), dest, |
317 create=True) | |
317 except OSError, inst: | 318 except OSError, inst: |
318 if inst.errno == errno.EEXIST: | 319 if inst.errno == errno.EEXIST: |
319 dircleanup.close() | 320 dircleanup.close() |
320 raise util.Abort(_("destination '%s' already exists") | 321 raise util.Abort(_("destination '%s' already exists") |
321 % dest) | 322 % dest) |