comparison mercurial/commands.py @ 20573:02d0d3aa42e3

config: add example config file when -e called with no config
author Matt Mackall <mpm@selenic.com>
date Thu, 27 Feb 2014 14:01:52 -0600
parents c724cb0141ee
children e0e223b0a506
comparison
equal deleted inserted replaced
20572:c724cb0141ee 20573:02d0d3aa42e3
1487 for f in paths: 1487 for f in paths:
1488 if os.path.exists(f): 1488 if os.path.exists(f):
1489 break 1489 break
1490 else: 1490 else:
1491 f = paths[0] 1491 f = paths[0]
1492 fp = open(f, "w")
1493 fp.write(
1494 '# example config (see "hg help config" for more info)\n'
1495 '\n'
1496 '[ui]\n'
1497 '# set this to your full email address\n'
1498 'username =\n'
1499 '\n'
1500 '[extensions]\n'
1501 '# uncomment these lines to enable some popular extensions\n'
1502 '# (see "hg help extensions" for more info)\n'
1503 '# pager =\n'
1504 '# progress =\n'
1505 '# color =\n')
1506 fp.close()
1507
1492 editor = ui.geteditor() 1508 editor = ui.geteditor()
1493 util.system("%s \"%s\"" % (editor, f), 1509 util.system("%s \"%s\"" % (editor, f),
1494 onerr=util.Abort, errprefix=_("edit failed"), 1510 onerr=util.Abort, errprefix=_("edit failed"),
1495 out=ui.fout) 1511 out=ui.fout)
1496 return 1512 return