equal
deleted
inserted
replaced
102 |
102 |
103 import errno |
103 import errno |
104 from node import nullid, nullrev, bin, hex, short |
104 from node import nullid, nullrev, bin, hex, short |
105 from i18n import _ |
105 from i18n import _ |
106 import util |
106 import util |
|
107 import obsolete |
107 |
108 |
108 allphases = public, draft, secret = range(3) |
109 allphases = public, draft, secret = range(3) |
109 trackedphases = allphases[1:] |
110 trackedphases = allphases[1:] |
110 phasenames = ['public', 'draft', 'secret'] |
111 phasenames = ['public', 'draft', 'secret'] |
111 |
112 |
242 # some roots may need to be declared for lower phases |
243 # some roots may need to be declared for lower phases |
243 delroots.extend(olds - roots) |
244 delroots.extend(olds - roots) |
244 # declare deleted root in the target phase |
245 # declare deleted root in the target phase |
245 if targetphase != 0: |
246 if targetphase != 0: |
246 self.retractboundary(repo, targetphase, delroots) |
247 self.retractboundary(repo, targetphase, delroots) |
|
248 obsolete.clearobscaches(repo) |
247 |
249 |
248 def retractboundary(self, repo, targetphase, nodes): |
250 def retractboundary(self, repo, targetphase, nodes): |
249 # Be careful to preserve shallow-copied values: do not update |
251 # Be careful to preserve shallow-copied values: do not update |
250 # phaseroots values, replace them. |
252 # phaseroots values, replace them. |
251 |
253 |
258 currentroots = currentroots.copy() |
260 currentroots = currentroots.copy() |
259 currentroots.update(newroots) |
261 currentroots.update(newroots) |
260 ctxs = repo.set('roots(%ln::)', currentroots) |
262 ctxs = repo.set('roots(%ln::)', currentroots) |
261 currentroots.intersection_update(ctx.node() for ctx in ctxs) |
263 currentroots.intersection_update(ctx.node() for ctx in ctxs) |
262 self._updateroots(targetphase, currentroots) |
264 self._updateroots(targetphase, currentroots) |
|
265 obsolete.clearobscaches(repo) |
263 |
266 |
264 def advanceboundary(repo, targetphase, nodes): |
267 def advanceboundary(repo, targetphase, nodes): |
265 """Add nodes to a phase changing other nodes phases if necessary. |
268 """Add nodes to a phase changing other nodes phases if necessary. |
266 |
269 |
267 This function move boundary *forward* this means that all nodes |
270 This function move boundary *forward* this means that all nodes |