Commit 82228f44 authored by Anton Shestakov's avatar Anton Shestakov
Browse files

next: refactor two if blocks into an if-elif block

We already checked the value of `needevolve and opts['evolve']` in the first if
block above. In the first one it need to be True, in the second it needs to be
False for the statements to execute. Since not(a or b) = not a and not b, we
can join the second if block to the first one with an elif while dropping the
explicit check.

For me, this works better, because we're doing the same thing in both of these
blocks (checking if working copy is dirty or not).

branch : stable
parent 126b9be3482d
Pipeline #22030 passed with stage
in 4 minutes and 31 seconds
......@@ -882,8 +882,7 @@ def cmdnext(ui, repo, **opts):
if needevolve and opts['evolve']:
hint = _(b'use `hg amend`, `hg revert` or `hg shelve`')
cmdutil.bailifchanged(repo, hint=hint)
if not (opts['merge'] or (needevolve and opts['evolve'])):
elif not opts['merge']:
# we only skip the check if noconflict is set
if ui.config(b'commands', b'update.check') == b'noconflict':
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment