Mercurial > public > mercurial-scm > hg-stable
diff mercurial/repair.py @ 18395:904b7109938e
destroyed: drop complex branchcache rebuilt logic
The strip code used a trick to lower the cost of branchcache update after a
strip. However is less necessary since we have branchcache collaboration.
Invalid branchcache are likely to be cheaply rebuilt again a near subset of the
repo.
Moreover, this trick would need update to be relevant in the now filtered
repository world. It currently update the unfiltered branchcache that few people
cares about. Make it smarter on that aspect would need complexes update of the
calling logic
So this mechanism is:
- Arguably needed,
- Currently irrelevant,
- Hard to update
and I'm dropping it.
We now update the branchcache in all case by courtesy of the read only reader.
This changeset have a few expected impact on the testsuite are different cache
are updated.
author | Pierre-Yves David <pierre-yves.david@logilab.fr> |
---|---|
date | Wed, 16 Jan 2013 00:09:26 +0100 |
parents | 084074648755 |
children | 64b5562550e2 |
line wrap: on
line diff
--- a/mercurial/repair.py Wed Jan 16 00:08:08 2013 +0100 +++ b/mercurial/repair.py Wed Jan 16 00:09:26 2013 +0100 @@ -66,17 +66,6 @@ striplist = [cl.rev(node) for node in nodelist] striprev = min(striplist) - # Generate set of branches who will have nodes stripped. - striprevs = repo.revs("%ld::", striplist) - stripbranches = set([repo[rev].branch() for rev in striprevs]) - - # Set of potential new heads resulting from the strip. The parents of any - # node removed could be a new head because the node to be removed could have - # been the only child of the parent. - newheadrevs = repo.revs("parents(%ld::) - %ld::", striprevs, striprevs) - newheadnodes = set([cl.node(rev) for rev in newheadrevs]) - newheadbranches = set([repo[rev].branch() for rev in newheadrevs]) - keeppartialbundle = backup == 'strip' # Some revisions with rev > striprev may not be descendants of striprev. @@ -191,10 +180,4 @@ % chgrpfile) raise - if len(stripbranches) == 1 and len(newheadbranches) == 1 \ - and stripbranches == newheadbranches: - repo.destroyed(newheadnodes) - else: - # Multiple branches involved in strip. Will allow branchcache to become - # invalid and later on rebuilt from scratch - repo.destroyed() + repo.destroyed()