diff tests/test-topic.t @ 4703:e15dc6defc99

topic: add tests to demonstrate topic confuses the branchhead checking logic While topics are in play, we store the branchheads (which has a topic) in "branchname:topicname" format. After digging into it I found that even in the case when we should have branch heads for "bname:tname" we get heads for "bname". The tests output reflect the confusion in branch head checking logic. Next patch will be fixing the problem.
author Sushil khanchi <sushilkhanchi97@gmail.com>
date Sun, 14 Apr 2019 12:55:46 +0530
parents 493470e7a0f2
children 5f90eb8fd63c
line wrap: on
line diff
--- a/tests/test-topic.t	Sun Jun 30 23:50:57 2019 +0530
+++ b/tests/test-topic.t	Sun Apr 14 12:55:46 2019 +0530
@@ -1066,3 +1066,29 @@
   abort: cannot use --age while setting a topic
   [255]
   $ cd ..
+
+Test that topics doesn't confuse branchheads checking logic
+-----------------------------------------------------------
+
+  $ hg init hgtags
+  $ cd hgtags
+  $ echo a > a
+  $ hg ci -Am "added a" --config experimental.topic-mode=default
+  adding a
+  $ echo b > b
+  $ hg ci -Am "added b" --config experimental.topic-mode=default
+  adding b
+
+  $ hg topic foo -r .
+  switching to topic foo
+  changed topic on 1 changesets to "foo"
+
+Try to put a tag on current rev which also has an active topic:
+XXX: it shouldn't have aborted here
+  $ hg tag 1.0
+  abort: working directory is not at a branch head (use -f to force)
+  [255]
+  $ hg tags
+  tip                                2:3bbb3fdb2546
+
+  $ cd ..