evolve: add test to demonstrate a bug when no active topic stable
authorSushil khanchi <sushilkhanchi97@gmail.com>
Fri, 20 Dec 2019 17:32:07 +0530
branchstable
changeset 5025 21168e99ba88
parent 5024 b1a9d548af52
child 5026 e7949274c3f9
evolve: add test to demonstrate a bug when no active topic Added test shows that the logic to find the destination for `hg up` in the case when "working directory parent has a topic but wdir has no active topic" is buggy. This will be fixed in next patch.
tests/test-topic-dest.t
--- 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