mercurial/commands.py
changeset 20558 c4f45ce85351
parent 20544 8982a5397687
child 20570 c21e1e3ab915
--- a/mercurial/commands.py	Mon Feb 24 22:42:14 2014 +0100
+++ b/mercurial/commands.py	Tue Feb 25 04:11:11 2014 +0530
@@ -4620,7 +4620,15 @@
     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)
+    try:
+        other = hg.peer(repo, opts, dest)
+    except error.RepoError:
+        if dest == "default-push":
+            raise util.Abort(_("default repository not configured!"),
+                    hint=_('see the "path" section in "hg help config"'))
+        else:
+            raise
+
     if revs:
         revs = [repo.lookup(r) for r in scmutil.revrange(repo, revs)]