--- a/hgkw/keyword.py Sat Oct 06 19:55:30 2007 +0200
+++ b/hgkw/keyword.py Sat Oct 06 23:11:40 2007 +0200
@@ -300,6 +300,8 @@
return t2 != text
return revlog.revlog.cmp(self, node, text)
+_nokwfiles = 'no files configured for keyword expansion'
+
def _weedcandidates(ui, man, candidates):
'''Weeds out files that do not match keyword file matcher,
are not tracked, or are links.'''
@@ -312,7 +314,7 @@
def _overwrite(ui, repo, files, expand):
'''Expands/shrinks keywords in working directory.'''
if not hasattr(ui, 'kwfmatcher'):
- ui.warn(_('no files configured for keyword expansion\n'))
+ ui.warn(_('%s\n') % _nokwfiles)
return
bail_if_changed(repo)
wlock = lock = None
@@ -356,14 +358,16 @@
Crosscheck which files in working directory
are matched by [keyword] config patterns.
'''
- if hasattr(ui, 'kwfmatcher'):
- ctx = repo.workingctx()
- man = ctx.manifest().copy()
- for f in ctx.unknown():
- del man[f]
- files = _weedcandidates(ui, man, None)
- files.sort()
- ui.write('\n'.join(files) + '\n')
+ if not hasattr(ui, 'kwfmatcher'):
+ ui.note(_('%s\n') % _nokwfiles)
+ return
+ ctx = repo.workingctx()
+ man = ctx.manifest().copy()
+ for f in ctx.unknown():
+ del man[f]
+ files = _weedcandidates(ui, man, None)
+ files.sort()
+ ui.write('\n'.join(files) + '\n')
def demo(ui, repo, *args, **opts):
'''print [keywordmaps] configuration and an expansion example