[PATCH] hg should provide hint when no paths configured

Anurag Goel anurag.dsps at gmail.com
Sun Feb 9 15:04:38 CST 2014


# HG changeset patch
# User anuraggoel <anurag.dsps at gmail.com>
# Date 1391979569 -19800
#      Mon Feb 10 02:29:29 2014 +0530
# Node ID 621cf9216b4a4378314e7ddf5d0ab36c95d46cfd
# Parent  fff0a71f8177be4ca634784d8b603c8e4d6c3601
hg should provide hint when no paths configured

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

Previously when user type the command "hg push" ,it directly push the file into default set path which if congiured in .hgrc file.But now it notifies user with mesaage showing location of default path and also prompt user whether he wants to continue or not.

diff -r fff0a71f8177 -r 621cf9216b4a mercurial/commands.py
--- a/mercurial/commands.py	Thu Feb 06 02:17:48 2014 +0100
+++ b/mercurial/commands.py	Mon Feb 10 02:29:29 2014 +0530
@@ -4707,7 +4707,15 @@
                 # this lets simultaneous -r, -b options continue working
                 opts.setdefault('rev', []).append("null")
 
-    dest = ui.expandpath(dest or 'default-push', dest or 'default')
+    if not dest:           
+        dest=ui.expandpath('default-push','default')
+        if dest != 'default-push':
+            ui.status(_('Your default push location is %s\n') % util.hidepassword(dest))
+            ui.status('choose option to continue pushing [y/n] ')
+            choice=raw_input()
+            if choice == 'n':
+                return 
+
     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'))


More information about the Mercurial-devel mailing list