[PATCH 3 of 3] paths: do not process default-push as pushurl of default path (issue5000)

Yuya Nishihara yuya at tcha.org
Sat Dec 26 06:06:46 CST 2015


# HG changeset patch
# User Yuya Nishihara <yuya at tcha.org>
# Date 1451113572 -32400
#      Sat Dec 26 16:06:12 2015 +0900
# Node ID 8b1635a5baefbe613290d9030d729c464c8d9894
# Parent  cfbbc41a45b1ddc0d2d44e655e6b1c124174228f
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.
 


More information about the Mercurial-devel mailing list