diff tests/test-topic.t @ 4061:ad4194399b47

topic: handle ambiguous arguments to topic() revset These arguments can be interpreted as either string or a revset. The decision is made based on existence of topic with such a name. This matches the behavior of branch() revset. The code needs to know all topics that ever existed in the repo, because some commands report "disappearance" of topics after certain operations, using this revset (e.g. via stack.stack or repo.revs).
author Anton Shestakov <av6@dwimlabs.net>
date Thu, 30 Aug 2018 21:05:17 +0800
parents 54eade86ac31
children 6774820c8a2e
line wrap: on
line diff
--- a/tests/test-topic.t	Thu Aug 30 20:21:17 2018 +0800
+++ b/tests/test-topic.t	Thu Aug 30 21:05:17 2018 +0800
@@ -741,6 +741,9 @@
   >   hg log -T '{rev}: {topic}\n' -r "$1"
   > }
 
+  $ tlog 'topic(9)'
+  9: fran
+  $ tlog 'topic(8)'
   $ tlog 'topic(head())'
   9: fran
   $ tlog 'topic(:)'
@@ -751,6 +754,15 @@
   9: fran
   $ tlog 'topic(wdir())'
   9: fran
+  $ tlog 'topic(nonsense)'
+  abort: unknown revision 'nonsense'!
+  [255]
+
+Pattern matching in topic() revset
+  $ tlog 'topic("re:nonsense")'
+  $ tlog 'topic("literal:nonsense")'
+  abort: topic 'nonsense' does not exist!
+  [255]
 
 Deactivate the topic.
   $ hg topics