comparison hgext/keyword.py @ 8027:9c7ca86fc658

expand "repo" to "repository" in help texts
author Martin Geisler <mg@lazybytes.net>
date Tue, 07 Apr 2009 22:58:05 +0200
parents b83a11536fc6
children 67efe5e3b0fb
comparison
equal deleted inserted replaced
8026:683d8ebcf434 8027:9c7ca86fc658
50 # expand keywords in every python file except those matching "x*" 50 # expand keywords in every python file except those matching "x*"
51 **.py = 51 **.py =
52 x* = ignore 52 x* = ignore
53 53
54 Note: the more specific you are in your filename patterns 54 Note: the more specific you are in your filename patterns
55 the less you lose speed in huge repos. 55 the less you lose speed in huge repositories.
56 56
57 For [keywordmaps] template mapping and expansion demonstration and 57 For [keywordmaps] template mapping and expansion demonstration and
58 control run "hg kwdemo". 58 control run "hg kwdemo".
59 59
60 An additional date template filter {date|utcdate} is provided. 60 An additional date template filter {date|utcdate} is provided.
297 msg = 'hg keyword config and expansion example' 297 msg = 'hg keyword config and expansion example'
298 kwstatus = 'current' 298 kwstatus = 'current'
299 fn = 'demo.txt' 299 fn = 'demo.txt'
300 branchname = 'demobranch' 300 branchname = 'demobranch'
301 tmpdir = tempfile.mkdtemp('', 'kwdemo.') 301 tmpdir = tempfile.mkdtemp('', 'kwdemo.')
302 ui.note(_('creating temporary repo at %s\n') % tmpdir) 302 ui.note(_('creating temporary repository at %s\n') % tmpdir)
303 repo = localrepo.localrepository(ui, tmpdir, True) 303 repo = localrepo.localrepository(ui, tmpdir, True)
304 ui.setconfig('keyword', fn, '') 304 ui.setconfig('keyword', fn, '')
305 if args or opts.get('rcfile'): 305 if args or opts.get('rcfile'):
306 kwstatus = 'custom' 306 kwstatus = 'custom'
307 if opts.get('rcfile'): 307 if opts.get('rcfile'):
351 ui.note('hg -R "%s" ci -m "%s"\n' % (tmpdir, msg)) 351 ui.note('hg -R "%s" ci -m "%s"\n' % (tmpdir, msg))
352 repo.commit(text=msg) 352 repo.commit(text=msg)
353 fmt = ui.verbose and ' in %s' % path or '' 353 fmt = ui.verbose and ' in %s' % path or ''
354 demostatus('%s keywords expanded%s' % (kwstatus, fmt)) 354 demostatus('%s keywords expanded%s' % (kwstatus, fmt))
355 ui.write(repo.wread(fn)) 355 ui.write(repo.wread(fn))
356 ui.debug(_('\nremoving temporary repo %s\n') % tmpdir) 356 ui.debug(_('\nremoving temporary repository %s\n') % tmpdir)
357 shutil.rmtree(tmpdir, ignore_errors=True) 357 shutil.rmtree(tmpdir, ignore_errors=True)
358 358
359 def expand(ui, repo, *pats, **opts): 359 def expand(ui, repo, *pats, **opts):
360 '''expand keywords in working directory 360 '''expand keywords in working directory
361 361