Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/context.py @ 44975:b2e5ec0c596b
context: fix creation of ProgrammingError to not use non-existent field
Differential Revision: https://phab.mercurial-scm.org/D8606
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Wed, 03 Jun 2020 12:04:38 -0700 |
parents | 61719b9658b1 |
children | 4c1d39215034 |
comparison
equal
deleted
inserted
replaced
44974:33ef8841da62 | 44975:b2e5ec0c596b |
---|---|
2320 if self.isdirty(path): | 2320 if self.isdirty(path): |
2321 if self._cache[path][b'exists']: | 2321 if self._cache[path][b'exists']: |
2322 return self._cache[path][b'flags'] | 2322 return self._cache[path][b'flags'] |
2323 else: | 2323 else: |
2324 raise error.ProgrammingError( | 2324 raise error.ProgrammingError( |
2325 b"No such file or directory: %s" % self._path | 2325 b"No such file or directory: %s" % path |
2326 ) | 2326 ) |
2327 else: | 2327 else: |
2328 return self._wrappedctx[path].flags() | 2328 return self._wrappedctx[path].flags() |
2329 | 2329 |
2330 def __contains__(self, key): | 2330 def __contains__(self, key): |
2437 if self.isdirty(path): | 2437 if self.isdirty(path): |
2438 if self._cache[path][b'exists']: | 2438 if self._cache[path][b'exists']: |
2439 return len(self._cache[path][b'data']) | 2439 return len(self._cache[path][b'data']) |
2440 else: | 2440 else: |
2441 raise error.ProgrammingError( | 2441 raise error.ProgrammingError( |
2442 b"No such file or directory: %s" % self._path | 2442 b"No such file or directory: %s" % path |
2443 ) | 2443 ) |
2444 return self._wrappedctx[path].size() | 2444 return self._wrappedctx[path].size() |
2445 | 2445 |
2446 def tomemctx( | 2446 def tomemctx( |
2447 self, | 2447 self, |