##// END OF EJS Templates
ui: store pushloc as separate attribute...
Gregory Szorc -
r27264:e07003a9 default
parent child Browse files
Show More
@@ -5639,7 +5639,8 b' def push(ui, repo, dest=None, **opts):'
5639 if not path:
5639 if not path:
5640 raise error.Abort(_('default repository not configured!'),
5640 raise error.Abort(_('default repository not configured!'),
5641 hint=_('see the "path" section in "hg help config"'))
5641 hint=_('see the "path" section in "hg help config"'))
5642 dest, branches = path.pushloc, (path.branch, opts.get('branch') or [])
5642 dest = path.pushloc or path.loc
5643 branches = (path.branch, opts.get('branch') or [])
5643 ui.status(_('pushing to %s\n') % util.hidepassword(dest))
5644 ui.status(_('pushing to %s\n') % util.hidepassword(dest))
5644 revs, checkout = hg.addbranchrevs(repo, repo, branches, opts.get('rev'))
5645 revs, checkout = hg.addbranchrevs(repo, repo, branches, opts.get('rev'))
5645 other = hg.peer(repo, opts, dest)
5646 other = hg.peer(repo, opts, dest)
@@ -1081,7 +1081,7 b' class paths(dict):'
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('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):
1087 """Return a ``path`` from a string, falling back to a default.
1087 """Return a ``path`` from a string, falling back to a default.
@@ -1149,7 +1149,7 b' class path(object):'
1149 self.name = name
1149 self.name = name
1150 self.rawloc = rawloc
1150 self.rawloc = rawloc
1151 self.loc = str(u)
1151 self.loc = str(u)
1152 self._pushloc = pushloc
1152 self.pushloc = pushloc
1153
1153
1154 # When given a raw location but not a symbolic name, validate the
1154 # When given a raw location but not a symbolic name, validate the
1155 # location is valid.
1155 # location is valid.
@@ -1164,10 +1164,6 b' class path(object):'
1164 one)."""
1164 one)."""
1165 return os.path.isdir(os.path.join(path, '.hg'))
1165 return os.path.isdir(os.path.join(path, '.hg'))
1166
1166
1167 @property
1168 def pushloc(self):
1169 return self._pushloc or self.loc
1170
1171 # we instantiate one globally shared progress bar to avoid
1167 # we instantiate one globally shared progress bar to avoid
1172 # competing progress bars when multiple UI objects get created
1168 # competing progress bars when multiple UI objects get created
1173 _progresssingleton = None
1169 _progresssingleton = None
General Comments 0
You need to be logged in to leave comments. Login now