Mercurial > public > mercurial-scm > hg
comparison tests/test-filecache.py @ 30559:d83ca854fa21
ui: factor out ui.load() to create a ui without loading configs (API)
This allows us to write doctests depending on a ui object, but not on global
configs.
ui.load() is a class method so we can do wsgiui.load(). All ui() calls but
for doctests are replaced with ui.load(). Some of them could be changed to
not load configs later.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sat, 22 Oct 2016 14:35:10 +0900 |
parents | 318a24b52eeb |
children | 21fa3d3688f3 |
comparison
equal
deleted
inserted
replaced
30557:cbeb54ec0481 | 30559:d83ca854fa21 |
---|---|
139 util.cachestat.__init__ = originit | 139 util.cachestat.__init__ = originit |
140 | 140 |
141 def test_filecache_synced(): | 141 def test_filecache_synced(): |
142 # test old behavior that caused filecached properties to go out of sync | 142 # test old behavior that caused filecached properties to go out of sync |
143 os.system('hg init && echo a >> a && hg ci -qAm.') | 143 os.system('hg init && echo a >> a && hg ci -qAm.') |
144 repo = hg.repository(uimod.ui()) | 144 repo = hg.repository(uimod.ui.load()) |
145 # first rollback clears the filecache, but changelog to stays in __dict__ | 145 # first rollback clears the filecache, but changelog to stays in __dict__ |
146 repo.rollback() | 146 repo.rollback() |
147 repo.commit('.') | 147 repo.commit('.') |
148 # second rollback comes along and touches the changelog externally | 148 # second rollback comes along and touches the changelog externally |
149 # (file is moved) | 149 # (file is moved) |