[PATCH 2 of 2] commands.push: use "pushloc" path attribute

Augie Fackler raf at durin42.com
Mon Aug 24 09:04:52 CDT 2015


On Sat, Aug 22, 2015 at 10:03:56AM -0700, Gregory Szorc wrote:
> # HG changeset patch
> # User Gregory Szorc <gregory.szorc at gmail.com>
> # Date 1439017961 25200
> #      Sat Aug 08 00:12:41 2015 -0700
> # Node ID c75afcfc267d5115d4e3ca511ab15feebe0ea98e
> # Parent  1ff7d2d55194e14ff90094009e75d0beb6719232
> commands.push: use "pushloc" path attribute

Sure, queued.

>
> Path instances now have a "pushloc" attribute that exposes the path
> to be used for pushing. The "default-push" path is automatically
> captured in the "pushloc" attribute of the "default" path.
>
> Drop references to "default-push" and use the "pushloc" attribute
> for looking up where to push to.
>
> diff --git a/mercurial/commands.py b/mercurial/commands.py
> --- a/mercurial/commands.py
> +++ b/mercurial/commands.py
> @@ -5273,13 +5273,13 @@ def push(ui, repo, dest=None, **opts):
>                  # if we try to push a deleted bookmark, translate it to null
>                  # this lets simultaneous -r, -b options continue working
>                  opts.setdefault('rev', []).append("null")
>
> -    path = ui.paths.getpath(dest or 'default-push', default='default')
> +    path = ui.paths.getpath(dest, default='default')
>      if not path:
>          raise util.Abort(_('default repository not configured!'),
>                           hint=_('see the "path" section in "hg help config"'))
> -    dest, branches = path.loc, (path.branch, opts.get('branch') or [])
> +    dest, branches = path.pushloc, (path.branch, opts.get('branch') or [])
>      ui.status(_('pushing to %s\n') % util.hidepassword(dest))
>      revs, checkout = hg.addbranchrevs(repo, repo, branches, opts.get('rev'))
>      other = hg.peer(repo, opts, dest)
>
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> https://selenic.com/mailman/listinfo/mercurial-devel


More information about the Mercurial-devel mailing list