Mercurial > hg
comparison tests/test-histedit-edit.t @ 26587:56b2bcea2529
error: get Abort from 'error' instead of 'util'
The home of 'Abort' is 'error' not 'util' however, a lot of code seems to be
confused about that and gives all the credit to 'util' instead of the
hardworking 'error'. In a spirit of equity, we break the cycle of injustice and
give back to 'error' the respect it deserves. And screw that 'util' poser.
For great justice.
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Thu, 08 Oct 2015 12:55:45 -0700 |
parents | 43906060a3f4 |
children | 4414d500604f |
comparison
equal
deleted
inserted
replaced
26586:d51c658d3f04 | 26587:56b2bcea2529 |
---|---|
296 modify the message | 296 modify the message |
297 | 297 |
298 check saving last-message.txt, at first | 298 check saving last-message.txt, at first |
299 | 299 |
300 $ cat > $TESTTMP/commitfailure.py <<EOF | 300 $ cat > $TESTTMP/commitfailure.py <<EOF |
301 > from mercurial import util | 301 > from mercurial import error |
302 > def reposetup(ui, repo): | 302 > def reposetup(ui, repo): |
303 > class commitfailure(repo.__class__): | 303 > class commitfailure(repo.__class__): |
304 > def commit(self, *args, **kwargs): | 304 > def commit(self, *args, **kwargs): |
305 > raise util.Abort('emulating unexpected abort') | 305 > raise error.Abort('emulating unexpected abort') |
306 > repo.__class__ = commitfailure | 306 > repo.__class__ = commitfailure |
307 > EOF | 307 > EOF |
308 $ cat >> .hg/hgrc <<EOF | 308 $ cat >> .hg/hgrc <<EOF |
309 > [extensions] | 309 > [extensions] |
310 > # this failure occurs before editor invocation | 310 > # this failure occurs before editor invocation |