Mercurial > public > mercurial-scm > hg
diff mercurial/commands.py @ 46908:4452cb788404
urlutil: extract `parseurl` from `hg` into the new module
The new module is well fitting for this new code. And this will be useful to
make the gathered code collaborate more later.
Differential Revision: https://phab.mercurial-scm.org/D10375
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Mon, 12 Apr 2021 06:34:54 +0200 |
parents | ffd3e823a7e5 |
children | 067840864f37 |
line wrap: on
line diff
--- a/mercurial/commands.py Mon Apr 12 03:01:04 2021 +0200 +++ b/mercurial/commands.py Mon Apr 12 06:34:54 2021 +0200 @@ -1614,7 +1614,7 @@ outgoing = discovery.outgoing(repo, common, heads) else: dest = ui.expandpath(dest or b'default-push', dest or b'default') - dest, branches = hg.parseurl(dest, opts.get(b'branch')) + dest, branches = urlutil.parseurl(dest, opts.get(b'branch')) other = hg.peer(repo, opts, dest) revs = [repo[r].hex() for r in revs] revs, checkout = hg.addbranchrevs(repo, repo, branches, revs) @@ -3841,7 +3841,7 @@ peer = None try: if source: - source, branches = hg.parseurl(ui.expandpath(source)) + source, branches = urlutil.parseurl(ui.expandpath(source)) # only pass ui when no repo peer = hg.peer(repo or ui, opts, source) repo = peer.local() @@ -4311,7 +4311,7 @@ cmdutil.check_incompatible_arguments(opts, b'subrepos', [b'bundle']) if opts.get(b'bookmarks'): - source, branches = hg.parseurl( + source, branches = urlutil.parseurl( ui.expandpath(source), opts.get(b'branch') ) other = hg.peer(repo, opts, source) @@ -5390,7 +5390,7 @@ if not sources: sources = [b'default'] for source in sources: - source, branches = hg.parseurl( + source, branches = urlutil.parseurl( ui.expandpath(source), opts.get(b'branch') ) ui.status(_(b'pulling from %s\n') % urlutil.hidepassword(source)) @@ -7225,7 +7225,7 @@ return def getincoming(): - source, branches = hg.parseurl(ui.expandpath(b'default')) + source, branches = urlutil.parseurl(ui.expandpath(b'default')) sbranch = branches[0] try: other = hg.peer(repo, {}, source) @@ -7248,7 +7248,9 @@ source = sbranch = sother = commoninc = incoming = None def getoutgoing(): - dest, branches = hg.parseurl(ui.expandpath(b'default-push', b'default')) + dest, branches = urlutil.parseurl( + ui.expandpath(b'default-push', b'default') + ) dbranch = branches[0] revs, checkout = hg.addbranchrevs(repo, repo, branches, None) if source != dest: