##// END OF EJS Templates
dirstatemap: align the Rust wrapper implementation of `setparent`...
marmoute -
r48948:bda85920 default
parent child Browse files
Show More
@@ -638,33 +638,17 b' if rustmod is not None:'
638 # TODO: move this the whole loop to Rust where `iter_mut`
638 # TODO: move this the whole loop to Rust where `iter_mut`
639 # enables in-place mutation of elements of a collection while
639 # enables in-place mutation of elements of a collection while
640 # iterating it, without mutating the collection itself.
640 # iterating it, without mutating the collection itself.
641 candidatefiles = [
641 files_with_p2_info = [
642 (f, s)
642 f for f, s in self._map.items() if s.merged or s.from_p2
643 for f, s in self._map.items()
644 if s.merged or s.from_p2
645 ]
643 ]
646 for f, s in candidatefiles:
644 rust_map = self._map
647 # Discard "merged" markers when moving away from a merge state
645 for f in files_with_p2_info:
648 if s.merged:
646 e = rust_map.get(f)
649 source = self.copymap.get(f)
647 source = self.copymap.pop(f, None)
650 if source:
648 if source:
651 copies[f] = source
649 copies[f] = source
652 self.reset_state(
650 e.drop_merge_data()
653 f,
651 rust_map.set_dirstate_item(f, e)
654 wc_tracked=True,
655 p1_tracked=True,
656 possibly_dirty=True,
657 )
658 # Also fix up otherparent markers
659 elif s.from_p2:
660 source = self.copymap.get(f)
661 if source:
662 copies[f] = source
663 self.reset_state(
664 f,
665 p1_tracked=False,
666 wc_tracked=True,
667 )
668 return copies
652 return copies
669
653
670 def parents(self):
654 def parents(self):
General Comments 0
You need to be logged in to leave comments. Login now