changeset 51553:f28d5d68b71a

postincoming: avoid computing branchhead if no report will be posted This otherwise defeat some of the branch v3 optimization.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Wed, 27 Mar 2024 17:21:46 +0000
parents 49faa72b994e
children a151fd01e98c
files mercurial/commands.py
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commands.py	Tue Mar 26 13:46:44 2024 +0000
+++ b/mercurial/commands.py	Wed Mar 27 17:21:46 2024 +0000
@@ -5396,7 +5396,9 @@
             msg = _(b"not updating: %s") % stringutil.forcebytestr(inst)
             hint = inst.hint
             raise error.UpdateAbort(msg, hint=hint)
-    if modheads is not None and modheads > 1:
+    if ui.quiet:
+        pass  # we won't report anything so the other clause are useless.
+    elif modheads is not None and modheads > 1:
         currentbranchheads = len(repo.branchheads())
         if currentbranchheads == modheads:
             ui.status(