Show More
@@ -459,15 +459,6 b' def setremoteconfig(ui, opts):' | |||||
459 | if opts.get('remotecmd'): |
|
459 | if opts.get('remotecmd'): | |
460 | ui.setconfig("ui", "remotecmd", opts['remotecmd']) |
|
460 | ui.setconfig("ui", "remotecmd", opts['remotecmd']) | |
461 |
|
461 | |||
462 | def parseurl(url, revs): |
|
|||
463 | '''parse url#branch, returning url, branch + revs''' |
|
|||
464 |
|
||||
465 | if '#' not in url: |
|
|||
466 | return url, (revs or None) |
|
|||
467 |
|
||||
468 | url, rev = url.split('#', 1) |
|
|||
469 | return url, revs + [rev] |
|
|||
470 |
|
||||
471 | def revpair(repo, revs): |
|
462 | def revpair(repo, revs): | |
472 | '''return pair of nodes, given list of revisions. second item can |
|
463 | '''return pair of nodes, given list of revisions. second item can | |
473 | be None, meaning use working dir.''' |
|
464 | be None, meaning use working dir.''' |
@@ -336,7 +336,7 b' def bundle(ui, repo, fname, dest=None, *' | |||||
336 | visit.append(p) |
|
336 | visit.append(p) | |
337 | else: |
|
337 | else: | |
338 | cmdutil.setremoteconfig(ui, opts) |
|
338 | cmdutil.setremoteconfig(ui, opts) | |
339 |
dest, revs = |
|
339 | dest, revs = hg.parseurl( | |
340 | ui.expandpath(dest or 'default-push', dest or 'default'), revs) |
|
340 | ui.expandpath(dest or 'default-push', dest or 'default'), revs) | |
341 | other = hg.repository(ui, dest) |
|
341 | other = hg.repository(ui, dest) | |
342 | o = repo.findoutgoing(other, force=opts['force']) |
|
342 | o = repo.findoutgoing(other, force=opts['force']) | |
@@ -1475,7 +1475,7 b' def identify(ui, repo, source=None,' | |||||
1475 | output = [] |
|
1475 | output = [] | |
1476 |
|
1476 | |||
1477 | if source: |
|
1477 | if source: | |
1478 |
source, revs = |
|
1478 | source, revs = hg.parseurl(ui.expandpath(source), []) | |
1479 | srepo = hg.repository(ui, source) |
|
1479 | srepo = hg.repository(ui, source) | |
1480 | if not rev and revs: |
|
1480 | if not rev and revs: | |
1481 | rev = revs[0] |
|
1481 | rev = revs[0] | |
@@ -1638,7 +1638,7 b' def incoming(ui, repo, source="default",' | |||||
1638 |
|
1638 | |||
1639 | See pull for valid source format details. |
|
1639 | See pull for valid source format details. | |
1640 | """ |
|
1640 | """ | |
1641 |
source, revs = |
|
1641 | source, revs = hg.parseurl(ui.expandpath(source), opts['rev']) | |
1642 | cmdutil.setremoteconfig(ui, opts) |
|
1642 | cmdutil.setremoteconfig(ui, opts) | |
1643 |
|
1643 | |||
1644 | other = hg.repository(ui, source) |
|
1644 | other = hg.repository(ui, source) | |
@@ -1946,7 +1946,7 b' def outgoing(ui, repo, dest=None, **opts' | |||||
1946 |
|
1946 | |||
1947 | See pull for valid destination format details. |
|
1947 | See pull for valid destination format details. | |
1948 | """ |
|
1948 | """ | |
1949 |
dest, revs = |
|
1949 | dest, revs = hg.parseurl( | |
1950 | ui.expandpath(dest or 'default-push', dest or 'default'), opts['rev']) |
|
1950 | ui.expandpath(dest or 'default-push', dest or 'default'), opts['rev']) | |
1951 | cmdutil.setremoteconfig(ui, opts) |
|
1951 | cmdutil.setremoteconfig(ui, opts) | |
1952 | if revs: |
|
1952 | if revs: | |
@@ -2068,7 +2068,7 b' def pull(ui, repo, source="default", **o' | |||||
2068 | Alternatively specify "ssh -C" as your ssh command in your hgrc or |
|
2068 | Alternatively specify "ssh -C" as your ssh command in your hgrc or | |
2069 | with the --ssh command line option. |
|
2069 | with the --ssh command line option. | |
2070 | """ |
|
2070 | """ | |
2071 |
source, revs = |
|
2071 | source, revs = hg.parseurl(ui.expandpath(source), opts['rev']) | |
2072 | cmdutil.setremoteconfig(ui, opts) |
|
2072 | cmdutil.setremoteconfig(ui, opts) | |
2073 |
|
2073 | |||
2074 | other = hg.repository(ui, source) |
|
2074 | other = hg.repository(ui, source) | |
@@ -2113,7 +2113,7 b' def push(ui, repo, dest=None, **opts):' | |||||
2113 | Pushing to http:// and https:// URLs is only possible, if this |
|
2113 | Pushing to http:// and https:// URLs is only possible, if this | |
2114 | feature is explicitly enabled on the remote Mercurial server. |
|
2114 | feature is explicitly enabled on the remote Mercurial server. | |
2115 | """ |
|
2115 | """ | |
2116 |
dest, revs = |
|
2116 | dest, revs = hg.parseurl( | |
2117 | ui.expandpath(dest or 'default-push', dest or 'default'), opts['rev']) |
|
2117 | ui.expandpath(dest or 'default-push', dest or 'default'), opts['rev']) | |
2118 | cmdutil.setremoteconfig(ui, opts) |
|
2118 | cmdutil.setremoteconfig(ui, opts) | |
2119 |
|
2119 |
@@ -10,7 +10,7 b' from node import *' | |||||
10 | from repo import * |
|
10 | from repo import * | |
11 | from i18n import _ |
|
11 | from i18n import _ | |
12 | import localrepo, bundlerepo, httprepo, sshrepo, statichttprepo |
|
12 | import localrepo, bundlerepo, httprepo, sshrepo, statichttprepo | |
13 |
import errno, lock, os, shutil, util, |
|
13 | import errno, lock, os, shutil, util, extensions | |
14 | import merge as _merge |
|
14 | import merge as _merge | |
15 | import verify as _verify |
|
15 | import verify as _verify | |
16 |
|
16 | |||
@@ -18,6 +18,15 b' def _local(path):' | |||||
18 | return (os.path.isfile(util.drop_scheme('file', path)) and |
|
18 | return (os.path.isfile(util.drop_scheme('file', path)) and | |
19 | bundlerepo or localrepo) |
|
19 | bundlerepo or localrepo) | |
20 |
|
20 | |||
|
21 | def parseurl(url, revs): | |||
|
22 | '''parse url#branch, returning url, branch + revs''' | |||
|
23 | ||||
|
24 | if '#' not in url: | |||
|
25 | return url, (revs or None) | |||
|
26 | ||||
|
27 | url, rev = url.split('#', 1) | |||
|
28 | return url, revs + [rev] | |||
|
29 | ||||
21 | schemes = { |
|
30 | schemes = { | |
22 | 'bundle': bundlerepo, |
|
31 | 'bundle': bundlerepo, | |
23 | 'file': _local, |
|
32 | 'file': _local, | |
@@ -95,7 +104,7 b' def clone(ui, source, dest=None, pull=Fa' | |||||
95 | """ |
|
104 | """ | |
96 |
|
105 | |||
97 | origsource = source |
|
106 | origsource = source | |
98 |
source, rev = |
|
107 | source, rev = parseurl(ui.expandpath(source), rev) | |
99 |
|
108 | |||
100 | if isinstance(source, str): |
|
109 | if isinstance(source, str): | |
101 | src_repo = repository(ui, source) |
|
110 | src_repo = repository(ui, source) |
General Comments 0
You need to be logged in to leave comments.
Login now