mercurial/context.py
changeset 24326 637da5711122
parent 24325 79d9c51488ca
child 24333 5da0eb641881
equal deleted inserted replaced
24325:79d9c51488ca 24326:637da5711122
   605                 # specified pattern is the exact name
   605                 # specified pattern is the exact name
   606                 fset.remove(fn)
   606                 fset.remove(fn)
   607             if match(fn):
   607             if match(fn):
   608                 yield fn
   608                 yield fn
   609         for fn in sorted(fset):
   609         for fn in sorted(fset):
   610             if fn in self._dirs:
   610             if not self.hasdir(fn):
   611                 # specified pattern is a directory
   611                 match.bad(fn, _('no such file in rev %s') % self)
   612                 continue
       
   613             match.bad(fn, _('no such file in rev %s') % self)
       
   614 
   612 
   615     def matches(self, match):
   613     def matches(self, match):
   616         return self.walk(match)
   614         return self.walk(match)
   617 
   615 
   618 class basefilectx(object):
   616 class basefilectx(object):
  1562         match = superself._matchstatus(other, match)
  1560         match = superself._matchstatus(other, match)
  1563         if other != self._repo['.']:
  1561         if other != self._repo['.']:
  1564             def bad(f, msg):
  1562             def bad(f, msg):
  1565                 # 'f' may be a directory pattern from 'match.files()',
  1563                 # 'f' may be a directory pattern from 'match.files()',
  1566                 # so 'f not in ctx1' is not enough
  1564                 # so 'f not in ctx1' is not enough
  1567                 if f not in other and f not in other.dirs():
  1565                 if f not in other and not other.hasdir(f):
  1568                     self._repo.ui.warn('%s: %s\n' %
  1566                     self._repo.ui.warn('%s: %s\n' %
  1569                                        (self._repo.dirstate.pathto(f), msg))
  1567                                        (self._repo.dirstate.pathto(f), msg))
  1570             match.bad = bad
  1568             match.bad = bad
  1571         return match
  1569         return match
  1572 
  1570