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

Anurag Goel anurag.dsps at gmail.com
Tue Feb 11 13:54:26 CST 2014


For the above patch, i have fixed the changes which you told me to do so
and also run the test suits but get some weird result.

When I type "make tests" ,it stuck into some loop but when i test each file
individually, it works fine.

My query is how did you get that i hadn't run the test suite and what do
mean by phrase "just let the Abort command span multiple lines" ?




On Tue, Feb 11, 2014 at 6:10 PM, Mads Kiilerich <mads at kiilerich.com> wrote:

> On 02/11/2014 12:12 PM, Anurag Goel wrote:
>
>> # HG changeset patch
>> # User anuraggoel <anurag.dsps at gmail.com>
>> # Date 1392116931 -19800
>> #      Tue Feb 11 16:38:51 2014 +0530
>> # Node ID 6bda034329f21f522b4bb2498bae4c84f3653569
>> # 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.
>> I also run the code on the test cases this time, all seems to work fine.
>>
>
> This patch is getting better!
>
>
>  diff -r fff0a71f8177 -r 6bda034329f2 mercurial/commands.py
>> --- a/mercurial/commands.py     Thu Feb 06 02:17:48 2014 +0100
>> +++ b/mercurial/commands.py     Tue Feb 11 16:38:51 2014 +0530
>> @@ -4711,7 +4711,16 @@
>>       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:
>> +            error1 = (_("repository default-push not found!"))
>>
>
> Why the extra ()? The 1 suffix also seems odd. I would call it "msg" like
> it is one in at least one or place in that file ... or do like most other
> places and just let the Abort command span multiple lines.
>
>
>  +            hint = _("see the \"path\" section in \"hg help config\"")
>> +            raise util.Abort(error1, hint=hint)
>> +    else:
>> +        other = hg.peer(repo,opts,dest)
>>
>
> This line proves that you haven't run the test suite. Step 9 on
> http://mercurial.selenic.com/wiki/ContributingChanges .
>
> Also, how about adding some test coverage of this? You already got the
> link to http://mercurial.selenic.com/wiki/WritingTests .
>
> One important test case: having a default-path configuration that points
> at a non-existing location.
>
> /Mads
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20140212/79b2f609/attachment.html>


More information about the Mercurial-devel mailing list