Mercurial > hg
comparison tests/test-http-branchmap.t @ 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 | 4d2b9b304ad0 |
children | 2428e8ec0793 |
comparison
equal
deleted
inserted
replaced
30557:cbeb54ec0481 | 30559:d83ca854fa21 |
---|---|
79 > return getattr(self._file, name) | 79 > return getattr(self._file, name) |
80 > | 80 > |
81 > sys.stdout = StdoutWrapper(sys.stdout) | 81 > sys.stdout = StdoutWrapper(sys.stdout) |
82 > sys.stderr = StdoutWrapper(sys.stderr) | 82 > sys.stderr = StdoutWrapper(sys.stderr) |
83 > | 83 > |
84 > myui = ui.ui() | 84 > myui = ui.ui.load() |
85 > repo = hg.repository(myui, 'a') | 85 > repo = hg.repository(myui, 'a') |
86 > commands.serve(myui, repo, stdio=True, cmdserver=False) | 86 > commands.serve(myui, repo, stdio=True, cmdserver=False) |
87 > EOF | 87 > EOF |
88 $ echo baz >> b/foo | 88 $ echo baz >> b/foo |
89 $ hg -R b ci -m baz | 89 $ hg -R b ci -m baz |