349 |
349 |
350 |
350 |
351 def shrink(ui, repo, *args): |
351 def shrink(ui, repo, *args): |
352 '''revert expanded keywords in working directory |
352 '''revert expanded keywords in working directory |
353 |
353 |
354 run before changing/disabling active keywords |
354 Run before changing/disabling active keywords |
355 or if you experience problems with "hg import" or "hg merge" |
355 or if you experience problems with "hg import" or "hg merge". |
356 ''' |
356 ''' |
357 # 4th argument sets expansion to False |
357 # 4th argument sets expansion to False |
358 _overwrite(ui, repo, args, False) |
358 _overwrite(ui, repo, args, False) |
359 |
359 |
360 def expand(ui, repo, *args): |
360 def expand(ui, repo, *args): |
361 '''expand keywords in working directory |
361 '''expand keywords in working directory |
362 |
362 |
363 run after (re)enabling keyword expansion |
363 Run after (re)enabling keyword expansion. |
364 ''' |
364 ''' |
365 # 4th argument sets expansion to True |
365 # 4th argument sets expansion to True |
366 _overwrite(ui, repo, args, True) |
366 _overwrite(ui, repo, args, True) |
367 |
367 |
368 def files(ui, repo): |
368 def files(ui, repo): |
369 '''print files currently configured for keyword expansion |
369 '''print files currently configured for keyword expansion |
370 |
370 |
371 crosscheck which files are matched by [keyword] config patterns |
371 Crosscheck which files in working directory |
|
372 are matched by [keyword] config patterns. |
372 ''' |
373 ''' |
373 kwfmatcher = _keywordmatcher(ui, repo) |
374 kwfmatcher = _keywordmatcher(ui, repo) |
374 if kwfmatcher is not None: |
375 if kwfmatcher is not None: |
375 ctx = repo.workingctx() |
376 ctx = repo.workingctx() |
376 man = ctx.manifest() |
377 man = ctx.manifest() |
381 ui.write('\n'.join(files) + '\n') |
382 ui.write('\n'.join(files) + '\n') |
382 |
383 |
383 def demo(ui, repo, *args, **opts): |
384 def demo(ui, repo, *args, **opts): |
384 '''print [keywordmaps] configuration and an expansion example |
385 '''print [keywordmaps] configuration and an expansion example |
385 |
386 |
386 show current, custom, or default keyword template maps and their expansion |
387 Show current, custom, or default keyword template maps |
387 |
388 and their expansion. |
388 extend current configuration by specifying maps as arguments |
389 |
389 and optionally by reading from an additional hgrc file |
390 Extend current configuration by specifying maps as arguments |
390 |
391 and optionally by reading from an additional hgrc file. |
391 override current keyword template maps with "default" option |
392 |
|
393 Override current keyword template maps with "default" option. |
392 ''' |
394 ''' |
393 def _demostatus(stat): |
395 def _demostatus(stat): |
394 ui.status(_('\n\t%s\n') % stat) |
396 ui.status(_('\n\t%s\n') % stat) |
395 |
397 |
396 def _showitems(section, items): |
398 def _showitems(section, items): |