# HG changeset patch # User Pierre-Yves David # Date 1712308645 -7200 # Node ID 231a92eb1936935a6a7349be1c88b67ea167ecbd # Parent b5d494f7d28aea15a6d61b2128a8e6595716a905 phases: more compact error handling in analyzeremotephases using an intermediate variable result in more readable code, so let us use it. diff -r b5d494f7d28a -r 231a92eb1936 mercurial/phases.py --- a/mercurial/phases.py Tue Apr 09 02:54:12 2024 +0200 +++ b/mercurial/phases.py Fri Apr 05 11:17:25 2024 +0200 @@ -1114,21 +1114,14 @@ phase = int(phase) if phase == public: if node != repo.nullid: - repo.ui.warn( - _( - b'ignoring inconsistent public root' - b' from remote: %s\n' - ) - % nhex - ) + msg = _(b'ignoring inconsistent public root from remote: %s\n') + repo.ui.warn(msg % nhex) elif phase == draft: if has_node(node): draftroots.append(node) else: - repo.ui.warn( - _(b'ignoring unexpected root from remote: %i %s\n') - % (phase, nhex) - ) + msg = _(b'ignoring unexpected root from remote: %i %s\n') + repo.ui.warn(msg % (phase, nhex)) # compute heads publicheads = newheads(repo, subset, draftroots) return publicheads, draftroots