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

login
register
mail settings
Submitter Anurag Goel
Date Feb. 11, 2014, 8:58 p.m.
Message ID <CAMq1dJ+xQyD6QyWGuct5wedwTWbOmCxQGQynQ_aL1So_gCQ1Kg@mail.gmail.com>
Download mbox | patch
Permalink /patch/3581/
State Accepted
Headers show

Comments

Anurag Goel - Feb. 11, 2014, 8:58 p.m.
I made the changes in the program as you suggested.

For the following patch , i am still getting into loop when type "make
test" but when i test each file individually, it works fine.

I guess now there is no coding style error then why is it so happening?


         revs = [repo.lookup(r) for r in scmutil.revrange(repo, revs)]




On Tue, Feb 11, 2014 at 11:33 PM, Matt Mackall <mpm@selenic.com> wrote:

> On Wed, 2014-02-12 at 01:24 +0530, Anurag Goel wrote:
> > 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" ?
>
> The test suite runs check-code, which checks your coding style. That
> line contains a coding style error.
>
> You could have written this as:
>
> raise util.Abort(_("some long string...."),
>                  hint=_("some other long string"))
>
> --
> Mathematics is the supreme nostalgia of our time.
>
>
>

Patch

diff -r d98ba4a87427 mercurial/commands.py
--- a/mercurial/commands.py    Mon Feb 10 17:31:26 2014 -0600
+++ b/mercurial/commands.py    Wed Feb 12 02:17:29 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\""))
+    else:
+        other = hg.peer(repo, opts, dest)
     if revs: