comparison tests/test-newbranch.t @ 20185:7d4219512823

branchmap: cache open/closed branch head information This lets us determine the open/closed state of a branch without reading from the changelog (which can be costly over NFS and/or with many branches).
author Brodie Rao <brodie@sf.io>
date Mon, 16 Sep 2013 01:08:29 -0700
parents f3b21beb9802
children 7731a2281cf0
comparison
equal deleted inserted replaced
20184:a14d93b2fb1b 20185:7d4219512823
1 $ branchcache=.hg/cache/branchheads 1 $ branchcache=.hg/cache/branch2
2 2
3 $ listbranchcaches() { 3 $ listbranchcaches() {
4 > for f in .hg/cache/branchheads*; 4 > for f in .hg/cache/branch2*;
5 > do echo === $f ===; 5 > do echo === $f ===;
6 > cat $f; 6 > cat $f;
7 > done; 7 > done;
8 > } 8 > }
9 $ purgebranchcaches() { 9 $ purgebranchcaches() {
10 > rm .hg/cache/branchheads* 10 > rm .hg/cache/branch2*
11 > } 11 > }
12 12
13 $ hg init t 13 $ hg init t
14 $ cd t 14 $ cd t
15 15
156 156
157 $ hg log -qr foo 157 $ hg log -qr foo
158 4:adf1a74a7f7b 158 4:adf1a74a7f7b
159 159
160 $ listbranchcaches 160 $ listbranchcaches
161 === .hg/cache/branchheads === 161 === .hg/cache/branch2 ===
162 corrupted 162 corrupted
163 === .hg/cache/branchheads-served === 163 === .hg/cache/branch2-served ===
164 adf1a74a7f7b4cd193d12992f5d0d6a004ed21d6 4 164 adf1a74a7f7b4cd193d12992f5d0d6a004ed21d6 4
165 c21617b13b220988e7a2e26290fbe4325ffa7139 bar 165 c21617b13b220988e7a2e26290fbe4325ffa7139 o bar
166 1c28f494dae69a2f8fc815059d257eccf3fcfe75 default 166 1c28f494dae69a2f8fc815059d257eccf3fcfe75 o default
167 adf1a74a7f7b4cd193d12992f5d0d6a004ed21d6 foo 167 adf1a74a7f7b4cd193d12992f5d0d6a004ed21d6 o foo
168 168
169 Push should update the branch cache: 169 Push should update the branch cache:
170 170
171 $ hg init ../target 171 $ hg init ../target
172 172
173 Pushing just rev 0: 173 Pushing just rev 0:
174 174
175 $ hg push -qr 0 ../target 175 $ hg push -qr 0 ../target
176 176
177 $ (cd ../target/; listbranchcaches) 177 $ (cd ../target/; listbranchcaches)
178 === .hg/cache/branchheads-base === 178 === .hg/cache/branch2-base ===
179 db01e8ea3388fd3c7c94e1436ea2bd6a53d581c5 0 179 db01e8ea3388fd3c7c94e1436ea2bd6a53d581c5 0
180 db01e8ea3388fd3c7c94e1436ea2bd6a53d581c5 default 180 db01e8ea3388fd3c7c94e1436ea2bd6a53d581c5 o default
181 181
182 Pushing everything: 182 Pushing everything:
183 183
184 $ hg push -qf ../target 184 $ hg push -qf ../target
185 185
186 $ (cd ../target/; listbranchcaches) 186 $ (cd ../target/; listbranchcaches)
187 === .hg/cache/branchheads-base === 187 === .hg/cache/branch2-base ===
188 adf1a74a7f7b4cd193d12992f5d0d6a004ed21d6 4 188 adf1a74a7f7b4cd193d12992f5d0d6a004ed21d6 4
189 c21617b13b220988e7a2e26290fbe4325ffa7139 bar 189 c21617b13b220988e7a2e26290fbe4325ffa7139 o bar
190 1c28f494dae69a2f8fc815059d257eccf3fcfe75 default 190 1c28f494dae69a2f8fc815059d257eccf3fcfe75 o default
191 adf1a74a7f7b4cd193d12992f5d0d6a004ed21d6 foo 191 adf1a74a7f7b4cd193d12992f5d0d6a004ed21d6 o foo
192 192
193 Update with no arguments: tipmost revision of the current branch: 193 Update with no arguments: tipmost revision of the current branch:
194 194
195 $ hg up -q -C 0 195 $ hg up -q -C 0
196 $ hg up -q 196 $ hg up -q