comparison mercurial/config.py @ 22383:f58b41f6708b

config: give more fine-tuned sample hgrcs to this command The hgrc for user config is typically different from the hgrc at the system-wide or repository level. This patch provides different sample hgrcs for each level. Sometimes when copying repos around, the copy or the original don't have a default path yet, so at least for `hg config -l`, this ought to provide a more reasonable default and suggestions of what typically goes there. The actual sample configs go in the config.py file, to minimise clutter. In order to avoid an unnecessary import, the corresponding import for this dictionary is at the file level.
author Jordi Guti?rrez Hermoso <jordigh@octave.org>
date Wed, 13 Aug 2014 17:05:48 -0400
parents 8665c647da6e
children 091306562855
comparison
equal deleted inserted replaced
22382:d5b04ee8ecf7 22383:f58b41f6708b
6 # GNU General Public License version 2 or any later version. 6 # GNU General Public License version 2 or any later version.
7 7
8 from i18n import _ 8 from i18n import _
9 import error, util 9 import error, util
10 import os, errno 10 import os, errno
11
12 samplehgrcs = {
13 'user':
14 """# example user config (see "hg help config" for more info)
15 [ui]
16 # name and email, e.g.
17 # username = Jane Doe <jdoe@example.com>
18 username =
19
20 [extensions]
21 # uncomment these lines to enable some popular extensions
22 # (see "hg help extensions" for more info)
23 #
24 # pager =
25 # progress =
26 # color =""",
27
28 'local':
29 """# example repository config (see "hg help config" for more info)
30 """,
31
32 'global':
33 """# example system-wide hg config (see "hg help config" for more info)
34 """,
35 }
11 36
12 class config(object): 37 class config(object):
13 def __init__(self, data=None): 38 def __init__(self, data=None):
14 self._data = {} 39 self._data = {}
15 self._source = {} 40 self._source = {}