##// END OF EJS Templates
walk: use match.bad callback for filetype messages
Matt Mackall -
r8681:26f13326 default
parent child Browse files
Show More
@@ -426,15 +426,14 b' class dirstate(object):'
426 self._ui.warn('%s: %s\n' % (self.pathto(f), msg))
426 self._ui.warn('%s: %s\n' % (self.pathto(f), msg))
427 return False
427 return False
428
428
429 def badtype(f, mode):
429 def badtype(mode):
430 kind = _('unknown')
430 kind = _('unknown')
431 if stat.S_ISCHR(mode): kind = _('character device')
431 if stat.S_ISCHR(mode): kind = _('character device')
432 elif stat.S_ISBLK(mode): kind = _('block device')
432 elif stat.S_ISBLK(mode): kind = _('block device')
433 elif stat.S_ISFIFO(mode): kind = _('fifo')
433 elif stat.S_ISFIFO(mode): kind = _('fifo')
434 elif stat.S_ISSOCK(mode): kind = _('socket')
434 elif stat.S_ISSOCK(mode): kind = _('socket')
435 elif stat.S_ISDIR(mode): kind = _('directory')
435 elif stat.S_ISDIR(mode): kind = _('directory')
436 self._ui.warn(_('%s: unsupported file type (type is %s)\n')
436 return _('unsupported file type (type is %s)') % kind
437 % (self.pathto(f), kind))
438
437
439 ignore = self._ignore
438 ignore = self._ignore
440 dirignore = self._dirignore
439 dirignore = self._dirignore
@@ -502,7 +501,7 b' class dirstate(object):'
502 elif kind == regkind or kind == lnkkind:
501 elif kind == regkind or kind == lnkkind:
503 results[nf] = st
502 results[nf] = st
504 else:
503 else:
505 badtype(ff, kind)
504 badfn(ff, badtype(kind))
506 if nf in dmap:
505 if nf in dmap:
507 results[nf] = None
506 results[nf] = None
508 except OSError, inst:
507 except OSError, inst:
General Comments 0
You need to be logged in to leave comments. Login now