Show More
@@ -355,6 +355,9 b' def demo(ui, repo, *args, **opts):' | |||||
355 | ui.note(_('creating temporary repository at %s\n') % tmpdir) |
|
355 | ui.note(_('creating temporary repository at %s\n') % tmpdir) | |
356 | repo = localrepo.localrepository(ui, tmpdir, True) |
|
356 | repo = localrepo.localrepository(ui, tmpdir, True) | |
357 | ui.setconfig('keyword', fn, '') |
|
357 | ui.setconfig('keyword', fn, '') | |
|
358 | svn = ui.configbool('keywordset', 'svn') | |||
|
359 | # explicitly set keywordset for demo output | |||
|
360 | ui.setconfig('keywordset', 'svn', svn) | |||
358 |
|
361 | |||
359 | uikwmaps = ui.configitems('keywordmaps') |
|
362 | uikwmaps = ui.configitems('keywordmaps') | |
360 | if args or opts.get('rcfile'): |
|
363 | if args or opts.get('rcfile'): | |
@@ -362,7 +365,10 b' def demo(ui, repo, *args, **opts):' | |||||
362 | if uikwmaps: |
|
365 | if uikwmaps: | |
363 | ui.status(_('\textending current template maps\n')) |
|
366 | ui.status(_('\textending current template maps\n')) | |
364 | if opts.get('default') or not uikwmaps: |
|
367 | if opts.get('default') or not uikwmaps: | |
365 | ui.status(_('\toverriding default template maps\n')) |
|
368 | if svn: | |
|
369 | ui.status(_('\toverriding default svn keywordset\n')) | |||
|
370 | else: | |||
|
371 | ui.status(_('\toverriding default cvs keywordset\n')) | |||
366 | if opts.get('rcfile'): |
|
372 | if opts.get('rcfile'): | |
367 | ui.readconfig(opts.get('rcfile')) |
|
373 | ui.readconfig(opts.get('rcfile')) | |
368 | if args: |
|
374 | if args: | |
@@ -374,7 +380,10 b' def demo(ui, repo, *args, **opts):' | |||||
374 | ui.readconfig(repo.join('hgrc')) |
|
380 | ui.readconfig(repo.join('hgrc')) | |
375 | kwmaps = dict(ui.configitems('keywordmaps')) |
|
381 | kwmaps = dict(ui.configitems('keywordmaps')) | |
376 | elif opts.get('default'): |
|
382 | elif opts.get('default'): | |
377 | ui.status(_('\n\tconfiguration using default keyword template maps\n')) |
|
383 | if svn: | |
|
384 | ui.status(_('\n\tconfiguration using default svn keywordset\n')) | |||
|
385 | else: | |||
|
386 | ui.status(_('\n\tconfiguration using default cvs keywordset\n')) | |||
378 | kwmaps = _defaultkwmaps(ui) |
|
387 | kwmaps = _defaultkwmaps(ui) | |
379 | if uikwmaps: |
|
388 | if uikwmaps: | |
380 | ui.status(_('\tdisabling current template maps\n')) |
|
389 | ui.status(_('\tdisabling current template maps\n')) | |
@@ -388,6 +397,7 b' def demo(ui, repo, *args, **opts):' | |||||
388 | reposetup(ui, repo) |
|
397 | reposetup(ui, repo) | |
389 | ui.write('[extensions]\nkeyword =\n') |
|
398 | ui.write('[extensions]\nkeyword =\n') | |
390 | demoitems('keyword', ui.configitems('keyword')) |
|
399 | demoitems('keyword', ui.configitems('keyword')) | |
|
400 | demoitems('keywordset', ui.configitems('keywordset')) | |||
391 | demoitems('keywordmaps', kwmaps.iteritems()) |
|
401 | demoitems('keywordmaps', kwmaps.iteritems()) | |
392 | keywords = '$' + '$\n$'.join(sorted(kwmaps.keys())) + '$\n' |
|
402 | keywords = '$' + '$\n$'.join(sorted(kwmaps.keys())) + '$\n' | |
393 | repo.wopener(fn, 'w').write(keywords) |
|
403 | repo.wopener(fn, 'w').write(keywords) |
@@ -17,6 +17,8 b' as it would succeed without uisetup othe' | |||||
17 | keyword = |
|
17 | keyword = | |
18 | [keyword] |
|
18 | [keyword] | |
19 | demo.txt = |
|
19 | demo.txt = | |
|
20 | [keywordset] | |||
|
21 | svn = False | |||
20 | [keywordmaps] |
|
22 | [keywordmaps] | |
21 | Author = {author|user} |
|
23 | Author = {author|user} | |
22 | Date = {date|utcdate} |
|
24 | Date = {date|utcdate} | |
@@ -40,6 +42,8 b' as it would succeed without uisetup othe' | |||||
40 | keyword = |
|
42 | keyword = | |
41 | [keyword] |
|
43 | [keyword] | |
42 | demo.txt = |
|
44 | demo.txt = | |
|
45 | [keywordset] | |||
|
46 | svn = False | |||
43 | [keywordmaps] |
|
47 | [keywordmaps] | |
44 | Branch = {branches} |
|
48 | Branch = {branches} | |
45 | $Branch: demobranch $ |
|
49 | $Branch: demobranch $ | |
@@ -633,6 +637,8 b' Custom keywordmaps as argument to kwdemo' | |||||
633 | b = ignore |
|
637 | b = ignore | |
634 | demo.txt = |
|
638 | demo.txt = | |
635 | i = ignore |
|
639 | i = ignore | |
|
640 | [keywordset] | |||
|
641 | svn = False | |||
636 | [keywordmaps] |
|
642 | [keywordmaps] | |
637 | Xinfo = {author}: {desc} |
|
643 | Xinfo = {author}: {desc} | |
638 | $Xinfo: test: hg keyword configuration and expansion example $ |
|
644 | $Xinfo: test: hg keyword configuration and expansion example $ |
General Comments 0
You need to be logged in to leave comments.
Login now