comparison mercurial/merge.py @ 48706:00bfd920169d

merge: break up a not-so-one-liner for readability Differential Revision: https://phab.mercurial-scm.org/D12109
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Fri, 28 Jan 2022 14:25:45 +0100
parents bca57b01518f
children 48aff31e7f4c
comparison
equal deleted inserted replaced
48705:bca57b01518f 48706:00bfd920169d
1929 if not mergeancestor and wc.branch() == p2.branch(): 1929 if not mergeancestor and wc.branch() == p2.branch():
1930 msg = _(b"nothing to merge") 1930 msg = _(b"nothing to merge")
1931 hint = _(b"use 'hg update' or check 'hg heads'") 1931 hint = _(b"use 'hg update' or check 'hg heads'")
1932 raise error.Abort(msg, hint=hint) 1932 raise error.Abort(msg, hint=hint)
1933 if not force and (wc.files() or wc.deleted()): 1933 if not force and (wc.files() or wc.deleted()):
1934 raise error.StateError( 1934 msg = _(b"uncommitted changes")
1935 _(b"uncommitted changes"), 1935 hint = _(b"use 'hg status' to list changes")
1936 hint=_(b"use 'hg status' to list changes"), 1936 raise error.StateError(msg, hint=hint)
1937 )
1938 if not wc.isinmemory(): 1937 if not wc.isinmemory():
1939 for s in sorted(wc.substate): 1938 for s in sorted(wc.substate):
1940 wc.sub(s).bailifchanged() 1939 wc.sub(s).bailifchanged()
1941 1940
1942 elif not overwrite: 1941 elif not overwrite: