comparison mercurial/ui.py @ 29413:31d3ab7985b8

ui: path option to declare which revisions to push by default Now that we have a mechanism for declaring path sub-options, we can start to pile on features! Many power users have expressed frustration that bare `hg push` attempts to push all local revisions to the remote. This patch introduces the "pushrev" path sub-option to control which revisions are pushed when no "-r" argument is specified. The value of this sub-option is a revset, naturally. A future feature addition could potentially introduce a "pushnames" sub-options that declares the list of names (branches, bookmarks, topics, etc) to push by default. The entire "what to push by default" feature should probably be considered before this patch lands.
author Gregory Szorc <gregory.szorc@gmail.com>
date Sun, 26 Jun 2016 07:59:02 -0700
parents b62bce819d0c
children 96bd27eb23f0
comparison
equal deleted inserted replaced
29412:b62bce819d0c 29413:31d3ab7985b8
1279 'ignoring)\n') % path.name) 1279 'ignoring)\n') % path.name)
1280 u.fragment = None 1280 u.fragment = None
1281 1281
1282 return str(u) 1282 return str(u)
1283 1283
1284 @pathsuboption('pushrev', 'pushrev')
1285 def pushrevpathoption(ui, path, value):
1286 return value
1287
1284 class path(object): 1288 class path(object):
1285 """Represents an individual path and its configuration.""" 1289 """Represents an individual path and its configuration."""
1286 1290
1287 def __init__(self, ui, name, rawloc=None, suboptions=None): 1291 def __init__(self, ui, name, rawloc=None, suboptions=None):
1288 """Construct a path from its config options. 1292 """Construct a path from its config options.