# HG changeset patch # User Christian Ebert # Date 1246294509 -7200 # Node ID 2b1565ab7db30a4e7150b831903cd9f0c8890cf4 # Parent 748c766e642467c6ad92979bc2c472c62172b746 (0.9.2compat) lowercase status flags of untracked files in kwfile output Improve help as well, like in default branch. diff -r 748c766e6424 -r 2b1565ab7db3 hgkw/keyword.py --- a/hgkw/keyword.py Sat Jun 27 15:58:46 2009 +0200 +++ b/hgkw/keyword.py Mon Jun 29 18:55:09 2009 +0200 @@ -536,27 +536,35 @@ _kwfwrite(ui, repo, True, *pats, **opts) def files(ui, repo, *pats, **opts): - '''print filenames configured for keyword expansion + '''show files configured for keyword expansion - Check which filenames in the working directory are matched by the + List which files in the working directory are matched by the [keyword] configuration patterns. Useful to prevent inadvertent keyword expansion and to speed up - execution by including only filenames that are actual candidates + execution by including only files that are actual candidates for expansion. - Use -u/--untracked to display untracked filenames as well. + See "hg help keyword" on how to construct patterns both for + inclusion and exclusion of files. + + Use -u/--untracked to list untracked files as well. + + With -a/--all and -v/--verbose the codes used to show the status + of files are: + K = keyword expansion candidate + k = keyword expansion candidate (untracked) + I = ignored + i = ignored (untracked) ''' kwt = kwtools['templater'] status = _status(ui, repo, kwt, opts.get('untracked'), *pats, **opts) modified, added, removed, deleted, unknown, ignored, clean = status try: # f67d1468ac50 - files = util.sort(modified + added + clean + unknown) + files = util.sort(modified + added + clean) except AttributeError: files = modified + added + clean - if opts.get('untracked'): - files += unknown files.sort() try: # f6c00b17387c @@ -571,10 +579,13 @@ mf = wctx.manifest() islink = mf.linkf kwfiles = [f for f in files if kwt.iskwfile(f, islink)] + kwuntracked = [f for f in unknown if kwt.iskwfile(f, islink)] cwd = pats and repo.getcwd() or '' - kwfstats = not opts.get('ignore') and (('K', kwfiles),) or () + kwfstats = (not opts.get('ignore') and + (('K', kwfiles), ('k', kwuntracked),) or ()) if opts.get('all') or opts.get('ignore'): - kwfstats += (('I', [f for f in files if f not in kwfiles]),) + kwfstats += (('I', [f for f in files if f not in kwfiles]), + ('i', [f for f in unknown if f not in kwuntracked]),) for char, filenames in kwfstats: fmt = (opts.get('all') or ui.verbose) and '%s %%s\n' % char or '%s\n' for f in filenames: diff -r 748c766e6424 -r 2b1565ab7db3 tests/test-keyword.out --- a/tests/test-keyword.out Sat Jun 27 15:58:46 2009 +0200 +++ b/tests/test-keyword.out Mon Jun 29 18:55:09 2009 +0200 @@ -38,7 +38,7 @@ Or, better, use bundle/unbundle to share changes. kwdemo print [keywordmaps] configuration and an expansion example kwexpand expand keywords in the working directory - kwfiles print filenames configured for keyword expansion + kwfiles show files configured for keyword expansion kwshrink revert expanded keywords in the working directory % hg kwdemo [extensions]