##// END OF EJS Templates
phase: add a transaction argument to advanceboundary...
Pierre-Yves David -
r22069:616a455b default
parent child Browse files
Show More
@@ -932,7 +932,7 b' class queue(object):'
932 if oldqbase.phase() > tphase and oldqbase.p1().phase() <= tphase:
932 if oldqbase.phase() > tphase and oldqbase.p1().phase() <= tphase:
933 tr = repo.transaction('qfinish')
933 tr = repo.transaction('qfinish')
934 try:
934 try:
935 phases.advanceboundary(repo, tphase, qfinished)
935 phases.advanceboundary(repo, tr, tphase, qfinished)
936 tr.close()
936 tr.close()
937 finally:
937 finally:
938 tr.release()
938 tr.release()
@@ -700,12 +700,12 b' def addchangegroup(repo, source, srctype'
700 # We should not use added here but the list of all change in
700 # We should not use added here but the list of all change in
701 # the bundle
701 # the bundle
702 if publishing:
702 if publishing:
703 phases.advanceboundary(repo, phases.public, srccontent)
703 phases.advanceboundary(repo, tr, phases.public, srccontent)
704 else:
704 else:
705 # Those changesets have been pushed from the outside, their
705 # Those changesets have been pushed from the outside, their
706 # phases are going to be pushed alongside. Therefor
706 # phases are going to be pushed alongside. Therefor
707 # `targetphase` is ignored.
707 # `targetphase` is ignored.
708 phases.advanceboundary(repo, phases.draft, srccontent)
708 phases.advanceboundary(repo, tr, phases.draft, srccontent)
709 phases.retractboundary(repo, phases.draft, added)
709 phases.retractboundary(repo, phases.draft, added)
710 elif srctype != 'strip':
710 elif srctype != 'strip':
711 # publishing only alter behavior during push
711 # publishing only alter behavior during push
@@ -4583,7 +4583,7 b' def phase(ui, repo, *revs, **opts):'
4583 raise util.Abort(_('empty revision set'))
4583 raise util.Abort(_('empty revision set'))
4584 nodes = [repo[r].node() for r in revs]
4584 nodes = [repo[r].node() for r in revs]
4585 olddata = repo._phasecache.getphaserevs(repo)[:]
4585 olddata = repo._phasecache.getphaserevs(repo)[:]
4586 phases.advanceboundary(repo, targetphase, nodes)
4586 phases.advanceboundary(repo, tr, targetphase, nodes)
4587 if opts['force']:
4587 if opts['force']:
4588 phases.retractboundary(repo, targetphase, nodes)
4588 phases.retractboundary(repo, targetphase, nodes)
4589 tr.close()
4589 tr.close()
@@ -577,7 +577,7 b' def _localphasemove(pushop, nodes, phase'
577 if pushop.locallocked:
577 if pushop.locallocked:
578 tr = pushop.repo.transaction('push-phase-sync')
578 tr = pushop.repo.transaction('push-phase-sync')
579 try:
579 try:
580 phases.advanceboundary(pushop.repo, phase, nodes)
580 phases.advanceboundary(pushop.repo, tr, phase, nodes)
581 tr.close()
581 tr.close()
582 finally:
582 finally:
583 tr.release()
583 tr.release()
@@ -840,12 +840,14 b' def _pullapplyphases(pullop, remotephase'
840 # exclude changesets already public locally and update the others
840 # exclude changesets already public locally and update the others
841 pheads = [pn for pn in pheads if phase(unfi, rev(pn)) > public]
841 pheads = [pn for pn in pheads if phase(unfi, rev(pn)) > public]
842 if pheads:
842 if pheads:
843 phases.advanceboundary(pullop.repo, public, pheads)
843 tr = pullop.gettransaction()
844 phases.advanceboundary(pullop.repo, tr, public, pheads)
844
845
845 # exclude changesets already draft locally and update the others
846 # exclude changesets already draft locally and update the others
846 dheads = [pn for pn in dheads if phase(unfi, rev(pn)) > draft]
847 dheads = [pn for pn in dheads if phase(unfi, rev(pn)) > draft]
847 if dheads:
848 if dheads:
848 phases.advanceboundary(pullop.repo, draft, dheads)
849 tr = pullop.gettransaction()
850 phases.advanceboundary(pullop.repo, tr, draft, dheads)
849
851
850 def _pullobsolete(pullop):
852 def _pullobsolete(pullop):
851 """utility function to pull obsolete markers from a remote
853 """utility function to pull obsolete markers from a remote
@@ -208,7 +208,7 b' class phasecache(object):'
208 self._phaserevs = None
208 self._phaserevs = None
209 self.dirty = True
209 self.dirty = True
210
210
211 def advanceboundary(self, repo, targetphase, nodes):
211 def advanceboundary(self, repo, tr, targetphase, nodes):
212 # Be careful to preserve shallow-copied values: do not update
212 # Be careful to preserve shallow-copied values: do not update
213 # phaseroots values, replace them.
213 # phaseroots values, replace them.
214
214
@@ -278,7 +278,7 b' class phasecache(object):'
278 # (see branchmap one)
278 # (see branchmap one)
279 self._phaserevs = None
279 self._phaserevs = None
280
280
281 def advanceboundary(repo, targetphase, nodes):
281 def advanceboundary(repo, tr, targetphase, nodes):
282 """Add nodes to a phase changing other nodes phases if necessary.
282 """Add nodes to a phase changing other nodes phases if necessary.
283
283
284 This function move boundary *forward* this means that all nodes
284 This function move boundary *forward* this means that all nodes
@@ -286,7 +286,7 b' def advanceboundary(repo, targetphase, n'
286
286
287 Simplify boundary to contains phase roots only."""
287 Simplify boundary to contains phase roots only."""
288 phcache = repo._phasecache.copy()
288 phcache = repo._phasecache.copy()
289 phcache.advanceboundary(repo, targetphase, nodes)
289 phcache.advanceboundary(repo, tr, targetphase, nodes)
290 repo._phasecache.replace(phcache)
290 repo._phasecache.replace(phcache)
291
291
292 def retractboundary(repo, targetphase, nodes):
292 def retractboundary(repo, targetphase, nodes):
@@ -339,7 +339,7 b' def pushphase(repo, nhex, oldphasestr, n'
339 oldphase = abs(int(oldphasestr)) # let's avoid negative index surprise
339 oldphase = abs(int(oldphasestr)) # let's avoid negative index surprise
340 if currentphase == oldphase and newphase < oldphase:
340 if currentphase == oldphase and newphase < oldphase:
341 tr = repo.transaction('pushkey-phase')
341 tr = repo.transaction('pushkey-phase')
342 advanceboundary(repo, newphase, [bin(nhex)])
342 advanceboundary(repo, tr, newphase, [bin(nhex)])
343 tr.close()
343 tr.close()
344 return 1
344 return 1
345 elif currentphase == newphase:
345 elif currentphase == newphase:
General Comments 0
You need to be logged in to leave comments. Login now