postincoming: avoid computing branchhead if no report will be posted
authorPierre-Yves David <pierre-yves.david@octobus.net>
Wed, 27 Mar 2024 17:21:46 +0000
changeset 51553 f28d5d68b71a
parent 51552 49faa72b994e
child 51554 a151fd01e98c
postincoming: avoid computing branchhead if no report will be posted This otherwise defeat some of the branch v3 optimization.
mercurial/commands.py
--- 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(