[PATCH] push: hg should provide hint when no paths configured (issue3692)

Augie Fackler raf at durin42.com
Fri Feb 14 11:16:21 CST 2014


On Wed, Feb 12, 2014 at 02:33:50PM +0530, Anurag Goel wrote:
> # HG changeset patch
> # User anuraggoel <anurag.dsps at gmail.com>
> # Date 1392195655 -19800
> #      Wed Feb 12 14:30:55 2014 +0530
> # Node ID b2bf72fc6b1aca8e697e7d00cb1b2eec37cca8d6
> # Parent  d98ba4a87427ce601dd23de8d4f5288cc44fe945
> push: hg should provide hint when no paths configured (issue3692)
>
> I made the changes which mentors told me to do so.
> I also run the "test suits" and it passed perfectly.Please guide me ,what should i do next.
>
> diff -r d98ba4a87427 -r b2bf72fc6b1a mercurial/commands.py
> --- a/mercurial/commands.py	Mon Feb 10 17:31:26 2014 -0600
> +++ b/mercurial/commands.py	Wed Feb 12 14:30:55 2014 +0530
> @@ -4722,7 +4722,14 @@
>      dest, branches = hg.parseurl(dest, opts.get('branch'))
>      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)
> +    if dest == "default-push":
> +        try:
> +            other = hg.peer(repo, opts, dest)
> +        except error.RepoError:
> +            raise util.Abort(_("repository default-push not found!"),
> +                   hint=_("see the \"path\" section in \"hg help config\""))

use single quotes to avoid the \" mess, eg:

_('like "this" to avoid extra escapes')

Other than that, this looks right to me. It'd be good to add a section
to test-push.t that verifies the new behavior works as expected.

> +    else:
> +        other = hg.peer(repo, opts, dest)
>      if revs:
>          revs = [repo.lookup(r) for r in scmutil.revrange(repo, revs)]
>
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel


More information about the Mercurial-devel mailing list