Show More
@@ -1071,7 +1071,7 b' class paths(dict):' | |||||
1071 | # TODO ignore default-push once all consumers stop referencing it |
|
1071 | # TODO ignore default-push once all consumers stop referencing it | |
1072 | # since it is handled specifically below. |
|
1072 | # since it is handled specifically below. | |
1073 |
|
1073 | |||
1074 | self[name] = path(name, rawloc=loc) |
|
1074 | self[name] = path(ui, name, rawloc=loc) | |
1075 |
|
1075 | |||
1076 | # Handle default-push, which is a one-off that defines the push URL for |
|
1076 | # Handle default-push, which is a one-off that defines the push URL for | |
1077 | # the "default" path. |
|
1077 | # the "default" path. | |
@@ -1080,7 +1080,7 b' class paths(dict):' | |||||
1080 | # "default-push" can be defined without "default" entry. This is a |
|
1080 | # "default-push" can be defined without "default" entry. This is a | |
1081 | # bit weird, but is allowed for backwards compatibility. |
|
1081 | # bit weird, but is allowed for backwards compatibility. | |
1082 | if 'default' not in self: |
|
1082 | if 'default' not in self: | |
1083 | self['default'] = path('default', rawloc=defaultpush) |
|
1083 | self['default'] = path(ui, 'default', rawloc=defaultpush) | |
1084 | self['default'].pushloc = defaultpush |
|
1084 | self['default'].pushloc = defaultpush | |
1085 |
|
1085 | |||
1086 | def getpath(self, name, default=None): |
|
1086 | def getpath(self, name, default=None): | |
@@ -1112,7 +1112,8 b' class paths(dict):' | |||||
1112 | except KeyError: |
|
1112 | except KeyError: | |
1113 | # Try to resolve as a local path or URI. |
|
1113 | # Try to resolve as a local path or URI. | |
1114 | try: |
|
1114 | try: | |
1115 | return path(None, rawloc=name) |
|
1115 | # We don't pass sub-options in, so no need to pass ui instance. | |
|
1116 | return path(None, None, rawloc=name) | |||
1116 | except ValueError: |
|
1117 | except ValueError: | |
1117 | raise error.RepoError(_('repository %s does not exist') % |
|
1118 | raise error.RepoError(_('repository %s does not exist') % | |
1118 | name) |
|
1119 | name) | |
@@ -1122,9 +1123,10 b' class paths(dict):' | |||||
1122 | class path(object): |
|
1123 | class path(object): | |
1123 | """Represents an individual path and its configuration.""" |
|
1124 | """Represents an individual path and its configuration.""" | |
1124 |
|
1125 | |||
1125 | def __init__(self, name, rawloc=None, pushloc=None): |
|
1126 | def __init__(self, ui, name, rawloc=None, pushloc=None): | |
1126 | """Construct a path from its config options. |
|
1127 | """Construct a path from its config options. | |
1127 |
|
1128 | |||
|
1129 | ``ui`` is the ``ui`` instance the path is coming from. | |||
1128 | ``name`` is the symbolic name of the path. |
|
1130 | ``name`` is the symbolic name of the path. | |
1129 | ``rawloc`` is the raw location, as defined in the config. |
|
1131 | ``rawloc`` is the raw location, as defined in the config. | |
1130 | ``pushloc`` is the raw locations pushes should be made to. |
|
1132 | ``pushloc`` is the raw locations pushes should be made to. |
General Comments 0
You need to be logged in to leave comments.
Login now