comparison mercurial/dirstatemap.py @ 48060:a660d8a53267

dirstate: use a new `drop_merge_data` in `setparent` What is happening in this `setparent` loop is that we remove all `merge` related information when the dirstate is moved out of a `merge` situation. So instead of shuffling state to get them where we want, we simply add a method on the DirstateItem to do drop the information we want dropped. Differential Revision: https://phab.mercurial-scm.org/D11506
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Wed, 22 Sep 2021 17:46:29 +0200
parents 5d68c4eedd66
children 060cd909439f
comparison
equal deleted inserted replaced
48059:5d68c4eedd66 48060:a660d8a53267
439 s = self.get(f) 439 s = self.get(f)
440 if s is None: 440 if s is None:
441 continue 441 continue
442 442
443 # Discard "merged" markers when moving away from a merge state 443 # Discard "merged" markers when moving away from a merge state
444 if s.merged: 444 if s.merged or s.from_p2:
445 source = self.copymap.get(f) 445 source = self.copymap.pop(f, None)
446 if source: 446 if source:
447 copies[f] = source 447 copies[f] = source
448 self.reset_state( 448 s.drop_merge_data()
449 f,
450 wc_tracked=True,
451 p1_tracked=True,
452 possibly_dirty=True,
453 )
454 # Also fix up otherparent markers
455 elif s.from_p2:
456 source = self.copymap.get(f)
457 if source:
458 copies[f] = source
459 self.reset_state(
460 f,
461 p1_tracked=False,
462 wc_tracked=True,
463 )
464 return copies 449 return copies
465 450
466 def read(self): 451 def read(self):
467 # ignore HG_PENDING because identity is used only for writing 452 # ignore HG_PENDING because identity is used only for writing
468 self.identity = util.filestat.frompath( 453 self.identity = util.filestat.frompath(