##// END OF EJS Templates
overlayworkingctx: add _manifest, files(), added(), removed(), modified()...
Phil Cohen -
r35322:2e1c32a9 default
parent child Browse files
Show More
@@ -2014,6 +2014,43 b' class overlayworkingctx(workingctx):'
2014 else:
2014 else:
2015 return self._wrappedctx[path].data()
2015 return self._wrappedctx[path].data()
2016
2016
2017 @propertycache
2018 def _manifest(self):
2019 parents = self.parents()
2020 man = parents[0].manifest().copy()
2021
2022 flag = self._flagfunc
2023 for path in self.added():
2024 man[path] = addednodeid
2025 man.setflag(path, flag(path))
2026 for path in self.modified():
2027 man[path] = modifiednodeid
2028 man.setflag(path, flag(path))
2029 for path in self.removed():
2030 del man[path]
2031 return man
2032
2033 @propertycache
2034 def _flagfunc(self):
2035 def f(path):
2036 return self._cache[path]['flags']
2037 return f
2038
2039 def files(self):
2040 return sorted(self.added() + self.modified() + self.removed())
2041
2042 def modified(self):
2043 return [f for f in self._cache.keys() if self._cache[f]['exists'] and
2044 self._existsinparent(f)]
2045
2046 def added(self):
2047 return [f for f in self._cache.keys() if self._cache[f]['exists'] and
2048 not self._existsinparent(f)]
2049
2050 def removed(self):
2051 return [f for f in self._cache.keys() if
2052 not self._cache[f]['exists'] and self._existsinparent(f)]
2053
2017 def isinmemory(self):
2054 def isinmemory(self):
2018 return True
2055 return True
2019
2056
General Comments 0
You need to be logged in to leave comments. Login now