Mercurial > hg
comparison hgext/blackbox.py @ 23877:7cc77030c557
localrepo: remove all external users of localrepo.opener
This change touches every module in which repository.opener was being used, and
changes it for the equivalent repository.vfs. This is meant to make it easier
to split the repository.vfs into several separate vfs.
It should now be possible to remove localrepo.opener.
author | Angel Ezquerra <angel.ezquerra@gmail.com> |
---|---|
date | Thu, 15 Jan 2015 23:17:12 +0100 |
parents | 6d6f148cada9 |
children | 80c5b2666a96 |
comparison
equal
deleted
inserted
replaced
23876:48fd1dfb99aa | 23877:7cc77030c557 |
---|---|
110 self.debug('warning: cannot write to blackbox.log: %s\n' % | 110 self.debug('warning: cannot write to blackbox.log: %s\n' % |
111 err.strerror) | 111 err.strerror) |
112 lastblackbox = blackbox | 112 lastblackbox = blackbox |
113 | 113 |
114 def setrepo(self, repo): | 114 def setrepo(self, repo): |
115 self._bbopener = repo.opener | 115 self._bbopener = repo.vfs |
116 | 116 |
117 ui.__class__ = blackboxui | 117 ui.__class__ = blackboxui |
118 | 118 |
119 def uisetup(ui): | 119 def uisetup(ui): |
120 wrapui(ui) | 120 wrapui(ui) |
139 | 139 |
140 if not os.path.exists(repo.join('blackbox.log')): | 140 if not os.path.exists(repo.join('blackbox.log')): |
141 return | 141 return |
142 | 142 |
143 limit = opts.get('limit') | 143 limit = opts.get('limit') |
144 blackbox = repo.opener('blackbox.log', 'r') | 144 blackbox = repo.vfs('blackbox.log', 'r') |
145 lines = blackbox.read().split('\n') | 145 lines = blackbox.read().split('\n') |
146 | 146 |
147 count = 0 | 147 count = 0 |
148 output = [] | 148 output = [] |
149 for line in reversed(lines): | 149 for line in reversed(lines): |