tests/test-fncache.t
changeset 23510 065c0334846f
parent 23063 cd86a6707159
child 23512 0ff6b65afeb0
--- a/tests/test-fncache.t	Tue Dec 09 13:32:19 2014 -0600
+++ b/tests/test-fncache.t	Thu Dec 04 13:49:45 2014 -0800
@@ -210,19 +210,19 @@
 
   $ cat > ../exceptionext.py <<EOF
   > import os
-  > from mercurial import commands, util, transaction
+  > from mercurial import commands, util, localrepo
   > from mercurial.extensions import wrapfunction
   > 
   > def wrapper(orig, self, *args, **kwargs):
-  >     origonclose = self.onclose
-  >     def onclose():
-  >         origonclose()
+  >     tr = orig(self, *args, **kwargs)
+  >     def fail(tr):
   >         raise util.Abort("forced transaction failure")
-  >     self.onclose = onclose
-  >     return orig(self, *args, **kwargs)
+  >     # zzz prefix to ensure it sorted after store.write
+  >     tr.addfinalize('zzz-forcefails', fail)
+  >     return tr
   > 
   > def uisetup(ui):
-  >     wrapfunction(transaction.transaction, 'close', wrapper)
+  >     wrapfunction(localrepo.localrepository, 'transaction', wrapper)
   > 
   > cmdtable = {}
   >