changeset 2739:3248aa10b388

merge with mpm.
author Vadim Gelfer <vadim.gelfer@gmail.com>
date Sun, 30 Jul 2006 22:52:34 -0700
parents 400a4a502001 (current diff) ad4155e757da (diff)
children 386f04d6ecb3
files mercurial/commands.py
diffstat 3 files changed, 14 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/mq.py	Sun Jul 30 21:46:38 2006 -0700
+++ b/hgext/mq.py	Sun Jul 30 22:52:34 2006 -0700
@@ -1192,7 +1192,7 @@
     Source patch repository is looked for in <src>/.hg/patches by
     default.  Use -p <url> to change.
     '''
-    ui.setconfig_remoteopts(**opts)
+    commands.setremoteconfig(**opts)
     if dest is None:
         dest = hg.defaultdest(source)
     sr = hg.repository(ui, ui.expandpath(source))
--- a/mercurial/commands.py	Sun Jul 30 21:46:38 2006 -0700
+++ b/mercurial/commands.py	Sun Jul 30 22:52:34 2006 -0700
@@ -548,6 +548,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")
@@ -982,7 +989,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'],
@@ -1827,7 +1834,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"])
@@ -1883,7 +1890,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):
@@ -2061,7 +2068,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']]
@@ -2183,7 +2190,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))
@@ -2221,7 +2228,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))
--- a/mercurial/ui.py	Sun Jul 30 21:46:38 2006 -0700
+++ b/mercurial/ui.py	Sun Jul 30 22:52:34 2006 -0700
@@ -217,12 +217,6 @@
             path = self.config("paths", default)
         return path or loc
 
-    def setconfig_remoteopts(self, **opts):
-        if opts.get('ssh'):
-            self.setconfig("ui", "ssh", opts['ssh'])
-        if opts.get('remotecmd'):
-            self.setconfig("ui", "remotecmd", opts['remotecmd'])
-
     def write(self, *args):
         if self.header:
             if self.header != self.prev_header: