phases: more compact error handling in analyzeremotephases
using an intermediate variable result in more readable code, so let us use it.
--- 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