Show More
@@ -1840,7 +1840,7 b' def handlepushkey(op, inpart):' | |||||
1840 | def handlephases(op, inpart): |
|
1840 | def handlephases(op, inpart): | |
1841 | """apply phases from bundle part to repo""" |
|
1841 | """apply phases from bundle part to repo""" | |
1842 | headsbyphase = phases.binarydecode(inpart) |
|
1842 | headsbyphase = phases.binarydecode(inpart) | |
1843 |
phases.updatephases(op.repo.unfiltered(), op.gettransaction |
|
1843 | phases.updatephases(op.repo.unfiltered(), op.gettransaction, headsbyphase) | |
1844 | op.records.add('phase-heads', {}) |
|
1844 | op.records.add('phase-heads', {}) | |
1845 |
|
1845 | |||
1846 | @parthandler('reply:pushkey', ('return', 'in-reply-to')) |
|
1846 | @parthandler('reply:pushkey', ('return', 'in-reply-to')) |
@@ -558,11 +558,18 b' def subsetphaseheads(repo, subset):' | |||||
558 | headsbyphase[phase] = [cl.node(r) for r in repo.revs(revset, subset)] |
|
558 | headsbyphase[phase] = [cl.node(r) for r in repo.revs(revset, subset)] | |
559 | return headsbyphase |
|
559 | return headsbyphase | |
560 |
|
560 | |||
561 | def updatephases(repo, tr, headsbyphase): |
|
561 | def updatephases(repo, trgetter, headsbyphase): | |
562 | """Updates the repo with the given phase heads""" |
|
562 | """Updates the repo with the given phase heads""" | |
563 | # Now advance phase boundaries of all but secret phase |
|
563 | # Now advance phase boundaries of all but secret phase | |
|
564 | # | |||
|
565 | # run the update (and fetch transaction) only if there are actually things | |||
|
566 | # to update. This avoid creating empty transaction during no-op operation. | |||
|
567 | ||||
564 | for phase in allphases[:-1]: |
|
568 | for phase in allphases[:-1]: | |
565 | advanceboundary(repo, tr, phase, headsbyphase[phase]) |
|
569 | revset = '%%ln - %s()' % phasenames[phase] | |
|
570 | heads = [c.node() for c in repo.set(revset, headsbyphase[phase])] | |||
|
571 | if heads: | |||
|
572 | advanceboundary(repo, trgetter(), phase, heads) | |||
566 |
|
573 | |||
567 | def analyzeremotephases(repo, subset, roots): |
|
574 | def analyzeremotephases(repo, subset, roots): | |
568 | """Compute phases heads and root in a subset of node from root dict |
|
575 | """Compute phases heads and root in a subset of node from root dict |
General Comments 0
You need to be logged in to leave comments.
Login now