comparison mercurial/dirstate.py @ 47516:b8ffe85e399b

dirstate-entry: `merged_removed` and `from_p2_removed` properties Lets start to define and use more semantic property. These two might be a bit too low level and could be shaved off later, however this seems an improvement for now. Differential Revision: https://phab.mercurial-scm.org/D10958
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Sat, 03 Jul 2021 20:34:09 +0200
parents c94d3ff46fd5
children 28632eb3ca3e
comparison
equal deleted inserted replaced
47515:c94d3ff46fd5 47516:b8ffe85e399b
529 # if there is a merge going on and the file was either 529 # if there is a merge going on and the file was either
530 # "merged" or coming from other parent (-2) before 530 # "merged" or coming from other parent (-2) before
531 # being removed, restore that state. 531 # being removed, restore that state.
532 entry = self._map.get(f) 532 entry = self._map.get(f)
533 if entry is not None: 533 if entry is not None:
534 if entry.removed and (entry[2] == NONNORMAL or entry.from_p2): 534 # XXX this should probably be dealt with a a lower level
535 # (see `merged_removed` and `from_p2_removed`)
536 if entry.merged_removed or entry.from_p2_removed:
535 source = self._map.copymap.get(f) 537 source = self._map.copymap.get(f)
536 if entry[2] == NONNORMAL: 538 if entry.merged_removed:
537 self.merge(f) 539 self.merge(f)
538 elif entry.from_p2: 540 elif entry.from_p2_removed:
539 self.otherparent(f) 541 self.otherparent(f)
540 if source: 542 if source is not None:
541 self.copy(source, f) 543 self.copy(source, f)
542 return 544 return
543 if entry.merged or entry.state == b'n' and entry.from_p2: 545 elif entry.merged or entry.state == b'n' and entry.from_p2:
544 return 546 return
545 self._addpath(f, b'n', 0, possibly_dirty=True) 547 self._addpath(f, b'n', 0, possibly_dirty=True)
546 self._map.copymap.pop(f, None) 548 self._map.copymap.pop(f, None)
547 549
548 def otherparent(self, f): 550 def otherparent(self, f):