postincoming: avoid computing branchhead if no report will be posted
This otherwise defeat some of the branch v3 optimization.
--- 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(