[PATCH V3] push: provide a hint when no paths in configured (issue3692)
Anurag Goel
anurag.dsps at gmail.com
Sat Feb 22 08:14:32 CST 2014
# HG changeset patch
# User anuraggoel <anurag.dsps at gmail.com>
# Date 1393077250 -19800
# Sat Feb 22 19:24:10 2014 +0530
# Node ID b542f30f7b0a71608fa4e43030b35c7226753b87
# Parent 0e2877f8605dcaf4fdf2ab7e0046f1f6f80161dd
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 0e2877f8605d -r b542f30f7b0a mercurial/commands.py
--- a/mercurial/commands.py Sat Feb 15 22:09:32 2014 -0600
+++ b/mercurial/commands.py Sat Feb 22 19:24:10 2014 +0530
@@ -4614,7 +4614,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