2245 if name.startswith(b'branch2'): |
2245 if name.startswith(b'branch2'): |
2246 filtername = name.partition(b'-')[2] or b'unfiltered' |
2246 filtername = name.partition(b'-')[2] or b'unfiltered' |
2247 ui.status(b'%s - %s\n' |
2247 ui.status(b'%s - %s\n' |
2248 % (filtername, util.bytecount(st.st_size))) |
2248 % (filtername, util.bytecount(st.st_size))) |
2249 return |
2249 return |
2250 if filter: |
2250 if not filter: |
|
2251 filter = None |
|
2252 subsettable = getbranchmapsubsettable() |
|
2253 if filter is None: |
|
2254 repo = repo.unfiltered() |
|
2255 else: |
2251 repo = repoview.repoview(repo, filter) |
2256 repo = repoview.repoview(repo, filter) |
2252 else: |
|
2253 repo = repo.unfiltered() |
|
2254 |
2257 |
2255 repo.branchmap() # make sure we have a relevant, up to date branchmap |
2258 repo.branchmap() # make sure we have a relevant, up to date branchmap |
2256 |
2259 |
|
2260 currentfilter = filter |
2257 # try once without timer, the filter may not be cached |
2261 # try once without timer, the filter may not be cached |
2258 if branchmap.read(repo) is None: |
2262 while branchmap.read(repo) is None: |
2259 raise error.Abort(b'No branchmap cached for %s repo' |
2263 currentfilter = subsettable.get(currentfilter) |
2260 % (filter or b'unfiltered')) |
2264 if currentfilter is None: |
|
2265 raise error.Abort(b'No branchmap cached for %s repo' |
|
2266 % (filter or b'unfiltered')) |
|
2267 repo = repo.filtered(currentfilter) |
2261 timer, fm = gettimer(ui, opts) |
2268 timer, fm = gettimer(ui, opts) |
2262 def setup(): |
2269 def setup(): |
2263 if clearrevlogs: |
2270 if clearrevlogs: |
2264 clearchangelog(repo) |
2271 clearchangelog(repo) |
2265 def bench(): |
2272 def bench(): |