Mercurial > hg
comparison tests/test-fncache.t @ 48876:42d2b31cee0b
tests: remove from __future__ from inline Python in tests
This is no longer required since we require Python 3 and the linter
no longer requires these statements.
Differential Revision: https://phab.mercurial-scm.org/D12255
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Sun, 20 Feb 2022 15:28:44 -0700 |
parents | 7ee07e1a25c0 |
children | 2f2682f40ea0 |
comparison
equal
deleted
inserted
replaced
48875:6000f5b25c9b | 48876:42d2b31cee0b |
---|---|
2 | 2 |
3 An extension which will set fncache chunksize to 1 byte to make sure that logic | 3 An extension which will set fncache chunksize to 1 byte to make sure that logic |
4 does not break | 4 does not break |
5 | 5 |
6 $ cat > chunksize.py <<EOF | 6 $ cat > chunksize.py <<EOF |
7 > from __future__ import absolute_import | |
8 > from mercurial import store | 7 > from mercurial import store |
9 > store.fncache_chunksize = 1 | 8 > store.fncache_chunksize = 1 |
10 > EOF | 9 > EOF |
11 | 10 |
12 $ cat >> $HGRCPATH <<EOF | 11 $ cat >> $HGRCPATH <<EOF |
230 $ cd .. | 229 $ cd .. |
231 | 230 |
232 Aborting lock does not prevent fncache writes | 231 Aborting lock does not prevent fncache writes |
233 | 232 |
234 $ cat > exceptionext.py <<EOF | 233 $ cat > exceptionext.py <<EOF |
235 > from __future__ import absolute_import | |
236 > import os | 234 > import os |
237 > from mercurial import commands, error, extensions | 235 > from mercurial import commands, error, extensions |
238 > | 236 > |
239 > def lockexception(orig, vfs, lockname, wait, releasefn, *args, **kwargs): | 237 > def lockexception(orig, vfs, lockname, wait, releasefn, *args, **kwargs): |
240 > def releasewrap(): | 238 > def releasewrap(): |
277 data/y.i | 275 data/y.i |
278 | 276 |
279 Aborting transaction prevents fncache change | 277 Aborting transaction prevents fncache change |
280 | 278 |
281 $ cat > ../exceptionext.py <<EOF | 279 $ cat > ../exceptionext.py <<EOF |
282 > from __future__ import absolute_import | |
283 > import os | 280 > import os |
284 > from mercurial import commands, error, extensions, localrepo | 281 > from mercurial import commands, error, extensions, localrepo |
285 > | 282 > |
286 > def wrapper(orig, self, *args, **kwargs): | 283 > def wrapper(orig, self, *args, **kwargs): |
287 > tr = orig(self, *args, **kwargs) | 284 > tr = orig(self, *args, **kwargs) |
313 data/y.i | 310 data/y.i |
314 | 311 |
315 Aborted transactions can be recovered later | 312 Aborted transactions can be recovered later |
316 | 313 |
317 $ cat > ../exceptionext.py <<EOF | 314 $ cat > ../exceptionext.py <<EOF |
318 > from __future__ import absolute_import | |
319 > import os | 315 > import os |
320 > from mercurial import ( | 316 > from mercurial import ( |
321 > commands, | 317 > commands, |
322 > error, | 318 > error, |
323 > extensions, | 319 > extensions, |
481 fncache file is going to be large. If we possibly can avoid loading it, so much the better. | 477 fncache file is going to be large. If we possibly can avoid loading it, so much the better. |
482 The cache should not loaded when committing changes to existing files, or when unbundling | 478 The cache should not loaded when committing changes to existing files, or when unbundling |
483 changesets that only contain changes to existing files: | 479 changesets that only contain changes to existing files: |
484 | 480 |
485 $ cat > fncacheloadwarn.py << EOF | 481 $ cat > fncacheloadwarn.py << EOF |
486 > from __future__ import absolute_import | |
487 > from mercurial import extensions, localrepo | 482 > from mercurial import extensions, localrepo |
488 > | 483 > |
489 > def extsetup(ui): | 484 > def extsetup(ui): |
490 > def wrapstore(orig, requirements, *args): | 485 > def wrapstore(orig, requirements, *args): |
491 > store = orig(requirements, *args) | 486 > store = orig(requirements, *args) |