# HG changeset patch # User Anton Shestakov # Date 1686013057 10800 # Node ID 4e0f760d332e021e9971b9315487df8d00625ee7 # Parent fba501baf5cb478d08c8f64fc8b9949cf222e169 topic: also find and report topic namespace changes caused by bookmarks diff -r fba501baf5cb -r 4e0f760d332e hgext3rd/topic/__init__.py --- a/hgext3rd/topic/__init__.py Mon Jun 05 21:57:13 2023 -0300 +++ b/hgext3rd/topic/__init__.py Mon Jun 05 21:57:37 2023 -0300 @@ -465,6 +465,14 @@ tns = ctx.topic_namespace(force=True) affected.add(tns) + # We want to detect any bookmark movement, even within one topic namespace + for name, nodes in tr.changes[b'bookmarks'].items(): + for n in nodes: + if n is not None and n in unfi: + ctx = unfi[n] + tns = ctx.topic_namespace() + affected.add(tns) + # We don't care about changesets without topic namespace affected.discard(b'none') diff -r fba501baf5cb -r 4e0f760d332e tests/test-namespaces-report.t --- a/tests/test-namespaces-report.t Mon Jun 05 21:57:13 2023 -0300 +++ b/tests/test-namespaces-report.t Mon Jun 05 21:57:37 2023 -0300 @@ -125,6 +125,56 @@ $ cd .. +5 bookmark movement that affect tns (like putting a bookmark on obsolete changesets) +their topic namespaces reappear and are therefore reported + + $ hg clone orig case-5 -q + $ cd orig + + $ hg debug-topic-namespace dana + $ echo durian > d + $ hg ci -qAm 'durian' + +XXX: should not require --new-branch + + $ hg push ../case-5 --new-branch + pushing to ../case-5 + searching for changes + adding changesets + adding manifests + adding file changes + topic namespaces affected: dana + added 1 changesets with 1 changes to 1 files + + $ hg debug-topic-namespace dave + $ echo dragonfruit > d + $ hg ci --amend -m 'dragonfruit' + +XXX: should not require --new-branch + + $ hg push ../case-5 --new-branch + pushing to ../case-5 + searching for changes + adding changesets + adding manifests + adding file changes + topic namespaces affected: dana dave + added 1 changesets with 1 changes to 1 files (+1 heads) + 1 new obsolescence markers + obsoleted 1 changesets + + $ hg bookmark --hidden -r 'desc("durian")' @ + bookmarking hidden changeset ac97707e6b4a + (hidden revision 'ac97707e6b4a' was rewritten as: 822ac0064503) + + $ hg push ../case-5 -B @ + pushing to ../case-5 + searching for changes + no changes found + topic namespaces affected: dana + exporting bookmark @ + [1] + $ cd .. 6 phase movement: publishing secret changesets (that are known on the server)