Show More
@@ -1447,10 +1447,7 b' class localrepository(object):' | |||
|
1447 | 1447 | # head, refresh the tag cache, then immediately add a new head. |
|
1448 | 1448 | # But I think doing it this way is necessary for the "instant |
|
1449 | 1449 | # tag cache retrieval" case to work. |
|
1450 |
self.invalidate |
|
|
1451 | ||
|
1452 | # Discard all cache entries to force reloading everything. | |
|
1453 | self._filecache.clear() | |
|
1450 | self.invalidate() | |
|
1454 | 1451 | |
|
1455 | 1452 | def walk(self, match, node=None): |
|
1456 | 1453 | ''' |
@@ -4,7 +4,7 b" if subprocess.call(['python', '%s/hghave" | |||
|
4 | 4 | 'cacheable']): |
|
5 | 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 | 9 | filecache = scmutil.filecache |
|
10 | 10 | |
@@ -86,6 +86,21 b' def fakeuncacheable():' | |||
|
86 | 86 | util.cachestat.cacheable = origcacheable |
|
87 | 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 | 104 | print 'basic:' |
|
90 | 105 | |
|
91 | 106 | basic(fakerepo()) |
@@ -93,3 +108,4 b' print' | |||
|
93 | 108 | print 'fakeuncacheable:' |
|
94 | 109 | |
|
95 | 110 | fakeuncacheable() |
|
111 | test_filecache_synced() |
General Comments 0
You need to be logged in to leave comments.
Login now