# HG changeset patch # User Pierre-Yves David # Date 1608727823 -3600 # Node ID 7ee15bf011d67120e3f4f89f13e06e67924a6bdf # Parent 4de216446c534d8ba4f379d93192b5352a65e6b5 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. diff -r 4de216446c53 -r 7ee15bf011d6 hgext3rd/topic/__init__.py --- 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", diff -r 4de216446c53 -r 7ee15bf011d6 tests/test-split.t --- a/tests/test-split.t Wed Dec 23 13:49:45 2020 +0100 +++ b/tests/test-split.t Wed Dec 23 13:50:23 2020 +0100 @@ -442,7 +442,7 @@ $ hg summary parent: 18:26f72cfaf036 tip Works on mytopic - branch: new-branch + branch: new-branch:mytopic commit: 2 unknown (clean) update: (current) phases: 9 draft diff -r 4de216446c53 -r 7ee15bf011d6 tests/test-topic-fold.t --- a/tests/test-topic-fold.t Wed Dec 23 13:49:45 2020 +0100 +++ b/tests/test-topic-fold.t Wed Dec 23 13:50:23 2020 +0100 @@ -65,7 +65,7 @@ $ hg summary parent: 3:4fd43e5bdc44 tip folded - branch: default + branch: default:myfeature commit: (clean) update: (current) phases: 2 draft diff -r 4de216446c53 -r 7ee15bf011d6 tests/test-topic-stack-data.t --- a/tests/test-topic-stack-data.t Wed Dec 23 13:49:45 2020 +0100 +++ b/tests/test-topic-stack-data.t Wed Dec 23 13:50:23 2020 +0100 @@ -114,7 +114,7 @@ $ hg summary parent: 21:3e54b49a3113 tip add foo_b - branch: lake + branch: lake:foo commit: (clean) update: (current) phases: 22 draft diff -r 4de216446c53 -r 7ee15bf011d6 tests/test-topic-stack.t --- a/tests/test-topic-stack.t Wed Dec 23 13:49:45 2020 +0100 +++ b/tests/test-topic-stack.t Wed Dec 23 13:50:23 2020 +0100 @@ -313,7 +313,7 @@ $ hg summary parent: 3:e629654d7050 c_d - branch: default + branch: default:foo commit: (clean) update: 2 new changesets (update) phases: 4 draft diff -r 4de216446c53 -r 7ee15bf011d6 tests/test-topic-tutorial.t --- a/tests/test-topic-tutorial.t Wed Dec 23 13:49:45 2020 +0100 +++ b/tests/test-topic-tutorial.t Wed Dec 23 13:50:23 2020 +0100 @@ -108,8 +108,8 @@ $ hg summary parent: 0:38da43f0a2ea tip Shopping list - branch: default - commit: (clean) + branch: default:food + commit: (new branch) update: (current) topic: food