py3: fix test-dirstate-race.t
authorMark Thomas <mbthomas@fb.com>
Sun, 14 Oct 2018 14:02:32 +0000
changeset 40296 e787d97e90ad
parent 40295 fa88170c10bb
child 40297 d33611280add
py3: fix test-dirstate-race.t Differential Revision: https://phab.mercurial-scm.org/D5106
contrib/python3-whitelist
mercurial/localrepo.py
tests/test-dirstate-race.t
--- a/contrib/python3-whitelist	Fri Oct 12 18:49:11 2018 +0200
+++ b/contrib/python3-whitelist	Sun Oct 14 14:02:32 2018 +0000
@@ -140,6 +140,7 @@
 test-directaccess.t
 test-dirstate-backup.t
 test-dirstate-nonnormalset.t
+test-dirstate-race.t
 test-dirstate.t
 test-dispatch.py
 test-doctest.py
--- a/mercurial/localrepo.py	Fri Oct 12 18:49:11 2018 +0200
+++ b/mercurial/localrepo.py	Sun Oct 14 14:02:32 2018 +0000
@@ -2067,13 +2067,13 @@
         rereads the dirstate. Use dirstate.invalidate() if you want to
         explicitly read the dirstate again (i.e. restoring it to a previous
         known good state).'''
-        if hasunfilteredcache(self, 'dirstate'):
+        if hasunfilteredcache(self, r'dirstate'):
             for k in self.dirstate._filecache:
                 try:
                     delattr(self.dirstate, k)
                 except AttributeError:
                     pass
-            delattr(self.unfiltered(), 'dirstate')
+            delattr(self.unfiltered(), r'dirstate')
 
     def invalidate(self, clearfilecache=False):
         '''Invalidates both store and non-store parts other than dirstate
--- a/tests/test-dirstate-race.t	Fri Oct 12 18:49:11 2018 +0200
+++ b/tests/test-dirstate-race.t	Sun Oct 14 14:02:32 2018 +0000
@@ -57,7 +57,7 @@
   >     extensions.wrapfunction(context.workingctx, '_checklookup', overridechecklookup)
   > def overridechecklookup(orig, self, files):
   >     # make an update that changes the dirstate from underneath
-  >     self._repo.ui.system(r"sh '$TESTTMP/dirstaterace.sh'",
+  >     self._repo.ui.system(br"sh '$TESTTMP/dirstaterace.sh'",
   >                          cwd=self._repo.root)
   >     return orig(self, files)
   > EOF