# HG changeset patch # User Yuya Nishihara # Date 2015-12-26 07:06:12 # Node ID 56c2caffde3d89f53faefac33678388bc95d20e0 # Parent cb0cfa9fd3406d6f8d9cc41ec4893903e7522129 paths: do not process default-push as pushurl of default path (issue5000) It didn't work because "default-push" and "default" are independent named items. Without this patch, "hg push default" would push to "default-push" because paths["default"].pushloc was overwritten by "default-push". Also, we shouldn't ban a user from doing "hg push default-push" so long as "default-push" item is defined, not "default:pushurl". Otherwise, he would be confused by missing "default-push" path. Tests are included in a patch for stable branch. diff --git a/mercurial/ui.py b/mercurial/ui.py --- a/mercurial/ui.py +++ b/mercurial/ui.py @@ -1097,23 +1097,9 @@ class paths(dict): # No location is the same as not existing. if not loc: continue - - # TODO ignore default-push once all consumers stop referencing it - # since it is handled specifically below. - loc, sub = ui.configsuboptions('paths', name) self[name] = path(ui, name, rawloc=loc, suboptions=sub) - # Handle default-push, which is a one-off that defines the push URL for - # the "default" path. - defaultpush = ui.config('paths', 'default-push') - if defaultpush: - # "default-push" can be defined without "default" entry. This is a - # bit weird, but is allowed for backwards compatibility. - if 'default' not in self: - self['default'] = path(ui, 'default', rawloc=defaultpush) - self['default'].pushloc = defaultpush - def getpath(self, name, default=None): """Return a ``path`` from a string, falling back to default.