##// END OF EJS Templates
verify: lots of refactoring...
verify: lots of refactoring - simplify finding first bad rev - no need to count changesets - add exc function to simplify exception handling - combine checksize and checkversion to checklog - unify missing revlog detection in checklog - add checkentry to consolidate - linkrev lookup - detailed check of linkrev - detailed check of parents - duplicate checking - use checkentry for changelog, manifest, and files - simplify havecl and havemf - track all changesets refering to a manifest - move unnamed file check somewhere more useful - reorder crosschecks - fix filenodes crosscheck and add exception handling - check unpacked size field

File last commit:

r6604:98b6e6f0 default
r6752:e79a8f36 default
Show More
match.py
47 lines | 1.4 KiB | text/x-python | PythonLexer
import util
class _match(object):
def __init__(self, root, cwd, files, mf, ap):
self._root = root
self._cwd = cwd
self._files = files
self._fmap = dict.fromkeys(files)
self._matchfn = mf
self._anypats = ap
def __call__(self, fn):
return self._matchfn(fn)
def __iter__(self):
for f in self._files:
yield f
def bad(self, f, msg):
return True
def dir(self, f):
pass
def missing(self, f):
pass
def exact(self, f):
return f in self._fmap
def rel(self, f):
return util.pathto(self._root, self._cwd, f)
def files(self):
return self._files
def anypats(self):
return self._anypats
class always(_match):
def __init__(self, root, cwd):
_match.__init__(self, root, cwd, [], lambda f: True, False)
class never(_match):
def __init__(self, root, cwd):
_match.__init__(self, root, cwd, [], lambda f: False, False)
class exact(_match):
def __init__(self, root, cwd, files):
_match.__init__(self, root, cwd, files, lambda f: f in files, False)
class match(_match):
def __init__(self, root, cwd, patterns, include, exclude, default):
f, mf, ap = util.matcher(root, cwd, patterns, include, exclude,
None, default)
_match.__init__(self, root, cwd, f, mf, ap)