##// END OF EJS Templates
tests: update test-fncache to pass our import checker
Augie Fackler -
r33958:1be228b9 default
parent child Browse files
Show More
@@ -205,9 +205,9 b' Encoding of reserved / long paths in the'
205 Aborting lock does not prevent fncache writes
205 Aborting lock does not prevent fncache writes
206
206
207 $ cat > exceptionext.py <<EOF
207 $ cat > exceptionext.py <<EOF
208 > from __future__ import absolute_import
208 > import os
209 > import os
209 > from mercurial import commands, error
210 > from mercurial import commands, error, extensions
210 > from mercurial.extensions import wrapcommand, wrapfunction
211 >
211 >
212 > def lockexception(orig, vfs, lockname, wait, releasefn, *args, **kwargs):
212 > def lockexception(orig, vfs, lockname, wait, releasefn, *args, **kwargs):
213 > def releasewrap():
213 > def releasewrap():
@@ -217,7 +217,7 b' Aborting lock does not prevent fncache w'
217 > return l
217 > return l
218 >
218 >
219 > def reposetup(ui, repo):
219 > def reposetup(ui, repo):
220 > wrapfunction(repo, '_lock', lockexception)
220 > extensions.wrapfunction(repo, '_lock', lockexception)
221 >
221 >
222 > cmdtable = {}
222 > cmdtable = {}
223 >
223 >
@@ -236,7 +236,7 b' Aborting lock does not prevent fncache w'
236 > wlock.release()
236 > wlock.release()
237 >
237 >
238 > def extsetup(ui):
238 > def extsetup(ui):
239 > wrapcommand(commands.table, "commit", commitwrap)
239 > extensions.wrapcommand(commands.table, "commit", commitwrap)
240 > EOF
240 > EOF
241 $ extpath=`pwd`/exceptionext.py
241 $ extpath=`pwd`/exceptionext.py
242 $ hg init fncachetxn
242 $ hg init fncachetxn
@@ -252,9 +252,9 b' Aborting lock does not prevent fncache w'
252 Aborting transaction prevents fncache change
252 Aborting transaction prevents fncache change
253
253
254 $ cat > ../exceptionext.py <<EOF
254 $ cat > ../exceptionext.py <<EOF
255 > from __future__ import absolute_import
255 > import os
256 > import os
256 > from mercurial import commands, error, localrepo
257 > from mercurial import commands, error, extensions, localrepo
257 > from mercurial.extensions import wrapfunction
258 >
258 >
259 > def wrapper(orig, self, *args, **kwargs):
259 > def wrapper(orig, self, *args, **kwargs):
260 > tr = orig(self, *args, **kwargs)
260 > tr = orig(self, *args, **kwargs)
@@ -265,7 +265,8 b' Aborting transaction prevents fncache ch'
265 > return tr
265 > return tr
266 >
266 >
267 > def uisetup(ui):
267 > def uisetup(ui):
268 > wrapfunction(localrepo.localrepository, 'transaction', wrapper)
268 > extensions.wrapfunction(
269 > localrepo.localrepository, 'transaction', wrapper)
269 >
270 >
270 > cmdtable = {}
271 > cmdtable = {}
271 >
272 >
@@ -287,9 +288,15 b' Clean cached version'
287 Aborted transactions can be recovered later
288 Aborted transactions can be recovered later
288
289
289 $ cat > ../exceptionext.py <<EOF
290 $ cat > ../exceptionext.py <<EOF
291 > from __future__ import absolute_import
290 > import os
292 > import os
291 > from mercurial import commands, error, transaction, localrepo
293 > from mercurial import (
292 > from mercurial.extensions import wrapfunction
294 > commands,
295 > error,
296 > extensions,
297 > localrepo,
298 > transaction,
299 > )
293 >
300 >
294 > def trwrapper(orig, self, *args, **kwargs):
301 > def trwrapper(orig, self, *args, **kwargs):
295 > tr = orig(self, *args, **kwargs)
302 > tr = orig(self, *args, **kwargs)
@@ -303,8 +310,10 b' Aborted transactions can be recovered la'
303 > raise error.Abort("forced transaction failure")
310 > raise error.Abort("forced transaction failure")
304 >
311 >
305 > def uisetup(ui):
312 > def uisetup(ui):
306 > wrapfunction(localrepo.localrepository, 'transaction', trwrapper)
313 > extensions.wrapfunction(localrepo.localrepository, 'transaction',
307 > wrapfunction(transaction.transaction, '_abort', abortwrapper)
314 > trwrapper)
315 > extensions.wrapfunction(transaction.transaction, '_abort',
316 > abortwrapper)
308 >
317 >
309 > cmdtable = {}
318 > cmdtable = {}
310 >
319 >
General Comments 0
You need to be logged in to leave comments. Login now