diff options
Diffstat (limited to 'tests/test-hgrc.t')
-rw-r--r-- | tests/test-hgrc.t | 82 |
1 files changed, 34 insertions, 48 deletions
diff --git a/tests/test-hgrc.t b/tests/test-hgrc.t index 65434ac..79c078a 100644 --- a/tests/test-hgrc.t +++ b/tests/test-hgrc.t @@ -1,24 +1,15 @@ -hide outer repo - $ hg init - Use hgrc within $TESTTMP $ HGRCPATH=`pwd`/hgrc $ export HGRCPATH -Use an alternate var for scribbling on hgrc to keep check-code from -complaining about the important settings we may be overwriting: - - $ HGRC=`pwd`/hgrc - $ export HGRC - Basic syntax error - $ echo "invalid" > $HGRC + $ echo "invalid" > $HGRCPATH $ hg version hg: parse error at $TESTTMP/hgrc:1: invalid [255] - $ echo "" > $HGRC + $ echo "" > $HGRCPATH Issue1199: Can't use '%' in hgrc (eg url encoded username) @@ -29,36 +20,36 @@ Issue1199: Can't use '%' in hgrc (eg url encoded username) $ cd foobar $ cat .hg/hgrc [paths] - default = $TESTTMP/foo%bar (glob) + default = $TESTTMP/foo%bar $ hg paths - default = $TESTTMP/foo%bar (glob) + default = $TESTTMP/foo%bar $ hg showconfig - bundle.mainreporoot=$TESTTMP/foobar (glob) - paths.default=$TESTTMP/foo%bar (glob) + bundle.mainreporoot=$TESTTMP/foobar + paths.default=$TESTTMP/foo%bar $ cd .. issue1829: wrong indentation - $ echo '[foo]' > $HGRC - $ echo ' x = y' >> $HGRC + $ echo '[foo]' > $HGRCPATH + $ echo ' x = y' >> $HGRCPATH $ hg version hg: parse error at $TESTTMP/hgrc:2: x = y [255] $ python -c "print '[foo]\nbar = a\n b\n c \n de\n fg \nbaz = bif cb \n'" \ - > > $HGRC + > > $HGRCPATH $ hg showconfig foo foo.bar=a\nb\nc\nde\nfg foo.baz=bif cb $ FAKEPATH=/path/to/nowhere $ export FAKEPATH - $ echo '%include $FAKEPATH/no-such-file' > $HGRC + $ echo '%include $FAKEPATH/no-such-file' > $HGRCPATH $ hg version Mercurial Distributed SCM (version *) (glob) (see http://mercurial.selenic.com for more information) - Copyright (C) 2005-2012 Matt Mackall and others + Copyright (C) 2005-2011 Matt Mackall and others This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. $ unset FAKEPATH @@ -66,7 +57,6 @@ issue1829: wrong indentation make sure global options given on the cmdline take precedence $ hg showconfig --config ui.verbose=True --quiet - bundle.mainreporoot=$TESTTMP ui.verbose=False ui.debug=False ui.quiet=True @@ -85,8 +75,8 @@ username expansion $ FAKEUSER='John Doe' $ export FAKEUSER - $ echo '[ui]' > $HGRC - $ echo 'username = $FAKEUSER' >> $HGRC + $ echo '[ui]' > $HGRCPATH + $ echo 'username = $FAKEUSER' >> $HGRCPATH $ hg init usertest $ cd usertest @@ -97,7 +87,6 @@ username expansion $ cd .. $ hg showconfig - bundle.mainreporoot=$TESTTMP ui.username=$FAKEUSER $ unset FAKEUSER @@ -106,10 +95,10 @@ username expansion showconfig with multiple arguments - $ echo "[alias]" > $HGRC - $ echo "log = log -g" >> $HGRC - $ echo "[defaults]" >> $HGRC - $ echo "identify = -n" >> $HGRC + $ echo "[alias]" > $HGRCPATH + $ echo "log = log -g" >> $HGRCPATH + $ echo "[defaults]" >> $HGRCPATH + $ echo "identify = -n" >> $HGRCPATH $ hg showconfig alias defaults alias.log=log -g defaults.identify=-n @@ -122,26 +111,27 @@ showconfig with multiple arguments HGPLAIN - $ echo "[ui]" > $HGRC - $ echo "debug=true" >> $HGRC - $ echo "fallbackencoding=ASCII" >> $HGRC - $ echo "quiet=true" >> $HGRC - $ echo "slash=true" >> $HGRC - $ echo "traceback=true" >> $HGRC - $ echo "verbose=true" >> $HGRC - $ echo "style=~/.hgstyle" >> $HGRC - $ echo "logtemplate={node}" >> $HGRC - $ echo "[defaults]" >> $HGRC - $ echo "identify=-n" >> $HGRC - $ echo "[alias]" >> $HGRC - $ echo "log=log -g" >> $HGRC + $ cd .. + $ p=`pwd` + $ echo "[ui]" > $HGRCPATH + $ echo "debug=true" >> $HGRCPATH + $ echo "fallbackencoding=ASCII" >> $HGRCPATH + $ echo "quiet=true" >> $HGRCPATH + $ echo "slash=true" >> $HGRCPATH + $ echo "traceback=true" >> $HGRCPATH + $ echo "verbose=true" >> $HGRCPATH + $ echo "style=~/.hgstyle" >> $HGRCPATH + $ echo "logtemplate={node}" >> $HGRCPATH + $ echo "[defaults]" >> $HGRCPATH + $ echo "identify=-n" >> $HGRCPATH + $ echo "[alias]" >> $HGRCPATH + $ echo "log=log -g" >> $HGRCPATH customized hgrc $ hg showconfig read config from: $TESTTMP/hgrc $TESTTMP/hgrc:13: alias.log=log -g - none: bundle.mainreporoot=$TESTTMP $TESTTMP/hgrc:11: defaults.identify=-n $TESTTMP/hgrc:2: ui.debug=true $TESTTMP/hgrc:3: ui.fallbackencoding=ASCII @@ -157,7 +147,6 @@ plain hgrc $ HGPLAIN=; export HGPLAIN $ hg showconfig --config ui.traceback=True --debug read config from: $TESTTMP/hgrc - none: bundle.mainreporoot=$TESTTMP none: ui.traceback=True none: ui.verbose=False none: ui.debug=True @@ -169,13 +158,12 @@ plain mode with exceptions > def uisetup(ui): > ui.write('plain: %r\n' % ui.plain()) > EOF - $ echo "[extensions]" >> $HGRC - $ echo "plain=./plain.py" >> $HGRC + $ echo "[extensions]" >> $HGRCPATH + $ echo "plain=./plain.py" >> $HGRCPATH $ HGPLAINEXCEPT=; export HGPLAINEXCEPT $ hg showconfig --config ui.traceback=True --debug plain: True read config from: $TESTTMP/hgrc - none: bundle.mainreporoot=$TESTTMP $TESTTMP/hgrc:15: extensions.plain=./plain.py none: ui.traceback=True none: ui.verbose=False @@ -185,7 +173,6 @@ plain mode with exceptions $ hg showconfig --config ui.traceback=True --debug plain: True read config from: $TESTTMP/hgrc - none: bundle.mainreporoot=$TESTTMP $TESTTMP/hgrc:15: extensions.plain=./plain.py none: ui.traceback=True none: ui.verbose=False @@ -195,7 +182,6 @@ plain mode with exceptions $ hg showconfig --config ui.traceback=True --debug plain: True read config from: $TESTTMP/hgrc - none: bundle.mainreporoot=$TESTTMP $TESTTMP/hgrc:15: extensions.plain=./plain.py none: ui.traceback=True none: ui.verbose=False |