Patchwork push: hg should provide hint when no paths configured (issue3692)

login
register
mail settings
Submitter Anurag Goel
Date Feb. 10, 2014, 1:49 p.m.
Message ID <801fad142db714852451.1392040194@ubuntu.ubuntu-domain>
Download mbox | patch
Permalink /patch/3539/
State Superseded
Headers show

Comments

Anurag Goel - Feb. 10, 2014, 1:49 p.m.
# HG changeset patch
# User anuraggoel <anurag.dsps@gmail.com>
# Date 1392039359 -19800
#      Mon Feb 10 19:05:59 2014 +0530
# Node ID 801fad142db714852451664453d5670f3f8d20d3
# Parent  fff0a71f8177be4ca634784d8b603c8e4d6c3601
push: hg should provide hint when no paths configured (issue3692)

Hint will be provided to the user if default path is not configured when user type "hg push" command.
Matt Mackall - Feb. 10, 2014, 10:41 p.m.
On Mon, 2014-02-10 at 19:19 +0530, Anurag Goel wrote:
> # HG changeset patch
> # User anuraggoel <anurag.dsps@gmail.com>
> # Date 1392039359 -19800
> #      Mon Feb 10 19:05:59 2014 +0530
> # Node ID 801fad142db714852451664453d5670f3f8d20d3
> # Parent  fff0a71f8177be4ca634784d8b603c8e4d6c3601
> push: hg should provide hint when no paths configured (issue3692)

Did you run the test suite?

(If you had, you would have found two ways this patch was incorrect.)

Patch

diff -r fff0a71f8177 -r 801fad142db7 mercurial/localrepo.py
--- a/mercurial/localrepo.py	Thu Feb 06 02:17:48 2014 +0100
+++ b/mercurial/localrepo.py	Mon Feb 10 19:05:59 2014 +0530
@@ -216,7 +216,9 @@ 
                     requirements.append("generaldelta")
                 requirements = set(requirements)
             else:
-                raise error.RepoError(_("repository %s not found") % path)
+                error = (_("repository %s not found!") % (path))
+                hint = _("see the \"path\" section in \"hg help config\"")
+                raise util.Abort(error, hint=hint)
         elif create:
             raise error.RepoError(_("repository %s already exists") % path)
         else: