It will be called directly by rebase after concluding a node.
Details
Details
- Reviewers
- None
Diff Detail
Diff Detail
- Lint
Lint Skipped - Unit
Unit Tests Skipped
It will be called directly by rebase after concluding a node.
Lint Skipped |
Unit Tests Skipped |
} | } | ||||
If `exists` is True, `flags` must be non-None and 'date' is non-None. If it | If `exists` is True, `flags` must be non-None and 'date' is non-None. If it | ||||
is `False`, the file was deleted. | is `False`, the file was deleted. | ||||
""" | """ | ||||
def __init__(self, repo, wrappedctx): | def __init__(self, repo, wrappedctx): | ||||
super(overlayworkingctx, self).__init__(repo) | super(overlayworkingctx, self).__init__(repo) | ||||
self._repo = repo | self._repo = repo | ||||
self.clean() | |||||
self._wrappedctx = wrappedctx | self._wrappedctx = wrappedctx | ||||
self._clean() | |||||
def data(self, path): | def data(self, path): | ||||
if self.isdirty(path): | if self.isdirty(path): | ||||
if self._cache[path]['exists']: | if self._cache[path]['exists']: | ||||
if self._cache[path]['data']: | if self._cache[path]['data']: | ||||
return self._cache[path]['data'] | return self._cache[path]['data'] | ||||
else: | else: | ||||
# Must fallback here, too, because we only set flags. | # Must fallback here, too, because we only set flags. | ||||
else: | else: | ||||
raise error.ProgrammingError("No such file or directory: %s" % | raise error.ProgrammingError("No such file or directory: %s" % | ||||
self._path) | self._path) | ||||
return self._wrappedctx[path].size() | return self._wrappedctx[path].size() | ||||
def isdirty(self, path): | def isdirty(self, path): | ||||
return path in self._cache | return path in self._cache | ||||
def _clean(self): | def clean(self): | ||||
self._cache = {} | self._cache = {} | ||||
self._writeorder = [] | self._writeorder = [] | ||||
def _markdirty(self, path, exists, data=None, date=None, flags=''): | def _markdirty(self, path, exists, data=None, date=None, flags=''): | ||||
if path not in self._cache: | if path not in self._cache: | ||||
self._writeorder.append(path) | self._writeorder.append(path) | ||||
self._cache[path] = { | self._cache[path] = { |