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)) |
@@ -548,6 +548,13 b' def show_changeset(ui, repo, opts):' | |||||
548 | return t |
|
548 | return t | |
549 | return changeset_printer(ui, repo) |
|
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 | def show_version(ui): |
|
558 | def show_version(ui): | |
552 | """output version and copyright information""" |
|
559 | """output version and copyright information""" | |
553 | ui.write(_("Mercurial Distributed SCM (version %s)\n") |
|
560 | ui.write(_("Mercurial Distributed SCM (version %s)\n") | |
@@ -982,7 +989,7 b' def clone(ui, source, dest=None, **opts)' | |||||
982 | .hg/hgrc will be created on the remote side. Look at the help text |
|
989 | .hg/hgrc will be created on the remote side. Look at the help text | |
983 | for the pull command for important details about ssh:// URLs. |
|
990 | for the pull command for important details about ssh:// URLs. | |
984 | """ |
|
991 | """ | |
985 | ui.setconfig_remoteopts(**opts) |
|
992 | setremoteconfig(ui, opts) | |
986 | hg.clone(ui, ui.expandpath(source), dest, |
|
993 | hg.clone(ui, ui.expandpath(source), dest, | |
987 | pull=opts['pull'], |
|
994 | pull=opts['pull'], | |
988 | stream=opts['uncompressed'], |
|
995 | stream=opts['uncompressed'], | |
@@ -1827,7 +1834,7 b' def incoming(ui, repo, source="default",' | |||||
1827 | See pull for valid source format details. |
|
1834 | See pull for valid source format details. | |
1828 | """ |
|
1835 | """ | |
1829 | source = ui.expandpath(source) |
|
1836 | source = ui.expandpath(source) | |
1830 | ui.setconfig_remoteopts(**opts) |
|
1837 | setremoteconfig(ui, opts) | |
1831 |
|
1838 | |||
1832 | other = hg.repository(ui, source) |
|
1839 | other = hg.repository(ui, source) | |
1833 | incoming = repo.findincoming(other, force=opts["force"]) |
|
1840 | incoming = repo.findincoming(other, force=opts["force"]) | |
@@ -1883,7 +1890,7 b' def init(ui, dest=".", **opts):' | |||||
1883 | Look at the help text for the pull command for important details |
|
1890 | Look at the help text for the pull command for important details | |
1884 | about ssh:// URLs. |
|
1891 | about ssh:// URLs. | |
1885 | """ |
|
1892 | """ | |
1886 | ui.setconfig_remoteopts(**opts) |
|
1893 | setremoteconfig(ui, opts) | |
1887 | hg.repository(ui, dest, create=1) |
|
1894 | hg.repository(ui, dest, create=1) | |
1888 |
|
1895 | |||
1889 | def locate(ui, repo, *pats, **opts): |
|
1896 | def locate(ui, repo, *pats, **opts): | |
@@ -2061,7 +2068,7 b' def outgoing(ui, repo, dest=None, **opts' | |||||
2061 | See pull for valid destination format details. |
|
2068 | See pull for valid destination format details. | |
2062 | """ |
|
2069 | """ | |
2063 | dest = ui.expandpath(dest or 'default-push', dest or 'default') |
|
2070 | dest = ui.expandpath(dest or 'default-push', dest or 'default') | |
2064 | ui.setconfig_remoteopts(**opts) |
|
2071 | setremoteconfig(ui, opts) | |
2065 | revs = None |
|
2072 | revs = None | |
2066 | if opts['rev']: |
|
2073 | if opts['rev']: | |
2067 | revs = [repo.lookup(rev) for rev in opts['rev']] |
|
2074 | revs = [repo.lookup(rev) for rev in opts['rev']] | |
@@ -2183,7 +2190,7 b' def pull(ui, repo, source="default", **o' | |||||
2183 | with the --ssh command line option. |
|
2190 | with the --ssh command line option. | |
2184 | """ |
|
2191 | """ | |
2185 | source = ui.expandpath(source) |
|
2192 | source = ui.expandpath(source) | |
2186 | ui.setconfig_remoteopts(**opts) |
|
2193 | setremoteconfig(ui, opts) | |
2187 |
|
2194 | |||
2188 | other = hg.repository(ui, source) |
|
2195 | other = hg.repository(ui, source) | |
2189 | ui.status(_('pulling from %s\n') % (source)) |
|
2196 | ui.status(_('pulling from %s\n') % (source)) | |
@@ -2221,7 +2228,7 b' def push(ui, repo, dest=None, **opts):' | |||||
2221 | feature is enabled on the remote Mercurial server. |
|
2228 | feature is enabled on the remote Mercurial server. | |
2222 | """ |
|
2229 | """ | |
2223 | dest = ui.expandpath(dest or 'default-push', dest or 'default') |
|
2230 | dest = ui.expandpath(dest or 'default-push', dest or 'default') | |
2224 | ui.setconfig_remoteopts(**opts) |
|
2231 | setremoteconfig(ui, opts) | |
2225 |
|
2232 | |||
2226 | other = hg.repository(ui, dest) |
|
2233 | other = hg.repository(ui, dest) | |
2227 | ui.status('pushing to %s\n' % (dest)) |
|
2234 | 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