diff -r d5b04ee8ecf7 -r f58b41f6708b mercurial/commands.py --- a/mercurial/commands.py Mon Sep 01 11:48:55 2014 +0200 +++ b/mercurial/commands.py Wed Aug 13 17:05:48 2014 -0400 @@ -1519,22 +1519,18 @@ if os.path.exists(f): break else: + from config import samplehgrcs + + if opts.get('global'): + samplehgrc = samplehgrcs['global'] + elif opts.get('local'): + samplehgrc = samplehgrcs['local'] + else: + samplehgrc = samplehgrcs['user'] + f = paths[0] fp = open(f, "w") - fp.write( - '# example config (see "hg help config" for more info)\n' - '\n' - '[ui]\n' - '# name and email, e.g.\n' - '# username = Jane Doe \n' - 'username =\n' - '\n' - '[extensions]\n' - '# uncomment these lines to enable some popular extensions\n' - '# (see "hg help extensions" for more info)\n' - '# pager =\n' - '# progress =\n' - '# color =\n') + fp.write(samplehgrc) fp.close() editor = ui.geteditor()