Mercurial > public > mercurial-scm > hg
comparison mercurial/context.py @ 42288:cdcebc897529
overlaycontext: allow calling copydata() on clean context
We should just report no copy if the context is clean.
Differential Revision: https://phab.mercurial-scm.org/D6358
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Fri, 10 May 2019 11:03:54 -0700 |
parents | 14589f1989e9 |
children | e79aeb518aa1 |
comparison
equal
deleted
inserted
replaced
42287:5265c7d47213 | 42288:cdcebc897529 |
---|---|
1911 | 1911 |
1912 def copydata(self, path): | 1912 def copydata(self, path): |
1913 if self.isdirty(path): | 1913 if self.isdirty(path): |
1914 return self._cache[path]['copied'] | 1914 return self._cache[path]['copied'] |
1915 else: | 1915 else: |
1916 raise error.ProgrammingError('copydata() called on clean context') | 1916 return None |
1917 | 1917 |
1918 def flags(self, path): | 1918 def flags(self, path): |
1919 if self.isdirty(path): | 1919 if self.isdirty(path): |
1920 if self._cache[path]['exists']: | 1920 if self._cache[path]['exists']: |
1921 return self._cache[path]['flags'] | 1921 return self._cache[path]['flags'] |