Show More
@@ -304,6 +304,7 b' Aborted transactions can be recovered la' | |||
|
304 | 304 | |
|
305 | 305 | $ cat > ../exceptionext.py <<EOF |
|
306 | 306 | > import os |
|
307 | > import signal | |
|
307 | 308 | > from mercurial import ( |
|
308 | 309 | > commands, |
|
309 | 310 | > error, |
@@ -315,19 +316,14 b' Aborted transactions can be recovered la' | |||
|
315 | 316 | > def trwrapper(orig, self, *args, **kwargs): |
|
316 | 317 | > tr = orig(self, *args, **kwargs) |
|
317 | 318 | > def fail(tr): |
|
318 | > raise error.Abort(b"forced transaction failure") | |
|
319 | > os.kill(os.getpid(), signal.SIGKILL) | |
|
319 | 320 |
|
|
320 | 321 | > tr.addfinalize(b'zzz-forcefails', fail) |
|
321 | 322 | > return tr |
|
322 | 323 | > |
|
323 | > def abortwrapper(orig, self, *args, **kwargs): | |
|
324 | > raise error.Abort(b"forced transaction failure") | |
|
325 | > | |
|
326 | 324 | > def uisetup(ui): |
|
327 | 325 | > extensions.wrapfunction(localrepo.localrepository, 'transaction', |
|
328 | 326 | > trwrapper) |
|
329 | > extensions.wrapfunction(transaction.transaction, '_abort', | |
|
330 | > abortwrapper) | |
|
331 | 327 | > |
|
332 | 328 | > cmdtable = {} |
|
333 | 329 | > |
@@ -339,8 +335,12 b' Clean cached versions' | |||
|
339 | 335 | |
|
340 | 336 | $ hg up -q 1 |
|
341 | 337 | $ touch z |
|
342 | $ hg ci -qAm z 2>/dev/null | |
|
343 | [255] | |
|
338 | # Cannot rely on the return code value as chg use a different one. | |
|
339 | # So we use a `|| echo` trick | |
|
340 | # XXX-CHG fixing chg behavior would be nice here. | |
|
341 | $ hg ci -qAm z || echo "He's Dead, Jim." 2>/dev/null | |
|
342 | Killed (?) | |
|
343 | He's Dead, Jim. | |
|
344 | 344 | $ cat .hg/store/fncache | sort |
|
345 | 345 | data/y.i |
|
346 | 346 | data/z.i |
General Comments 0
You need to be logged in to leave comments.
Login now