# HG changeset patch # User Christian Ebert # Date 1195043801 -3600 # Node ID 50bb27cfd92674755f0db2e3cce70a360c55bc33 # Parent 5b4039ca6867f813a5341b30f644e269ab854490 (0.9.2compat) kwfiles print code similar to commands.status diff -r 5b4039ca6867 -r 50bb27cfd926 hgkw/keyword.py --- a/hgkw/keyword.py Sat Nov 10 14:33:15 2007 +0100 +++ b/hgkw/keyword.py Wed Nov 14 13:36:41 2007 +0100 @@ -450,15 +450,19 @@ cwd = pats and repo.getcwd() or '' allf = opts['all'] ignore = opts['ignore'] - flag = (allf or ui.verbose) and 1 or 0 - if not ignore: - format = ('%s\n', 'K %s\n')[flag] - for k in kwfiles: - ui.write(format % _pathto(repo, k, cwd)) + if ignore: + kwfstats = () + else: + kwfstats = (('K', kwfiles),) if allf or ignore: - format = ('%s\n', 'I %s\n')[flag] - for i in [f for f in files if f not in kwfiles]: - ui.write(format % _pathto(repo, i, cwd)) + kwfstats += (('I', [f for f in files if f not in kwfiles]),) + for char, filenames in kwfstats: + if allf or ui.verbose: + format = '%s %%s\n' % char + else: + format = '%s\n' + for f in filenames: + ui.write(format % repo.pathto(f, cwd)) def shrink(ui, repo, *pats, **opts): '''revert expanded keywords in working directory