Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/commands.py @ 26065:dceaef70e410
commands.push: use "pushloc" path attribute
Path instances now have a "pushloc" attribute that exposes the path
to be used for pushing. The "default-push" path is automatically
captured in the "pushloc" attribute of the "default" path.
Drop references to "default-push" and use the "pushloc" attribute
for looking up where to push to.
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Sat, 08 Aug 2015 00:12:41 -0700 |
parents | 10917b062adf |
children | f3b467aca485 |
comparison
equal
deleted
inserted
replaced
26064:1b1ab6ff58c4 | 26065:dceaef70e410 |
---|---|
5272 else: | 5272 else: |
5273 # if we try to push a deleted bookmark, translate it to null | 5273 # if we try to push a deleted bookmark, translate it to null |
5274 # this lets simultaneous -r, -b options continue working | 5274 # this lets simultaneous -r, -b options continue working |
5275 opts.setdefault('rev', []).append("null") | 5275 opts.setdefault('rev', []).append("null") |
5276 | 5276 |
5277 path = ui.paths.getpath(dest or 'default-push', default='default') | 5277 path = ui.paths.getpath(dest, default='default') |
5278 if not path: | 5278 if not path: |
5279 raise util.Abort(_('default repository not configured!'), | 5279 raise util.Abort(_('default repository not configured!'), |
5280 hint=_('see the "path" section in "hg help config"')) | 5280 hint=_('see the "path" section in "hg help config"')) |
5281 dest, branches = path.loc, (path.branch, opts.get('branch') or []) | 5281 dest, branches = path.pushloc, (path.branch, opts.get('branch') or []) |
5282 ui.status(_('pushing to %s\n') % util.hidepassword(dest)) | 5282 ui.status(_('pushing to %s\n') % util.hidepassword(dest)) |
5283 revs, checkout = hg.addbranchrevs(repo, repo, branches, opts.get('rev')) | 5283 revs, checkout = hg.addbranchrevs(repo, repo, branches, opts.get('rev')) |
5284 other = hg.peer(repo, opts, dest) | 5284 other = hg.peer(repo, opts, dest) |
5285 | 5285 |
5286 if revs: | 5286 if revs: |