Bug 3692 - hg push should provide hint when no paths configured
Summary: hg push should provide hint when no paths configured
Status: RESOLVED FIXED
Alias: None
Product: Mercurial
Classification: Unclassified
Component: Mercurial (show other bugs)
Version: unspecified
Hardware: PC Linux
: normal feature
Assignee: Bugzilla
URL:
Keywords: easy
Depends on:
Blocks:
 
Reported: 2012-11-06 12:13 UTC by Konstantine Rybnikov
Modified: 2014-07-19 14:17 UTC (History)
3 users (show)

See Also:
Python Version: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Konstantine Rybnikov 2012-11-06 12:13 UTC
Hi! One thing that's good about TheOtherDVCS (tm) is that whenever you get stuck, it says concrete steps you should follow (e.g. things you need to put into your config file).

I just initialized new repo via "hg init", commited few things, then I decided to put that repo into bitbucket. So I created bitbucket project and pushed into that "hg push https://k_bx@bitbucket.org/k_bx/reponame". And after that, next time I wanted to push new commits, I just did "hg push" and got error:

➤ hg push
pushing to default-push
abort: repository default-push not found!

So, only thing after this error-message that I'm left with is either:
1. google
2. look at another project's config (which I did)

What I suggest is to have this:

➤ hg push
pushing to default-push
abort: repository default-push not found!
Possible fix: put

[paths]
default = <path to your repo>

into your repository's .hg/hgrc config file.


What do you think?
Comment 1 Pierre-Yves David 2012-11-06 12:20 UTC
We usually add a small hint after error message (hidden with --quiet)

Here is could be

abort: repository default-push not found!
(see path section of "hg help config")
Comment 2 Konstantine Rybnikov 2012-11-06 12:27 UTC
Yes, it is already "not bad". It's just that in situations like this one it is so much simpler to have concrete piece of text and concrete file to put it into, that it really matters.

After having this kind of experience (and also reading about that as one of 2 mercurials' downsides (second is default "non-batteries" configuration) in some blogposts) I am more than sure that it's a wonderful idea.

By providing user with this piece of text you:

1. immediately solve user's problem
2. give user understanding where repo-specific config file is located
3. give user understanding which format repo configuration has

and he didn't had to read single "full reference"! That's fantastic advantage.
Comment 3 Matt Mackall 2012-11-06 17:07 UTC
We should probably mention 'default' rather than 'default-push' here too.
Comment 4 HG Bot 2014-02-24 19:45 UTC
Fixed by http://selenic.com/repo/hg/rev/c4f45ce85351
anuraggoel <anurag.dsps@gmail.com>
push: provide a hint when no paths in configured (issue3692)

When user type "hg push" command then this patch helps user by
providing hint if no default path is configured.

Second patch is the test coverage, to test the change behaviour of
first patch.

(please test the fix)