comparison mercurial/repair.py @ 18121:f8a13f061a8a

branchmap: extract updatebranchcache from repo
author Pierre-Yves David <pierre-yves.david@logilab.fr>
date Thu, 20 Dec 2012 14:45:17 +0100
parents fe8caf28d580
children 4499ba5ac35c
comparison
equal deleted inserted replaced
18120:88990d3e3d75 18121:f8a13f061a8a
4 # Copyright 2007 Matt Mackall 4 # Copyright 2007 Matt Mackall
5 # 5 #
6 # This software may be used and distributed according to the terms of the 6 # This software may be used and distributed according to the terms of the
7 # GNU General Public License version 2 or any later version. 7 # GNU General Public License version 2 or any later version.
8 8
9 from mercurial import changegroup 9 from mercurial import changegroup, branchmap
10 from mercurial.node import short 10 from mercurial.node import short
11 from mercurial.i18n import _ 11 from mercurial.i18n import _
12 import os 12 import os
13 import errno 13 import errno
14 14
58 def strip(ui, repo, nodelist, backup="all", topic='backup'): 58 def strip(ui, repo, nodelist, backup="all", topic='backup'):
59 repo = repo.unfiltered() 59 repo = repo.unfiltered()
60 # It simplifies the logic around updating the branchheads cache if we only 60 # It simplifies the logic around updating the branchheads cache if we only
61 # have to consider the effect of the stripped revisions and not revisions 61 # have to consider the effect of the stripped revisions and not revisions
62 # missing because the cache is out-of-date. 62 # missing because the cache is out-of-date.
63 repo.updatebranchcache() 63 branchmap.updatecache(repo)
64 64
65 cl = repo.changelog 65 cl = repo.changelog
66 # TODO handle undo of merge sets 66 # TODO handle undo of merge sets
67 if isinstance(nodelist, str): 67 if isinstance(nodelist, str):
68 nodelist = [nodelist] 68 nodelist = [nodelist]