[PATCH 9 of 9 paths v2] commands.push: finish converting to new path API
Gregory Szorc
gregory.szorc at gmail.com
Sun Mar 1 15:50:48 CST 2015
# HG changeset patch
# User Gregory Szorc <gregory.szorc at gmail.com>
# Date 1423511376 28800
# Mon Feb 09 11:49:36 2015 -0800
# Node ID 9d50c4be6b9bef95d042974b1b792af38c0a88dd
# Parent 86b20c6cbde1cf67e7401f7541cbfca233d34362
commands.push: finish converting to new path API
This could be combined with the previous patch. However, the
previous patch changed output and I wanted to isolate
output-changing changes from other changes.
diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -5084,18 +5084,18 @@ def push(ui, repo, dest=None, **opts):
# this lets simultaneous -r, -b options continue working
opts.setdefault('rev', []).append("null")
path = ui.paths.getpath(dest, default='push', require=True)
- dest = ui.expandpath(dest or 'default-push', dest or 'default')
- dest, branches = hg.parseurl(dest, opts.get('branch'))
- ui.status(_('pushing to %s\n') % util.hidepassword(dest))
+ url = path.url
+ branches = [path.rev, opts.get('branch', [])]
+ ui.status(_('pushing to %s\n') % util.hidepassword(url))
revs, checkout = hg.addbranchrevs(repo, repo, branches, opts.get('rev'))
- other = hg.peer(repo, opts, dest)
+ other = hg.peer(repo, opts, url)
if revs:
revs = [repo.lookup(r) for r in scmutil.revrange(repo, revs)]
- repo._subtoppath = dest
+ repo._subtoppath = url
try:
# push subrepos depth-first for coherent ordering
c = repo['']
subs = c.substate # only repos that are committed
More information about the Mercurial-devel
mailing list