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