comparison mercurial/commands.py @ 27555:ca8ada499529 stable

push: restore old behavior of default-push (issue5000) This effectively backs out dceaef70e410 and 10917b062adf. We can't handle "default-push" just like "default:pushurl" because it is a stand-alone named path. Instead, I have two ideas to work around the issue: a. two defaults: getpath(dest, default=('default-push', 'default')) b. virtual path: getpath(dest, default=':default') (a) is conservative approach and will have less trouble, but callers have to specify they need "default-push" or "default". (b) generates hidden ":default" path from "default" and "default-push", and callers request ":default". This will require some tricks and won't work if there are conflicting sub-options valid for both "pull" and "push". I'll take (a) for default branch. This patch should NOT BE MERGED to default except for tests because it would break handling of "pushurl" sub-option.
author Yuya Nishihara <yuya@tcha.org>
date Sat, 26 Dec 2015 15:18:16 +0900
parents 59d5f619e69e
children 44f717c87903
comparison
equal deleted inserted replaced
27532:1be02894dd6f 27555:ca8ada499529
5392 else: 5392 else:
5393 # if we try to push a deleted bookmark, translate it to null 5393 # if we try to push a deleted bookmark, translate it to null
5394 # this lets simultaneous -r, -b options continue working 5394 # this lets simultaneous -r, -b options continue working
5395 opts.setdefault('rev', []).append("null") 5395 opts.setdefault('rev', []).append("null")
5396 5396
5397 path = ui.paths.getpath(dest, default='default') 5397 path = ui.paths.getpath(dest, default='default-push')
5398 if not path:
5399 path = ui.paths.getpath(dest, default='default')
5398 if not path: 5400 if not path:
5399 raise error.Abort(_('default repository not configured!'), 5401 raise error.Abort(_('default repository not configured!'),
5400 hint=_('see the "path" section in "hg help config"')) 5402 hint=_('see the "path" section in "hg help config"'))
5401 dest, branches = path.pushloc, (path.branch, opts.get('branch') or []) 5403 dest, branches = path.loc, (path.branch, opts.get('branch') or [])
5402 ui.status(_('pushing to %s\n') % util.hidepassword(dest)) 5404 ui.status(_('pushing to %s\n') % util.hidepassword(dest))
5403 revs, checkout = hg.addbranchrevs(repo, repo, branches, opts.get('rev')) 5405 revs, checkout = hg.addbranchrevs(repo, repo, branches, opts.get('rev'))
5404 other = hg.peer(repo, opts, dest) 5406 other = hg.peer(repo, opts, dest)
5405 5407
5406 if revs: 5408 if revs: