diff hgext3rd/topic/__init__.py @ 5685:7ee15bf011d6

topic: wrap branch call during summary Right now, this introduce a bug? however this will prevent the next changesets to break the computation for "how many other changeset on that branch". That last remaining bug (introduced in this series) seems a lesser evil.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Wed, 23 Dec 2020 13:50:23 +0100
parents 18a70ae9fb0b
children d24669df9a4a
line wrap: on
line diff
--- a/hgext3rd/topic/__init__.py	Wed Dec 23 13:49:45 2020 +0100
+++ b/hgext3rd/topic/__init__.py	Wed Dec 23 13:50:23 2020 +0100
@@ -367,6 +367,10 @@
         return [t]
     return []
 
+def wrap_summary(orig, ui, repo, *args, **kwargs):
+    with discovery.override_context_branch(repo) as repo:
+        return orig(ui, repo, *args, **kwargs)
+
 def uisetup(ui):
     destination.modsetup(ui)
     discovery.modsetup(ui)
@@ -402,6 +406,8 @@
     # plug into logic for this into mergemod.update().
     extensions.wrapcommand(commands.table, b'update', checkt0)
 
+    extensions.wrapcommand(commands.table, b'summary', wrap_summary)
+
     try:
         evolve = extensions.find(b'evolve')
         extensions.wrapfunction(evolve.rewriteutil, "presplitupdate",