[PATCH V2] push: provide a hint when no paths in configured (issue3692)

Anurag Goel anurag.dsps at gmail.com
Sat Feb 15 12:32:46 CST 2014


# HG changeset patch
# User anuraggoel <anurag.dsps at gmail.com>
# Date 1392488934 -19800
#      Sat Feb 15 23:58:54 2014 +0530
# Node ID 76c749d59a82462328f194708c63259d61fc32f1
# Parent  c3f90f494d184aa611b9e3d4d3c6f28f8354cbe5
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.

diff -r c3f90f494d18 -r 76c749d59a82 mercurial/commands.py
--- a/mercurial/commands.py	Fri Feb 14 03:06:44 2014 +0530
+++ b/mercurial/commands.py	Sat Feb 15 23:58:54 2014 +0530
@@ -4722,7 +4722,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)
+    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:
         revs = [repo.lookup(r) for r in scmutil.revrange(repo, revs)]
 


More information about the Mercurial-devel mailing list