Show More
@@ -269,9 +269,10 b' class bundlephasecache(phases.phasecache' | |||||
269 | def _write(self, fp): |
|
269 | def _write(self, fp): | |
270 | raise NotImplementedError |
|
270 | raise NotImplementedError | |
271 |
|
271 | |||
272 | def _updateroots(self, repo, phase, newroots, tr): |
|
272 | def _updateroots(self, repo, phase, newroots, tr, invalidate=True): | |
273 | self._phaseroots[phase] = newroots |
|
273 | self._phaseroots[phase] = newroots | |
274 |
|
|
274 | if invalidate: | |
|
275 | self.invalidate() | |||
275 | self.dirty = True |
|
276 | self.dirty = True | |
276 |
|
277 | |||
277 |
|
278 |
@@ -624,10 +624,11 b' class phasecache:' | |||||
624 | fp.write(b'%i %s\n' % (phase, hex(h))) |
|
624 | fp.write(b'%i %s\n' % (phase, hex(h))) | |
625 | self.dirty = False |
|
625 | self.dirty = False | |
626 |
|
626 | |||
627 | def _updateroots(self, repo, phase, newroots, tr): |
|
627 | def _updateroots(self, repo, phase, newroots, tr, invalidate=True): | |
628 | self._phaseroots[phase] = newroots |
|
628 | self._phaseroots[phase] = newroots | |
629 | self.invalidate() |
|
|||
630 | self.dirty = True |
|
629 | self.dirty = True | |
|
630 | if invalidate: | |||
|
631 | self.invalidate() | |||
631 |
|
632 | |||
632 | assert repo.filtername is None |
|
633 | assert repo.filtername is None | |
633 | wrepo = weakref.ref(repo) |
|
634 | wrepo = weakref.ref(repo) | |
@@ -811,11 +812,23 b' class phasecache:' | |||||
811 | changed_revs[r] = r_phase |
|
812 | changed_revs[r] = r_phase | |
812 | elif r in currentroots: |
|
813 | elif r in currentroots: | |
813 | replaced_roots.add(r) |
|
814 | replaced_roots.add(r) | |
|
815 | sets = self._phasesets | |||
|
816 | sets[targetphase].update(changed_revs) | |||
|
817 | for r, old in changed_revs.items(): | |||
|
818 | if old > public: | |||
|
819 | sets[old].discard(r) | |||
814 |
|
820 | |||
815 | if new_roots: |
|
821 | if new_roots: | |
816 | assert changed_revs |
|
822 | assert changed_revs | |
|
823 | ||||
817 | final_roots = new_roots | currentroots - replaced_roots |
|
824 | final_roots = new_roots | currentroots - replaced_roots | |
818 |
self._updateroots( |
|
825 | self._updateroots( | |
|
826 | repo, | |||
|
827 | targetphase, | |||
|
828 | final_roots, | |||
|
829 | tr, | |||
|
830 | invalidate=False, | |||
|
831 | ) | |||
819 | if targetphase > 1: |
|
832 | if targetphase > 1: | |
820 | retracted = set(changed_revs) |
|
833 | retracted = set(changed_revs) | |
821 | for lower_phase in range(1, targetphase): |
|
834 | for lower_phase in range(1, targetphase): | |
@@ -824,7 +837,13 b' class phasecache:' | |||||
824 | continue |
|
837 | continue | |
825 | if lower_roots & retracted: |
|
838 | if lower_roots & retracted: | |
826 | simpler_roots = lower_roots - retracted |
|
839 | simpler_roots = lower_roots - retracted | |
827 |
self._updateroots( |
|
840 | self._updateroots( | |
|
841 | repo, | |||
|
842 | lower_phase, | |||
|
843 | simpler_roots, | |||
|
844 | tr, | |||
|
845 | invalidate=False, | |||
|
846 | ) | |||
828 | return changed_revs |
|
847 | return changed_revs | |
829 | else: |
|
848 | else: | |
830 | assert not changed_revs |
|
849 | assert not changed_revs |
General Comments 0
You need to be logged in to leave comments.
Login now