[PATCH 2 of 2] keyword: make kwfiles show deleted files configured for expansion

Christian Ebert blacktrash at gmx.net
Sat Dec 4 08:14:19 CST 2010


# HG changeset patch
# User Christian Ebert <blacktrash at gmx.net>
# Date 1291470245 -3600
# Node ID f3a2bb1e42556b285842ae808195b7d47e83851d
# Parent  69405131c9684c56b6c6f3397fd000deb5877266
keyword: make kwfiles show deleted files configured for expansion

diff --git a/hgext/keyword.py b/hgext/keyword.py
--- a/hgext/keyword.py
+++ b/hgext/keyword.py
@@ -103,6 +103,7 @@
 
 colortable = {
     'kwfiles.enabled': 'green bold',
+    'kwfiles.deleted': 'cyan bold underline',
     'kwfiles.enabledunknown': 'green',
     'kwfiles.ignored': 'bold',
     'kwfiles.ignoredunknown': 'none'
@@ -445,16 +446,17 @@
         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])
-    kwlabels = 'enabled enabledunknown ignored ignoredunknown'.split()
-    kwstates = zip('KkIi', showfiles, kwlabels)
+    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:


More information about the Mercurial-devel mailing list