Show More
@@ -1192,7 +1192,7 b' def clone(ui, source, dest=None, **opts)' | |||
|
1192 | 1192 | Source patch repository is looked for in <src>/.hg/patches by |
|
1193 | 1193 | default. Use -p <url> to change. |
|
1194 | 1194 | ''' |
|
1195 |
|
|
|
1195 | commands.setremoteconfig(**opts) | |
|
1196 | 1196 | if dest is None: |
|
1197 | 1197 | dest = hg.defaultdest(source) |
|
1198 | 1198 | sr = hg.repository(ui, ui.expandpath(source)) |
@@ -548,6 +548,13 b' def show_changeset(ui, repo, opts):' | |||
|
548 | 548 | return t |
|
549 | 549 | return changeset_printer(ui, repo) |
|
550 | 550 | |
|
551 | def setremoteconfig(ui, opts): | |
|
552 | "copy remote options to ui tree" | |
|
553 | if opts.get('ssh'): | |
|
554 | ui.setconfig("ui", "ssh", opts['ssh']) | |
|
555 | if opts.get('remotecmd'): | |
|
556 | ui.setconfig("ui", "remotecmd", opts['remotecmd']) | |
|
557 | ||
|
551 | 558 | def show_version(ui): |
|
552 | 559 | """output version and copyright information""" |
|
553 | 560 | ui.write(_("Mercurial Distributed SCM (version %s)\n") |
@@ -982,7 +989,7 b' def clone(ui, source, dest=None, **opts)' | |||
|
982 | 989 | .hg/hgrc will be created on the remote side. Look at the help text |
|
983 | 990 | for the pull command for important details about ssh:// URLs. |
|
984 | 991 | """ |
|
985 | ui.setconfig_remoteopts(**opts) | |
|
992 | setremoteconfig(ui, opts) | |
|
986 | 993 | hg.clone(ui, ui.expandpath(source), dest, |
|
987 | 994 | pull=opts['pull'], |
|
988 | 995 | stream=opts['uncompressed'], |
@@ -1827,7 +1834,7 b' def incoming(ui, repo, source="default",' | |||
|
1827 | 1834 | See pull for valid source format details. |
|
1828 | 1835 | """ |
|
1829 | 1836 | source = ui.expandpath(source) |
|
1830 | ui.setconfig_remoteopts(**opts) | |
|
1837 | setremoteconfig(ui, opts) | |
|
1831 | 1838 | |
|
1832 | 1839 | other = hg.repository(ui, source) |
|
1833 | 1840 | incoming = repo.findincoming(other, force=opts["force"]) |
@@ -1883,7 +1890,7 b' def init(ui, dest=".", **opts):' | |||
|
1883 | 1890 | Look at the help text for the pull command for important details |
|
1884 | 1891 | about ssh:// URLs. |
|
1885 | 1892 | """ |
|
1886 | ui.setconfig_remoteopts(**opts) | |
|
1893 | setremoteconfig(ui, opts) | |
|
1887 | 1894 | hg.repository(ui, dest, create=1) |
|
1888 | 1895 | |
|
1889 | 1896 | def locate(ui, repo, *pats, **opts): |
@@ -2061,7 +2068,7 b' def outgoing(ui, repo, dest=None, **opts' | |||
|
2061 | 2068 | See pull for valid destination format details. |
|
2062 | 2069 | """ |
|
2063 | 2070 | dest = ui.expandpath(dest or 'default-push', dest or 'default') |
|
2064 | ui.setconfig_remoteopts(**opts) | |
|
2071 | setremoteconfig(ui, opts) | |
|
2065 | 2072 | revs = None |
|
2066 | 2073 | if opts['rev']: |
|
2067 | 2074 | revs = [repo.lookup(rev) for rev in opts['rev']] |
@@ -2183,7 +2190,7 b' def pull(ui, repo, source="default", **o' | |||
|
2183 | 2190 | with the --ssh command line option. |
|
2184 | 2191 | """ |
|
2185 | 2192 | source = ui.expandpath(source) |
|
2186 | ui.setconfig_remoteopts(**opts) | |
|
2193 | setremoteconfig(ui, opts) | |
|
2187 | 2194 | |
|
2188 | 2195 | other = hg.repository(ui, source) |
|
2189 | 2196 | ui.status(_('pulling from %s\n') % (source)) |
@@ -2221,7 +2228,7 b' def push(ui, repo, dest=None, **opts):' | |||
|
2221 | 2228 | feature is enabled on the remote Mercurial server. |
|
2222 | 2229 | """ |
|
2223 | 2230 | dest = ui.expandpath(dest or 'default-push', dest or 'default') |
|
2224 | ui.setconfig_remoteopts(**opts) | |
|
2231 | setremoteconfig(ui, opts) | |
|
2225 | 2232 | |
|
2226 | 2233 | other = hg.repository(ui, dest) |
|
2227 | 2234 | ui.status('pushing to %s\n' % (dest)) |
@@ -217,12 +217,6 b' class ui(object):' | |||
|
217 | 217 | path = self.config("paths", default) |
|
218 | 218 | return path or loc |
|
219 | 219 | |
|
220 | def setconfig_remoteopts(self, **opts): | |
|
221 | if opts.get('ssh'): | |
|
222 | self.setconfig("ui", "ssh", opts['ssh']) | |
|
223 | if opts.get('remotecmd'): | |
|
224 | self.setconfig("ui", "remotecmd", opts['remotecmd']) | |
|
225 | ||
|
226 | 220 | def write(self, *args): |
|
227 | 221 | if self.header: |
|
228 | 222 | if self.header != self.prev_header: |
General Comments 0
You need to be logged in to leave comments.
Login now