[PATCH] outgoing: pay attention to `default:pushurl` for bookmarks and subrepos
yuya at tcha.org
Tue May 29 07:35:42 EDT 2018
On Tue, 29 May 2018 00:42:23 -0400, Matt Harbison wrote:
> # HG changeset patch
> # User Matt Harbison <matt_harbison at yahoo.com>
> # Date 1527485794 14400
> # Mon May 28 01:36:34 2018 -0400
> # Node ID 8544cdf89153aa7c0ce5be9c4dfdc052b2bf5d60
> # Parent cc9aa88792fe8daf041521710f52be59c69b79eb
> outgoing: pay attention to `default:pushurl` for bookmarks and subrepos
> The problem here was that `default:pushurl` and `default` get translated to a
> single entry in `ui.paths` named 'default', with an attribute for 'pushloc',
> 'loc', and 'rawloc'. ui.expandpath() then always takes the `rawloc` attribute.
> Maybe the ui.expandpath() API is busted and should be removed? Or maybe
> getpath() should return a copy that adds an attribute reflecting the URL of the
> path chosen?
IIRC, ui.expandpath() is supposed to be superseded by ui.paths API.
> I thought that I could remove the code in hg._outgoing() and pass the location
> resolved in commands.py as `dest`, but unfortunately that code is needed there
> to resolve #branch type URLs. Maybe that should be pulled up to commands.py,
> because I can't see any reasonable behavior for a subrepo path that's
> constructed out of that type of URL.
> The push command already resolves this early, so that works properly. But it
> looks like bundle, histedit, largefiles, patchbomb, and summary use a similar
> pattern, so they are likely similarly affected.
> @@ -3711,6 +3711,13 @@ def outgoing(ui, repo, dest=None, **opts
> Returns 0 if there are outgoing changes, 1 otherwise.
> + # hg._outgoing() needs to re-resolve the path in order to handle #branch
> + # style URLs, so don't overwrite dest.
> + path = ui.paths.getpath(dest, default=('default-push', 'default'))
> + if not path:
> + raise error.Abort(_('default repository not configured!'),
> + hint=_("see 'hg help config.paths'"))
> opts = pycompat.byteskwargs(opts)
> if opts.get('graph'):
> logcmdutil.checkunsupportedgraphflags(, opts)
> @@ -3728,7 +3735,7 @@ def outgoing(ui, repo, dest=None, **opts
> return 0
> if opts.get('bookmarks'):
> - dest = ui.expandpath(dest or 'default-push', dest or 'default')
> + dest = path.pushloc or path.loc
> dest, branches = hg.parseurl(dest, opts.get('branch'))
It isn't your fault, but maybe we shouldn't overwrite 'dest' here?
> @@ -3738,7 +3745,7 @@ def outgoing(ui, repo, dest=None, **opts
> return bookmarks.outgoing(ui, repo, other)
> - repo._subtoppath = ui.expandpath(dest or 'default-push', dest or 'default')
> + repo._subtoppath = path.pushloc or path.loc
> return hg.outgoing(ui, repo, dest, opts)
More information about the Mercurial-devel