comparison mercurial/dirstate.py @ 47479:e6b303eb8f7d

dirstate: split a not-so-one-liner This is shorter and simpler to read. Differential Revision: https://phab.mercurial-scm.org/D10923
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Thu, 01 Jul 2021 18:56:34 +0200
parents eb416759af7e
children f93298a48da1
comparison
equal deleted inserted replaced
47478:ca8121d26732 47479:e6b303eb8f7d
500 self._map.copymap.pop(f, None) 500 self._map.copymap.pop(f, None)
501 501
502 def otherparent(self, f): 502 def otherparent(self, f):
503 '''Mark as coming from the other parent, always dirty.''' 503 '''Mark as coming from the other parent, always dirty.'''
504 if self._pl[1] == self._nodeconstants.nullid: 504 if self._pl[1] == self._nodeconstants.nullid:
505 raise error.Abort( 505 msg = _(b"setting %r to other parent only allowed in merges") % f
506 _(b"setting %r to other parent only allowed in merges") % f 506 raise error.Abort(msg)
507 )
508 if f in self and self[f] == b'n': 507 if f in self and self[f] == b'n':
509 # merge-like 508 # merge-like
510 self._addpath(f, b'm', 0, -2, -1) 509 self._addpath(f, b'm', 0, -2, -1)
511 else: 510 else:
512 # add-like 511 # add-like