equal
deleted
inserted
replaced
113 nullrev, |
113 nullrev, |
114 short, |
114 short, |
115 ) |
115 ) |
116 from . import ( |
116 from . import ( |
117 error, |
117 error, |
118 util, |
|
119 ) |
118 ) |
120 |
119 |
121 allphases = public, draft, secret = range(3) |
120 allphases = public, draft, secret = range(3) |
122 trackedphases = allphases[1:] |
121 trackedphases = allphases[1:] |
123 phasenames = ['public', 'draft', 'secret'] |
122 phasenames = ['public', 'draft', 'secret'] |
304 currentroots = self.phaseroots[targetphase] |
303 currentroots = self.phaseroots[targetphase] |
305 newroots = [n for n in nodes |
304 newroots = [n for n in nodes |
306 if self.phase(repo, repo[n].rev()) < targetphase] |
305 if self.phase(repo, repo[n].rev()) < targetphase] |
307 if newroots: |
306 if newroots: |
308 if nullid in newroots: |
307 if nullid in newroots: |
309 raise util.Abort(_('cannot change null revision phase')) |
308 raise error.Abort(_('cannot change null revision phase')) |
310 currentroots = currentroots.copy() |
309 currentroots = currentroots.copy() |
311 currentroots.update(newroots) |
310 currentroots.update(newroots) |
312 ctxs = repo.set('roots(%ln::)', currentroots) |
311 ctxs = repo.set('roots(%ln::)', currentroots) |
313 currentroots.intersection_update(ctx.node() for ctx in ctxs) |
312 currentroots.intersection_update(ctx.node() for ctx in ctxs) |
314 self._updateroots(targetphase, currentroots, tr) |
313 self._updateroots(targetphase, currentroots, tr) |