##// END OF EJS Templates
strip: make repair.strip transactional to avoid repository corruption...
strip: make repair.strip transactional to avoid repository corruption Uses a transaction instance from the local repository to journal the truncation of revlog files, such that if a strip only partially completes, hg recover will be able to finish the truncate of all the files. The potential unbundling of changes that have been backed up to be restored later will, in case of an error, have to be unbundled manually. The difference is that it will be possible to recover the repository state so the unbundle can actually succeed.

File last commit:

r6834:cbdfd08e default
r8073:e8a28556 default
Show More
match.py
47 lines | 1.4 KiB | text/x-python | PythonLexer
Matt Mackall
walk: introduce match objects
r6576 import util
Matt Mackall
match: cleanup match classes a bit
r6604 class _match(object):
def __init__(self, root, cwd, files, mf, ap):
Matt Mackall
walk: introduce match objects
r6576 self._root = root
self._cwd = cwd
Matt Mackall
match: cleanup match classes a bit
r6604 self._files = files
self._fmap = dict.fromkeys(files)
Matt Mackall
dirstate.walk: speed up calling match function
r6834 self.matchfn = mf
Matt Mackall
walk: introduce match objects
r6576 self._anypats = ap
def __call__(self, fn):
Matt Mackall
dirstate.walk: speed up calling match function
r6834 return self.matchfn(fn)
Matt Mackall
walk: introduce match objects
r6576 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
Matt Mackall
match: add always, never, and exact methods
r6596
Matt Mackall
match: cleanup match classes a bit
r6604 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)
Matt Mackall
match: add always, never, and exact methods
r6596
Matt Mackall
match: cleanup match classes a bit
r6604 class exact(_match):
def __init__(self, root, cwd, files):
_match.__init__(self, root, cwd, files, lambda f: f in files, False)
Matt Mackall
match: add always, never, and exact methods
r6596
Matt Mackall
match: cleanup match classes a bit
r6604 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)