Mercurial > public > mercurial-scm > hg-stable
diff mercurial/context.py @ 32197:2cfdf5241096
py3: use raw strings while accessing class.__dict__
The keys of class.__dict__ are unicodes on Python 3.
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Fri, 28 Apr 2017 01:13:07 +0530 |
parents | a457da5296a5 |
children | 8a660af9dbe3 |
line wrap: on
line diff
--- a/mercurial/context.py Tue Apr 25 01:52:30 2017 +0530 +++ b/mercurial/context.py Fri Apr 28 01:13:07 2017 +0530 @@ -257,13 +257,13 @@ return changectx(self._repo, nullrev) def _fileinfo(self, path): - if '_manifest' in self.__dict__: + if r'_manifest' in self.__dict__: try: return self._manifest[path], self._manifest.flags(path) except KeyError: raise error.ManifestLookupError(self._node, path, _('not found in manifest')) - if '_manifestdelta' in self.__dict__ or path in self.files(): + if r'_manifestdelta' in self.__dict__ or path in self.files(): if path in self._manifestdelta: return (self._manifestdelta[path], self._manifestdelta.flags(path)) @@ -697,11 +697,11 @@ @propertycache def _changeid(self): - if '_changeid' in self.__dict__: + if r'_changeid' in self.__dict__: return self._changeid - elif '_changectx' in self.__dict__: + elif r'_changectx' in self.__dict__: return self._changectx.rev() - elif '_descendantrev' in self.__dict__: + elif r'_descendantrev' in self.__dict__: # this file context was created from a revision with a known # descendant, we can (lazily) correct for linkrev aliases return self._adjustlinkrev(self._descendantrev) @@ -710,7 +710,7 @@ @propertycache def _filenode(self): - if '_fileid' in self.__dict__: + if r'_fileid' in self.__dict__: return self._filelog.lookup(self._fileid) else: return self._changectx.filenode(self._path) @@ -1396,7 +1396,7 @@ return [] def flags(self, path): - if '_manifest' in self.__dict__: + if r'_manifest' in self.__dict__: try: return self._manifest.flags(path) except KeyError: