##// END OF EJS Templates
destroyed: keep the filecache in sync with __dict__ (issue3335) (issue3693) (issue3743)...
Idan Kamara -
r18313:3e4a944c default
parent child Browse files
Show More
@@ -1447,10 +1447,7 b' class localrepository(object):'
1447 # head, refresh the tag cache, then immediately add a new head.
1447 # head, refresh the tag cache, then immediately add a new head.
1448 # But I think doing it this way is necessary for the "instant
1448 # But I think doing it this way is necessary for the "instant
1449 # tag cache retrieval" case to work.
1449 # tag cache retrieval" case to work.
1450 self.invalidatecaches()
1450 self.invalidate()
1451
1452 # Discard all cache entries to force reloading everything.
1453 self._filecache.clear()
1454
1451
1455 def walk(self, match, node=None):
1452 def walk(self, match, node=None):
1456 '''
1453 '''
@@ -4,7 +4,7 b" if subprocess.call(['python', '%s/hghave"
4 'cacheable']):
4 'cacheable']):
5 sys.exit(80)
5 sys.exit(80)
6
6
7 from mercurial import util, scmutil, extensions
7 from mercurial import util, scmutil, extensions, hg, ui
8
8
9 filecache = scmutil.filecache
9 filecache = scmutil.filecache
10
10
@@ -86,6 +86,21 b' def fakeuncacheable():'
86 util.cachestat.cacheable = origcacheable
86 util.cachestat.cacheable = origcacheable
87 util.cachestat.__init__ = originit
87 util.cachestat.__init__ = originit
88
88
89 def test_filecache_synced():
90 # test old behaviour that caused filecached properties to go out of sync
91 os.system('hg init && echo a >> a && hg ci -qAm.')
92 repo = hg.repository(ui.ui())
93 # first rollback clears the filecache, but changelog to stays in __dict__
94 repo.rollback()
95 repo.commit('.')
96 # second rollback comes along and touches the changelog externally
97 # (file is moved)
98 repo.rollback()
99 # but since changelog isn't under the filecache control anymore, we don't
100 # see that it changed, and return the old changelog without reconstructing
101 # it
102 repo.commit('.')
103
89 print 'basic:'
104 print 'basic:'
90 print
105 print
91 basic(fakerepo())
106 basic(fakerepo())
@@ -93,3 +108,4 b' print'
93 print 'fakeuncacheable:'
108 print 'fakeuncacheable:'
94 print
109 print
95 fakeuncacheable()
110 fakeuncacheable()
111 test_filecache_synced()
@@ -13,3 +13,7 b' creating'
13 creating
13 creating
14 creating
14 creating
15 creating
15 creating
16 repository tip rolled back to revision -1 (undo commit)
17 working directory now based on revision -1
18 repository tip rolled back to revision -1 (undo commit)
19 working directory now based on revision -1
General Comments 0
You need to be logged in to leave comments. Login now