Show More
@@ -31,17 +31,20 b' class fakerepo(object):' | |||
|
31 | 31 | pass |
|
32 | 32 | |
|
33 | 33 | def basic(repo): |
|
34 |
|
|
|
34 | print "* file doesn't exist" | |
|
35 | # calls function | |
|
35 | 36 | repo.cached |
|
36 | 37 | |
|
37 | 38 | repo.invalidate() |
|
38 |
|
|
|
39 | print "* file still doesn't exist" | |
|
40 | # uses cache | |
|
39 | 41 | repo.cached |
|
40 | 42 | |
|
41 | 43 | # create empty file |
|
42 | 44 | f = open('x', 'w') |
|
43 | 45 | f.close() |
|
44 | 46 | repo.invalidate() |
|
47 | print "* empty file x created" | |
|
45 | 48 | # should recreate the object |
|
46 | 49 | repo.cached |
|
47 | 50 | |
@@ -49,11 +52,13 b' def basic(repo):' | |||
|
49 | 52 | f.write('a') |
|
50 | 53 | f.close() |
|
51 | 54 | repo.invalidate() |
|
55 | print "* file x changed size" | |
|
52 | 56 | # should recreate the object |
|
53 | 57 | repo.cached |
|
54 | 58 | |
|
55 | 59 | repo.invalidate() |
|
56 | # stats file again, nothing changed, reuses object | |
|
60 | print "* nothing changed with file x" | |
|
61 | # stats file again, reuses object | |
|
57 | 62 | repo.cached |
|
58 | 63 | |
|
59 | 64 | # atomic replace file, size doesn't change |
@@ -64,6 +69,7 b' def basic(repo):' | |||
|
64 | 69 | f.close() |
|
65 | 70 | |
|
66 | 71 | repo.invalidate() |
|
72 | print "* file x changed inode" | |
|
67 | 73 | repo.cached |
|
68 | 74 | |
|
69 | 75 | def fakeuncacheable(): |
@@ -106,11 +112,13 b' def setbeforeget(repo):' | |||
|
106 | 112 | os.remove('x') |
|
107 | 113 | repo.cached = 'string set externally' |
|
108 | 114 | repo.invalidate() |
|
115 | print "* file x doesn't exist" | |
|
109 | 116 | print repo.cached |
|
110 | 117 | repo.invalidate() |
|
111 | 118 | f = open('x', 'w') |
|
112 | 119 | f.write('a') |
|
113 | 120 | f.close() |
|
121 | print "* file x created" | |
|
114 | 122 | print repo.cached |
|
115 | 123 | |
|
116 | 124 | print 'basic:' |
@@ -1,17 +1,29 b'' | |||
|
1 | 1 | basic: |
|
2 | 2 | |
|
3 | * file doesn't exist | |
|
3 | 4 | creating |
|
5 | * file still doesn't exist | |
|
6 | * empty file x created | |
|
4 | 7 | creating |
|
8 | * file x changed size | |
|
5 | 9 | creating |
|
10 | * nothing changed with file x | |
|
11 | * file x changed inode | |
|
6 | 12 | creating |
|
7 | 13 | |
|
8 | 14 | fakeuncacheable: |
|
9 | 15 | |
|
16 | * file doesn't exist | |
|
10 | 17 | creating |
|
18 | * file still doesn't exist | |
|
11 | 19 | creating |
|
20 | * empty file x created | |
|
12 | 21 | creating |
|
22 | * file x changed size | |
|
13 | 23 | creating |
|
24 | * nothing changed with file x | |
|
14 | 25 | creating |
|
26 | * file x changed inode | |
|
15 | 27 | creating |
|
16 | 28 | repository tip rolled back to revision -1 (undo commit) |
|
17 | 29 | working directory now based on revision -1 |
@@ -20,6 +32,8 b' working directory now based on revision ' | |||
|
20 | 32 | |
|
21 | 33 | setbeforeget: |
|
22 | 34 | |
|
35 | * file x doesn't exist | |
|
23 | 36 | string set externally |
|
37 | * file x created | |
|
24 | 38 | creating |
|
25 | 39 | string from function |
General Comments 0
You need to be logged in to leave comments.
Login now