--- a/tests/test-topic-dest.t Fri Dec 20 17:31:57 2019 +0530
+++ b/tests/test-topic-dest.t Fri Dec 20 17:32:07 2019 +0530
@@ -515,3 +515,16 @@
$ hg up
clearing empty topic "foo"
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+destination check: when wdp has a topic but wdir has no active topic:
+
+ $ hg topic foo
+ marked working directory as topic: foo
+ $ echo b > b
+ $ hg ci -Am "added b"
+ adding b
+ active topic 'foo' grew its first changeset
+ (see 'hg help topics' for more information)
+ $ hg topic --clear
+ $ hg up 2>&1 | grep "AssertionError"
+ AssertionError: any revision has at least one descendant branch head