##// END OF EJS Templates
config: give more fine-tuned sample hgrcs to this command...
Jordi Gutiérrez Hermoso -
r22383:f58b41f6 default
parent child Browse files
Show More
@@ -1519,22 +1519,18 b' def config(ui, repo, *values, **opts):'
1519 if os.path.exists(f):
1519 if os.path.exists(f):
1520 break
1520 break
1521 else:
1521 else:
1522 from config import samplehgrcs
1523
1524 if opts.get('global'):
1525 samplehgrc = samplehgrcs['global']
1526 elif opts.get('local'):
1527 samplehgrc = samplehgrcs['local']
1528 else:
1529 samplehgrc = samplehgrcs['user']
1530
1522 f = paths[0]
1531 f = paths[0]
1523 fp = open(f, "w")
1532 fp = open(f, "w")
1524 fp.write(
1533 fp.write(samplehgrc)
1525 '# example config (see "hg help config" for more info)\n'
1526 '\n'
1527 '[ui]\n'
1528 '# name and email, e.g.\n'
1529 '# username = Jane Doe <jdoe@example.com>\n'
1530 'username =\n'
1531 '\n'
1532 '[extensions]\n'
1533 '# uncomment these lines to enable some popular extensions\n'
1534 '# (see "hg help extensions" for more info)\n'
1535 '# pager =\n'
1536 '# progress =\n'
1537 '# color =\n')
1538 fp.close()
1534 fp.close()
1539
1535
1540 editor = ui.geteditor()
1536 editor = ui.geteditor()
@@ -9,6 +9,31 b' from i18n import _'
9 import error, util
9 import error, util
10 import os, errno
10 import os, errno
11
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 }
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 = {}
General Comments 0
You need to be logged in to leave comments. Login now