##// END OF EJS Templates
keyword: avoid traceback when kwdemo is run outside a repo...
Christian Ebert -
r29634:8421cbeb stable
parent child Browse files
Show More
@@ -412,7 +412,11 b' def demo(ui, repo, *args, **opts):'
412 fn = 'demo.txt'
412 fn = 'demo.txt'
413 tmpdir = tempfile.mkdtemp('', 'kwdemo.')
413 tmpdir = tempfile.mkdtemp('', 'kwdemo.')
414 ui.note(_('creating temporary repository at %s\n') % tmpdir)
414 ui.note(_('creating temporary repository at %s\n') % tmpdir)
415 repo = localrepo.localrepository(repo.baseui, tmpdir, True)
415 if repo is None:
416 baseui = ui
417 else:
418 baseui = repo.baseui
419 repo = localrepo.localrepository(baseui, tmpdir, True)
416 ui.setconfig('keyword', fn, '', 'keyword')
420 ui.setconfig('keyword', fn, '', 'keyword')
417 svn = ui.configbool('keywordset', 'svn')
421 svn = ui.configbool('keywordset', 'svn')
418 # explicitly set keywordset for demo output
422 # explicitly set keywordset for demo output
@@ -1,3 +1,15 b''
1 Run kwdemo outside a repo
2 $ hg -q --config extensions.keyword= --config keywordmaps.Foo="{author|user}" kwdemo
3 [extensions]
4 keyword =
5 [keyword]
6 demo.txt =
7 [keywordset]
8 svn = False
9 [keywordmaps]
10 Foo = {author|user}
11 $Foo: test $
12
1 $ cat <<EOF >> $HGRCPATH
13 $ cat <<EOF >> $HGRCPATH
2 > [extensions]
14 > [extensions]
3 > keyword =
15 > keyword =
General Comments 0
You need to be logged in to leave comments. Login now