Show More
@@ -228,21 +228,21 b' I/O errors on stdio are handled properly' | |||
|
228 | 228 | > configtable = {} |
|
229 | 229 | > configitem = registrar.configitem(configtable) |
|
230 | 230 | > |
|
231 | > configitem('ui', 'ioerrors', | |
|
231 | > configitem(b'ui', b'ioerrors', | |
|
232 | 232 | > default=list, |
|
233 | 233 | > ) |
|
234 | 234 | > |
|
235 | 235 | > def pretxncommit(ui, repo, **kwargs): |
|
236 | > ui.warn('warn during pretxncommit\n') | |
|
236 | > ui.warn(b'warn during pretxncommit\n') | |
|
237 | 237 | > |
|
238 | 238 | > def pretxnclose(ui, repo, **kwargs): |
|
239 | > ui.warn('warn during pretxnclose\n') | |
|
239 | > ui.warn(b'warn during pretxnclose\n') | |
|
240 | 240 | > |
|
241 | 241 | > def txnclose(ui, repo, **kwargs): |
|
242 | > ui.warn('warn during txnclose\n') | |
|
242 | > ui.warn(b'warn during txnclose\n') | |
|
243 | 243 | > |
|
244 | 244 | > def txnabort(ui, repo, **kwargs): |
|
245 | > ui.warn('warn during abort\n') | |
|
245 | > ui.warn(b'warn during abort\n') | |
|
246 | 246 | > |
|
247 | 247 | > class fdproxy(object): |
|
248 | 248 | > def __init__(self, ui, o): |
@@ -253,25 +253,25 b' I/O errors on stdio are handled properly' | |||
|
253 | 253 | > return getattr(self._o, attr) |
|
254 | 254 | > |
|
255 | 255 | > def write(self, msg): |
|
256 | > errors = set(self._ui.configlist('ui', 'ioerrors')) | |
|
257 | > pretxncommit = msg == 'warn during pretxncommit\n' | |
|
258 | > pretxnclose = msg == 'warn during pretxnclose\n' | |
|
259 | > txnclose = msg == 'warn during txnclose\n' | |
|
260 | > txnabort = msg == 'warn during abort\n' | |
|
261 | > msgabort = msg == _('transaction abort!\n') | |
|
262 | > msgrollback = msg == _('rollback completed\n') | |
|
256 | > errors = set(self._ui.configlist(b'ui', b'ioerrors')) | |
|
257 | > pretxncommit = msg == b'warn during pretxncommit\n' | |
|
258 | > pretxnclose = msg == b'warn during pretxnclose\n' | |
|
259 | > txnclose = msg == b'warn during txnclose\n' | |
|
260 | > txnabort = msg == b'warn during abort\n' | |
|
261 | > msgabort = msg == _(b'transaction abort!\n') | |
|
262 | > msgrollback = msg == _(b'rollback completed\n') | |
|
263 | 263 | > |
|
264 | > if pretxncommit and 'pretxncommit' in errors: | |
|
264 | > if pretxncommit and b'pretxncommit' in errors: | |
|
265 | 265 | > raise IOError(errno.EPIPE, 'simulated epipe') |
|
266 | > if pretxnclose and 'pretxnclose' in errors: | |
|
266 | > if pretxnclose and b'pretxnclose' in errors: | |
|
267 | 267 | > raise IOError(errno.EIO, 'simulated eio') |
|
268 | > if txnclose and 'txnclose' in errors: | |
|
268 | > if txnclose and b'txnclose' in errors: | |
|
269 | 269 | > raise IOError(errno.EBADF, 'simulated badf') |
|
270 | > if txnabort and 'txnabort' in errors: | |
|
270 | > if txnabort and b'txnabort' in errors: | |
|
271 | 271 | > raise IOError(errno.EPIPE, 'simulated epipe') |
|
272 | > if msgabort and 'msgabort' in errors: | |
|
272 | > if msgabort and b'msgabort' in errors: | |
|
273 | 273 | > raise IOError(errno.EBADF, 'simulated ebadf') |
|
274 | > if msgrollback and 'msgrollback' in errors: | |
|
274 | > if msgrollback and b'msgrollback' in errors: | |
|
275 | 275 | > raise IOError(errno.EIO, 'simulated eio') |
|
276 | 276 | > |
|
277 | 277 | > return self._o.write(msg) |
@@ -289,10 +289,10 b' I/O errors on stdio are handled properly' | |||
|
289 | 289 | > ui.__class__ = badui |
|
290 | 290 | > |
|
291 | 291 | > def reposetup(ui, repo): |
|
292 | > ui.setconfig('hooks', 'pretxnclose.badui', pretxnclose, 'badui') | |
|
293 | > ui.setconfig('hooks', 'txnclose.badui', txnclose, 'badui') | |
|
294 | > ui.setconfig('hooks', 'pretxncommit.badui', pretxncommit, 'badui') | |
|
295 | > ui.setconfig('hooks', 'txnabort.badui', txnabort, 'badui') | |
|
292 | > ui.setconfig(b'hooks', b'pretxnclose.badui', pretxnclose, b'badui') | |
|
293 | > ui.setconfig(b'hooks', b'txnclose.badui', txnclose, b'badui') | |
|
294 | > ui.setconfig(b'hooks', b'pretxncommit.badui', pretxncommit, b'badui') | |
|
295 | > ui.setconfig(b'hooks', b'txnabort.badui', txnabort, b'badui') | |
|
296 | 296 | > EOF |
|
297 | 297 | |
|
298 | 298 | $ cat >> $HGRCPATH << EOF |
General Comments 0
You need to be logged in to leave comments.
Login now