# HG changeset patch # User Yuya Nishihara # Date 2018-03-03 14:19:34 # Node ID 334da951a50b58d76907b631b81aab5d4cb6c12a # Parent 159b04de5fb0fff6a154db3f7611b7766078cfc7 py3: fix some membership tests on linkrev adjustment diff --git a/contrib/python3-whitelist b/contrib/python3-whitelist --- a/contrib/python3-whitelist +++ b/contrib/python3-whitelist @@ -5,6 +5,7 @@ test-addremove.t test-amend-subrepo.t test-ancestor.py test-annotate.py +test-annotate.t test-automv.t test-backout.t test-backwards-remove.t diff --git a/mercurial/context.py b/mercurial/context.py --- a/mercurial/context.py +++ b/mercurial/context.py @@ -912,7 +912,7 @@ class basefilectx(object): """ 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 @@ class basefilectx(object): 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)