Commit Graph

34 Commits

Author SHA1 Message Date
Matt Mackall
0dce04d2d0 config: discard UTF-8 BOM if found 2012-04-03 11:35:04 -05:00
Pierre-Yves David
3dfd3d6ee3 config: have a way to backup and restore value in config
This is introduce to allow temporary overwriting of a config value while being
able to reinstall the old value once done. The main advantage over using
``config`` and ``setconfig`` is that backup and restore will properly restore
the lack of any config. Restoring the fact that there was no value is important
to allow config user to keep using meaniful default value.

A more naive approach will result in the following scenario::

  Before:
    config(section, item, my_default) --> my_default

  temporal overwrite
    old = config(section, item)
    …
    setconfig(section, item, old)

  After
    config(section, item, my_default) --> None

The first user of this feature should be mq to overwriting minimal phase of
future commit.
2012-01-18 16:52:26 +01:00
Sune Foldager
ec11e30560 config.sortdict: override clear method
Overrides dict.clear. It's not currently used, but was broken for sortdict.
Contributed by Stepan Koltsov <yozh@mx1.ru>
2011-06-20 10:51:37 +02:00
Matt Mackall
eb5cc8dd93 config: undo change of empty line definition
We don't allow spaces in front of comment markers
2011-06-17 15:36:56 -05:00
Matt Mackall
bf73994e3d config: handle comment lines in continuations (issue2854) 2011-06-16 13:24:44 -05:00
Matt Mackall
ebb03b5a77 config: ignore include errors for nonexistent files 2011-05-31 16:00:39 -05:00
Adrian Buehlmann
c639e13569 config: use util.posixfile 2011-03-16 18:48:59 +01:00
Martin Geisler
6a3d9310ab code style: prefer 'is' and 'is not' tests with singletons 2010-11-22 18:15:58 +01:00
Matt Mackall
476998d3a8 error: fix up test-hgrc 2010-06-04 23:04:31 -05:00
Matt Mackall
969c51b3cf error: add new ParseError for various parsing errors 2010-06-04 20:57:26 -05:00
Chad Dombrova
2d1fae5fc2 config: expand hgrc %include paths 2010-05-26 14:03:29 -07:00
Matt Mackall
6bd5cfceca config: handle short continuations (issue1999)
Thanks to Greg Ward for spotting and testing
2010-01-28 23:07:28 -06:00
Matt Mackall
595d66f424 Update license to GPLv2+ 2010-01-19 22:20:08 -06:00
Martin Geisler
46bbcdcea6 config: raise ConfigError on non-existing include files
Before, an %include directive for a non-existing file resulted in an
IOError and a traceback.
2009-12-12 16:46:16 +01:00
Martin Geisler
969ff27288 Merge with crew-stable 2009-09-19 13:55:18 +02:00
Nicolas Dumazet
7626c98965 config: abort on indented non-continuation lines (issue1829)
Previously, as soon as a continuation would be met, "cont" would stay
forever set to True, but "item" was set back to "None".
This caused the continuation code bits to run every time, until the next
"self.get(section, item) + '\n'" which would crash.
2009-09-12 11:17:07 +02:00
Andrey
b2bc363ed9 config: improve code readability 2009-08-12 11:50:27 +02:00
Nicolas Dumazet
7eadbe8d42 for calls expecting bool args, pass bool instead of int
str.splitlines and email.message.as_string both expect a bool argument
defaulting at False: replace f(1) by f(True) and f(0) by f()
2009-07-13 09:50:26 +09:00
Simon Heimberg
09ac1e6c92 separate import lines from mercurial and general python modules 2009-04-28 17:40:46 +02:00
Matt Mackall
ec94003cea config: make remap actually work 2009-05-04 14:21:43 -05:00
Matt Mackall
83d555f0f7 config: add parse interface 2009-04-30 19:22:06 -05:00
Matt Mackall
f3552e4141 config: allow spaces in key portion of items 2009-04-29 20:47:30 -05:00
Martin Geisler
539f6e1aac config: add copyright and license header 2009-04-26 01:56:41 +02:00
Dirkjan Ochtman
80de6974e4 more whitespace cleanup and some other style nits 2009-04-27 12:37:19 +02:00
Matt Mackall
86dab18ddb config: getsource -> source 2009-04-26 16:50:43 -05:00
Matt Mackall
036f77e767 config: add section filter to read
move section filtering out of ui.readconfig
kill section filtering in config.update
2009-04-26 16:50:43 -05:00
Matt Mackall
f74e9a6511 config: deal with spaces at end of line more carefully 2009-04-26 16:50:43 -05:00
Matt Mackall
10af375ad9 ui: less links to parentui 2009-04-26 16:50:43 -05:00
Matt Mackall
1217ed8107 config: add some helper methods 2009-04-26 16:50:43 -05:00
Matt Mackall
9c7f505708 config: split source data out into separate map 2009-04-26 16:50:43 -05:00
Matt Mackall
a85b71443f config: add %unset name support 2009-04-26 16:50:43 -05:00
Matt Mackall
bc6c19544f config: allow including other config files 2009-04-26 16:50:43 -05:00
Matt Mackall
8034ce6ca9 hgweb: use config.config 2009-04-26 16:50:43 -05:00
Matt Mackall
e8b3de6bf8 ui: introduce new config parser 2009-04-23 15:40:10 -05:00