Patchwork [7,of,9] py3: invalidate repository cache with system-string keys

login
register
mail settings
Submitter Yuya Nishihara
Date Oct. 18, 2018, 12:32 p.m.
Message ID <fe19b709e1219b716bcf.1539865978@mimosa>
Download mbox | patch
Permalink /patch/36139/
State Accepted
Headers show

Comments

Yuya Nishihara - Oct. 18, 2018, 12:32 p.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1539671364 -7200
#      Tue Oct 16 08:29:24 2018 +0200
# Node ID fe19b709e1219b716bcf8adcb2dbe053deb31d93
# Parent  9235215b40cf586e1a4af768380de580fe01edf0
py3: invalidate repository cache with system-string keys

# skip-blame just a few r'' prefixes

Patch

diff --git a/hgext/mq.py b/hgext/mq.py
--- a/hgext/mq.py
+++ b/hgext/mq.py
@@ -3511,9 +3511,9 @@  def reposetup(ui, repo):
 
         def invalidateall(self):
             super(mqrepo, self).invalidateall()
-            if localrepo.hasunfilteredcache(self, 'mq'):
+            if localrepo.hasunfilteredcache(self, r'mq'):
                 # recreate mq in case queue path was changed
-                delattr(self.unfiltered(), 'mq')
+                delattr(self.unfiltered(), r'mq')
 
         def abortifwdirpatched(self, errmsg, force=False):
             if self.mq.applied and self.mq.checkapplied and not force:
diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -2046,9 +2046,9 @@  class localrepository(object):
 
     def invalidatecaches(self):
 
-        if '_tagscache' in vars(self):
+        if r'_tagscache' in vars(self):
             # can't use delattr on proxy
-            del self.__dict__['_tagscache']
+            del self.__dict__[r'_tagscache']
 
         self.unfiltered()._branchcaches.clear()
         self.invalidatevolatilesets()