changeset 8681:26f133267cd7

walk: use match.bad callback for filetype messages
author Matt Mackall <mpm@selenic.com>
date Sun, 31 May 2009 17:54:18 -0500
parents b6511055d37b
children cc7da5aae4cd
files mercurial/dirstate.py
diffstat 1 files changed, 3 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/dirstate.py	Sun May 31 17:54:18 2009 -0500
+++ b/mercurial/dirstate.py	Sun May 31 17:54:18 2009 -0500
@@ -426,15 +426,14 @@
             self._ui.warn('%s: %s\n' % (self.pathto(f), msg))
             return False
 
-        def badtype(f, mode):
+        def badtype(mode):
             kind = _('unknown')
             if stat.S_ISCHR(mode): kind = _('character device')
             elif stat.S_ISBLK(mode): kind = _('block device')
             elif stat.S_ISFIFO(mode): kind = _('fifo')
             elif stat.S_ISSOCK(mode): kind = _('socket')
             elif stat.S_ISDIR(mode): kind = _('directory')
-            self._ui.warn(_('%s: unsupported file type (type is %s)\n')
-                          % (self.pathto(f), kind))
+            return _('unsupported file type (type is %s)') % kind
 
         ignore = self._ignore
         dirignore = self._dirignore
@@ -502,7 +501,7 @@
                 elif kind == regkind or kind == lnkkind:
                     results[nf] = st
                 else:
-                    badtype(ff, kind)
+                    badfn(ff, badtype(kind))
                     if nf in dmap:
                         results[nf] = None
             except OSError, inst: