add --hgrc global option

TK Soh teekaysoh at yahoo.com
Tue Sep 27 23:13:25 CDT 2005


My original intention is to hide my proxy password in a slightly better place,
but it should of other use too. Also, this is really just a quick hack, and I
feel it could done in a better way (anyone?)

# HG changeset patch
# User TK Soh <teekaysoh at yahoo.com>
# Node ID 07594df4d66b7e712390ee48ebbdbba2d05d683d
# Parent  51ac9a79f3e5bda2c734106a7a221376f1331066
add --hgrc global option

Use --hgrc to specify additional configuration, which
will be read after the default hgrc files.

diff -r 51ac9a79f3e5 -r 07594df4d66b doc/hg.1.txt
--- a/doc/hg.1.txt	Tue Sep 27 18:30:54 2005 -0700
+++ b/doc/hg.1.txt	Wed Sep 28 11:54:53 2005 +0800
@@ -22,6 +22,9 @@
 
 --cwd::
     change working directory
+
+--hgrc::
+    configuration file
 
 -y, --noninteractive::
     do not prompt, assume 'yes' for any required answers
diff -r 51ac9a79f3e5 -r 07594df4d66b mercurial/commands.py
--- a/mercurial/commands.py	Tue Sep 27 18:30:54 2005 -0700
+++ b/mercurial/commands.py	Wed Sep 28 11:54:53 2005 +0800
@@ -1967,6 +1967,7 @@
 globalopts = [
     ('R', 'repository', "", 'repository root directory'),
     ('', 'cwd', '', 'change working directory'),
+    ('', 'hgrc', '', 'configuration file'),
     ('y', 'noninteractive', None, 'run non-interactively'),
     ('q', 'quiet', None, 'quiet mode'),
     ('v', 'verbose', None, 'verbose mode'),
@@ -2086,6 +2087,9 @@
         u.warn("hg: unknown command '%s'\n" % inst.args[0])
         help_(u, 'shortlist')
         sys.exit(1)
+
+    if options['hgrc']:
+        u.readconfig(file(options['hgrc']))
 
     if options["time"]:
         def get_times():


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


More information about the Mercurial mailing list