changeset 41695:e37bd7ccfee3

remotefilelog: use raw strings when looking for variable names Keys in self.__dict__ and vars() are always str. So we need to use raw strings to ensure lookups work on Python 3. # skip-blame just r'' prefixes Differential Revision: https://phab.mercurial-scm.org/D5957
author Gregory Szorc <gregory.szorc@gmail.com>
date Wed, 13 Feb 2019 16:31:20 -0800
parents 0c7b353ce100
children 3d5543599df8
files hgext/remotefilelog/remotefilectx.py
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/remotefilelog/remotefilectx.py	Thu Jan 10 18:25:18 2019 +0100
+++ b/hgext/remotefilelog/remotefilectx.py	Wed Feb 13 16:31:20 2019 -0800
@@ -39,11 +39,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
             linknode = self._adjustlinknode(self._path, self._filelog,
@@ -102,7 +102,7 @@
         """
         lkr = self.linkrev()
         attrs = vars(self)
-        noctx = not ('_changeid' in attrs or '_changectx' in attrs)
+        noctx = not (r'_changeid' in attrs or r'_changectx' in attrs)
         if noctx or self.rev() == lkr:
             return lkr
         linknode = self._adjustlinknode(self._path, self._filelog,