mercurial/dirstatemap.py
changeset 48148 e2753a7acfa7
parent 48140 98b3eb6c1479
child 48151 e0b4e4f80fff
equal deleted inserted replaced
48147:142e9f0a70b5 48148:e2753a7acfa7
   330         self._dirtyparents = True
   330         self._dirtyparents = True
   331         copies = {}
   331         copies = {}
   332         if fold_p2:
   332         if fold_p2:
   333             for f, s in pycompat.iteritems(self._map):
   333             for f, s in pycompat.iteritems(self._map):
   334                 # Discard "merged" markers when moving away from a merge state
   334                 # Discard "merged" markers when moving away from a merge state
   335                 if s.merged or s.from_p2:
   335                 if s.p2_info:
   336                     source = self.copymap.pop(f, None)
   336                     source = self.copymap.pop(f, None)
   337                     if source:
   337                     if source:
   338                         copies[f] = source
   338                         copies[f] = source
   339                     s.drop_merge_data()
   339                     s.drop_merge_data()
   340         return copies
   340         return copies
   602                 # exception due to mutation during iteration.
   602                 # exception due to mutation during iteration.
   603                 # TODO: move this the whole loop to Rust where `iter_mut`
   603                 # TODO: move this the whole loop to Rust where `iter_mut`
   604                 # enables in-place mutation of elements of a collection while
   604                 # enables in-place mutation of elements of a collection while
   605                 # iterating it, without mutating the collection itself.
   605                 # iterating it, without mutating the collection itself.
   606                 files_with_p2_info = [
   606                 files_with_p2_info = [
   607                     f for f, s in self._map.items() if s.merged or s.from_p2
   607                     f for f, s in self._map.items() if s.p2_info
   608                 ]
   608                 ]
   609                 rust_map = self._map
   609                 rust_map = self._map
   610                 for f in files_with_p2_info:
   610                 for f in files_with_p2_info:
   611                     e = rust_map.get(f)
   611                     e = rust_map.get(f)
   612                     source = self.copymap.pop(f, None)
   612                     source = self.copymap.pop(f, None)