Merge with default stable
authorChristian Ebert <blacktrash@gmx.net>
Sat, 11 Dec 2010 12:49:10 +0100
branchstable
changeset 872 67aaf09289bb
parent 869 d196d4ba75ef (current diff)
parent 871 c2651cd808b7 (diff)
child 876 20db7f6aba9a
Merge with default
--- a/hgkw/keyword.py	Thu Dec 02 09:44:01 2010 +0100
+++ b/hgkw/keyword.py	Sat Dec 11 12:49:10 2010 +0100
@@ -101,6 +101,14 @@
 # names of extensions using dorecord
 recordextensions = 'record'
 
+colortable = {
+    'kwfiles.enabled': 'green bold',
+    'kwfiles.deleted': 'cyan bold underline',
+    'kwfiles.enabledunknown': 'green',
+    'kwfiles.ignored': 'bold',
+    'kwfiles.ignoredunknown': 'none'
+}
+
 # date like in cvs' $Date
 utcdate = lambda x: util.datestr((x[0], 0), '%Y/%m/%d %H:%M:%S')
 # date like in svn's $Date
@@ -111,7 +119,6 @@
 # make keyword tools accessible
 kwtools = {'templater': None, 'hgcmd': ''}
 
-
 def _defaultkwmaps(ui):
     '''Returns default keywordmaps according to keywordset configuration.'''
     templates = {
@@ -439,18 +446,21 @@
         files = sorted(modified + added + clean)
     wctx = repo[None]
     kwfiles = kwt.iskwfile(files, wctx)
+    kwdeleted = kwt.iskwfile(deleted, wctx)
     kwunknown = kwt.iskwfile(unknown, wctx)
     if not opts.get('ignore') or opts.get('all'):
-        showfiles = kwfiles, kwunknown
+        showfiles = kwfiles, kwdeleted, kwunknown
     else:
-        showfiles = [], []
+        showfiles = [], [], []
     if opts.get('all') or opts.get('ignore'):
         showfiles += ([f for f in files if f not in kwfiles],
                       [f for f in unknown if f not in kwunknown])
-    for char, filenames in zip('KkIi', showfiles):
+    kwlabels = 'enabled deleted enabledunknown ignored ignoredunknown'.split()
+    kwstates = zip('K!kIi', showfiles, kwlabels)
+    for char, filenames, kwstate in kwstates:
         fmt = (opts.get('all') or ui.verbose) and '%s %%s\n' % char or '%s\n'
         for f in filenames:
-            ui.write(fmt % repo.pathto(f, cwd))
+            ui.write(fmt % repo.pathto(f, cwd), label='kwfiles.' + kwstate)
 
 def shrink(ui, repo, *pats, **opts):
     '''revert expanded keywords in the working directory