changeset 51603:231a92eb1936

phases: more compact error handling in analyzeremotephases using an intermediate variable result in more readable code, so let us use it.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Fri, 05 Apr 2024 11:17:25 +0200
parents b5d494f7d28a
children 87655e6dc108
files mercurial/phases.py
diffstat 1 files changed, 4 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- 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