changeset 36639:334da951a50b

py3: fix some membership tests on linkrev adjustment
author Yuya Nishihara <yuya@tcha.org>
date Sat, 03 Mar 2018 09:19:34 -0500
parents 159b04de5fb0
children c77c925987d7
files contrib/python3-whitelist mercurial/context.py
diffstat 2 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/contrib/python3-whitelist	Fri Mar 02 22:38:09 2018 -0500
+++ b/contrib/python3-whitelist	Sat Mar 03 09:19:34 2018 -0500
@@ -5,6 +5,7 @@
 test-amend-subrepo.t
 test-ancestor.py
 test-annotate.py
+test-annotate.t
 test-automv.t
 test-backout.t
 test-backwards-remove.t
--- a/mercurial/context.py	Fri Mar 02 22:38:09 2018 -0500
+++ b/mercurial/context.py	Sat Mar 03 09:19:34 2018 -0500
@@ -912,7 +912,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 self.linkrev()
         return self._adjustlinkrev(self.rev(), inclusive=True)
@@ -928,14 +928,14 @@
     def _parentfilectx(self, path, fileid, filelog):
         """create parent filectx keeping ancestry info for _adjustlinkrev()"""
         fctx = filectx(self._repo, path, fileid=fileid, filelog=filelog)
-        if '_changeid' in vars(self) or '_changectx' in vars(self):
+        if r'_changeid' in vars(self) or r'_changectx' in vars(self):
             # If self is associated with a changeset (probably explicitly
             # fed), ensure the created filectx is associated with a
             # changeset that is an ancestor of self.changectx.
             # This lets us later use _adjustlinkrev to get a correct link.
             fctx._descendantrev = self.rev()
             fctx._ancestrycontext = getattr(self, '_ancestrycontext', None)
-        elif '_descendantrev' in vars(self):
+        elif r'_descendantrev' in vars(self):
             # Otherwise propagate _descendantrev if we have one associated.
             fctx._descendantrev = self._descendantrev
             fctx._ancestrycontext = getattr(self, '_ancestrycontext', None)