Mercurial > hg
comparison hgext/keyword.py @ 28458:311472301ef3
keyword: compact writing of temporary kwdemo hgrc
author | Christian Ebert <blacktrash@gmx.net> |
---|---|
date | Fri, 11 Mar 2016 08:27:11 +0000 |
parents | a7b453b47726 |
children | 9a6fa1d93bc8 |
comparison
equal
deleted
inserted
replaced
28457:e6310cdcc4d0 | 28458:311472301ef3 |
---|---|
428 ui.status(_('\toverriding default cvs keywordset\n')) | 428 ui.status(_('\toverriding default cvs keywordset\n')) |
429 if opts.get('rcfile'): | 429 if opts.get('rcfile'): |
430 ui.readconfig(opts.get('rcfile')) | 430 ui.readconfig(opts.get('rcfile')) |
431 if args: | 431 if args: |
432 # simulate hgrc parsing | 432 # simulate hgrc parsing |
433 rcmaps = ['[keywordmaps]\n'] + [a + '\n' for a in args] | 433 rcmaps = '[keywordmaps]\n%s\n' % '\n'.join(args) |
434 fp = repo.vfs('hgrc', 'w') | 434 repo.vfs.write('hgrc', rcmaps) |
435 fp.writelines(rcmaps) | |
436 fp.close() | |
437 ui.readconfig(repo.join('hgrc')) | 435 ui.readconfig(repo.join('hgrc')) |
438 kwmaps = dict(ui.configitems('keywordmaps')) | 436 kwmaps = dict(ui.configitems('keywordmaps')) |
439 elif opts.get('default'): | 437 elif opts.get('default'): |
440 if svn: | 438 if svn: |
441 ui.status(_('\n\tconfiguration using default svn keywordset\n')) | 439 ui.status(_('\n\tconfiguration using default svn keywordset\n')) |