##// END OF EJS Templates
manifestcache: clear the cache before testing the debug command...
marmoute -
r42129:6386f9a4 default
parent child Browse files
Show More
@@ -1,181 +1,185 b''
1 1 Source bundle was generated with the following script:
2 2
3 3 # hg init
4 4 # echo a > a
5 5 # ln -s a l
6 6 # hg ci -Ama -d'0 0'
7 7 # mkdir b
8 8 # echo a > b/a
9 9 # chmod +x b/a
10 10 # hg ci -Amb -d'1 0'
11 11
12 12 $ hg init
13 13 $ hg unbundle "$TESTDIR/bundles/test-manifest.hg"
14 14 adding changesets
15 15 adding manifests
16 16 adding file changes
17 17 added 2 changesets with 3 changes to 3 files
18 18 new changesets b73562a03cfe:5bdc995175ba (2 drafts)
19 19 (run 'hg update' to get a working copy)
20 20
21 21 The next call is expected to return nothing:
22 22
23 23 $ hg manifest
24 24
25 25 $ hg co
26 26 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
27 27
28 28 $ hg manifest
29 29 a
30 30 b/a
31 31 l
32 32
33 33 $ hg files -vr .
34 34 2 a
35 35 2 x b/a
36 36 1 l l
37 37 $ hg files -r . -X b
38 38 a
39 39 l
40 40 $ hg files -T '{path} {size} {flags}\n'
41 41 a 2
42 42 b/a 2 x
43 43 l 1 l
44 44 $ hg files -T '{path} {node|shortest}\n' -r.
45 45 a 5bdc
46 46 b/a 5bdc
47 47 l 5bdc
48 48
49 49 $ hg manifest -v
50 50 644 a
51 51 755 * b/a
52 52 644 @ l
53 53 $ hg manifest -T '{path} {rev}\n'
54 54 a 1
55 55 b/a 1
56 56 l 1
57 57
58 58 $ hg manifest --debug
59 59 b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3 644 a
60 60 b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3 755 * b/a
61 61 047b75c6d7a3ef6a2243bd0e99f94f6ea6683597 644 @ l
62 62
63 63 $ hg manifest -r 0
64 64 a
65 65 l
66 66
67 67 $ hg manifest -r 1
68 68 a
69 69 b/a
70 70 l
71 71
72 72 $ hg manifest -r tip
73 73 a
74 74 b/a
75 75 l
76 76
77 77 $ hg manifest tip
78 78 a
79 79 b/a
80 80 l
81 81
82 82 $ hg manifest --all
83 83 a
84 84 b/a
85 85 l
86 86
87 87 The next two calls are expected to abort:
88 88
89 89 $ hg manifest -r 2
90 90 abort: unknown revision '2'!
91 91 [255]
92 92
93 93 $ hg manifest -r tip tip
94 94 abort: please specify just one revision
95 95 [255]
96 96
97 97 Testing the manifest full text cache utility
98 98 --------------------------------------------
99 99
100 100 Reminder of the manifest log content
101 101
102 102 $ hg log --debug | grep 'manifest:'
103 103 manifest: 1:1e01206b1d2f72bd55f2a33fa8ccad74144825b7
104 104 manifest: 0:fce2a30dedad1eef4da95ca1dc0004157aa527cf
105 105
106 106 Showing the content of the caches after the above operations
107 107
108 108 $ hg debugmanifestfulltextcache
109 109 cache empty
110 110
111 (Clearing the cache in case of any content)
112
113 $ hg debugmanifestfulltextcache --clear
114
111 115 Adding a new persistent entry in the cache
112 116
113 117 $ hg debugmanifestfulltextcache --add 1e01206b1d2f72bd55f2a33fa8ccad74144825b7
114 118
115 119 $ hg debugmanifestfulltextcache
116 120 cache contains 1 manifest entries, in order of most to least recent:
117 121 id: 1e01206b1d2f72bd55f2a33fa8ccad74144825b7, size 133 bytes
118 122 total cache data size 157 bytes, on-disk 157 bytes
119 123
120 124 Check we don't duplicated entry (added from the debug command)
121 125
122 126 $ hg debugmanifestfulltextcache --add 1e01206b1d2f72bd55f2a33fa8ccad74144825b7
123 127 $ hg debugmanifestfulltextcache
124 128 cache contains 1 manifest entries, in order of most to least recent:
125 129 id: 1e01206b1d2f72bd55f2a33fa8ccad74144825b7, size 133 bytes
126 130 total cache data size 157 bytes, on-disk 157 bytes
127 131
128 132 Adding a second entry
129 133
130 134 $ hg debugmanifestfulltextcache --add fce2a30dedad1eef4da95ca1dc0004157aa527cf
131 135 $ hg debugmanifestfulltextcache
132 136 cache contains 2 manifest entries, in order of most to least recent:
133 137 id: fce2a30dedad1eef4da95ca1dc0004157aa527cf, size 87 bytes
134 138 id: 1e01206b1d2f72bd55f2a33fa8ccad74144825b7, size 133 bytes
135 139 total cache data size 268 bytes, on-disk 268 bytes
136 140
137 141 Accessing the initial entry again, refresh their order
138 142
139 143 $ hg debugmanifestfulltextcache --add 1e01206b1d2f72bd55f2a33fa8ccad74144825b7
140 144 $ hg debugmanifestfulltextcache
141 145 cache contains 2 manifest entries, in order of most to least recent:
142 146 id: 1e01206b1d2f72bd55f2a33fa8ccad74144825b7, size 133 bytes
143 147 id: fce2a30dedad1eef4da95ca1dc0004157aa527cf, size 87 bytes
144 148 total cache data size 268 bytes, on-disk 268 bytes
145 149
146 150 Check cache clearing
147 151
148 152 $ hg debugmanifestfulltextcache --clear
149 153 $ hg debugmanifestfulltextcache
150 154 cache empty
151 155
152 156 Check adding multiple entry in one go:
153 157
154 158 $ hg debugmanifestfulltextcache --add fce2a30dedad1eef4da95ca1dc0004157aa527cf --add 1e01206b1d2f72bd55f2a33fa8ccad74144825b7
155 159 $ hg debugmanifestfulltextcache
156 160 cache contains 2 manifest entries, in order of most to least recent:
157 161 id: 1e01206b1d2f72bd55f2a33fa8ccad74144825b7, size 133 bytes
158 162 id: fce2a30dedad1eef4da95ca1dc0004157aa527cf, size 87 bytes
159 163 total cache data size 268 bytes, on-disk 268 bytes
160 164 $ hg debugmanifestfulltextcache --clear
161 165
162 166 Test caching behavior on actual operation
163 167 -----------------------------------------
164 168
165 169 Make sure we start empty
166 170
167 171 $ hg debugmanifestfulltextcache
168 172 cache empty
169 173
170 174 Commit should have the new node cached:
171 175
172 176 $ echo a >> b/a
173 177 $ hg commit -m 'foo'
174 178 $ hg debugmanifestfulltextcache
175 179 cache contains 2 manifest entries, in order of most to least recent:
176 180 id: 26b8653b67af8c1a0a0317c4ee8dac50a41fdb65, size 133 bytes
177 181 id: 1e01206b1d2f72bd55f2a33fa8ccad74144825b7, size 133 bytes
178 182 total cache data size 314 bytes, on-disk 314 bytes
179 183 $ hg log -r 'ancestors(., 1)' --debug | grep 'manifest:'
180 184 manifest: 1:1e01206b1d2f72bd55f2a33fa8ccad74144825b7
181 185 manifest: 2:26b8653b67af8c1a0a0317c4ee8dac50a41fdb65
General Comments 0
You need to be logged in to leave comments. Login now