Mercurial > public > mercurial-scm > hg-stable
diff mercurial/commands.py @ 2731:ad4155e757da
Kill ui.setconfig_remoteopts
This brought too much knowledge about command line particulars into
the ui code. Moved to commands.py.
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Mon, 31 Jul 2006 00:47:43 -0500 |
parents | a593813241e5 |
children | 3248aa10b388 |
line wrap: on
line diff
--- a/mercurial/commands.py Sun Jul 30 13:29:19 2006 -0700 +++ b/mercurial/commands.py Mon Jul 31 00:47:43 2006 -0500 @@ -547,6 +547,13 @@ return t return changeset_printer(ui, repo) +def setremoteconfig(ui, opts): + "copy remote options to ui tree" + if opts.get('ssh'): + ui.setconfig("ui", "ssh", opts['ssh']) + if opts.get('remotecmd'): + ui.setconfig("ui", "remotecmd", opts['remotecmd']) + def show_version(ui): """output version and copyright information""" ui.write(_("Mercurial Distributed SCM (version %s)\n") @@ -981,7 +988,7 @@ .hg/hgrc will be created on the remote side. Look at the help text for the pull command for important details about ssh:// URLs. """ - ui.setconfig_remoteopts(**opts) + setremoteconfig(ui, opts) hg.clone(ui, ui.expandpath(source), dest, pull=opts['pull'], stream=opts['uncompressed'], @@ -1826,7 +1833,7 @@ See pull for valid source format details. """ source = ui.expandpath(source) - ui.setconfig_remoteopts(**opts) + setremoteconfig(ui, opts) other = hg.repository(ui, source) incoming = repo.findincoming(other, force=opts["force"]) @@ -1882,7 +1889,7 @@ Look at the help text for the pull command for important details about ssh:// URLs. """ - ui.setconfig_remoteopts(**opts) + setremoteconfig(ui, opts) hg.repository(ui, dest, create=1) def locate(ui, repo, *pats, **opts): @@ -2060,7 +2067,7 @@ See pull for valid destination format details. """ dest = ui.expandpath(dest or 'default-push', dest or 'default') - ui.setconfig_remoteopts(**opts) + setremoteconfig(ui, opts) revs = None if opts['rev']: revs = [repo.lookup(rev) for rev in opts['rev']] @@ -2182,7 +2189,7 @@ with the --ssh command line option. """ source = ui.expandpath(source) - ui.setconfig_remoteopts(**opts) + setremoteconfig(ui, opts) other = hg.repository(ui, source) ui.status(_('pulling from %s\n') % (source)) @@ -2220,7 +2227,7 @@ feature is enabled on the remote Mercurial server. """ dest = ui.expandpath(dest or 'default-push', dest or 'default') - ui.setconfig_remoteopts(**opts) + setremoteconfig(ui, opts) other = hg.repository(ui, dest) ui.status('pushing to %s\n' % (dest))