Mercurial > hg
diff tests/test-fncache.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 | ca778cbe94f3 |
children | 4414d500604f |
line wrap: on
line diff
--- a/tests/test-fncache.t Mon Oct 05 22:49:24 2015 -0700 +++ b/tests/test-fncache.t Thu Oct 08 12:55:45 2015 -0700 @@ -202,12 +202,12 @@ $ cat > exceptionext.py <<EOF > import os - > from mercurial import commands, util + > from mercurial import commands, error > from mercurial.extensions import wrapfunction > > def lockexception(orig, vfs, lockname, wait, releasefn, *args, **kwargs): > def releasewrap(): - > raise util.Abort("forced lock failure") + > raise error.Abort("forced lock failure") > return orig(vfs, lockname, wait, releasewrap, *args, **kwargs) > > def reposetup(ui, repo): @@ -231,13 +231,13 @@ $ cat > ../exceptionext.py <<EOF > import os - > from mercurial import commands, util, localrepo + > from mercurial import commands, error, localrepo > from mercurial.extensions import wrapfunction > > def wrapper(orig, self, *args, **kwargs): > tr = orig(self, *args, **kwargs) > def fail(tr): - > raise util.Abort("forced transaction failure") + > raise error.Abort("forced transaction failure") > # zzz prefix to ensure it sorted after store.write > tr.addfinalize('zzz-forcefails', fail) > return tr @@ -262,19 +262,19 @@ $ cat > ../exceptionext.py <<EOF > import os - > from mercurial import commands, util, transaction, localrepo + > from mercurial import commands, error, transaction, localrepo > from mercurial.extensions import wrapfunction > > def trwrapper(orig, self, *args, **kwargs): > tr = orig(self, *args, **kwargs) > def fail(tr): - > raise util.Abort("forced transaction failure") + > raise error.Abort("forced transaction failure") > # zzz prefix to ensure it sorted after store.write > tr.addfinalize('zzz-forcefails', fail) > return tr > > def abortwrapper(orig, self, *args, **kwargs): - > raise util.Abort("forced transaction failure") + > raise error.Abort("forced transaction failure") > > def uisetup(ui): > wrapfunction(localrepo.localrepository, 'transaction', trwrapper)