changeset 2777:aa4db71a6224

topics: return a parse error if stack() revset is passed with argument
author Pulkit Goyal <7895pulkit@gmail.com>
date Thu, 29 Jun 2017 01:58:26 +0530
parents d5eb5269128a
children a6e3c2fcb1d7
files hgext3rd/topic/revset.py tests/test-topic-stack.t
diffstat 2 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/hgext3rd/topic/revset.py
+++ b/hgext3rd/topic/revset.py
@@ -71,6 +71,8 @@
     This is roughly equivalent to 'topic(.) - obsolete' with a sorting moving
     unstable changeset after there future parent (as if evolve where already
     run)."""
+    err = 'stack() takes no argument, it works on current topic'
+    revset.getargs(x, 0, 0, err)
     topic = repo.currenttopic
     if not topic:
         raise error.Abort(_('no active topic to list'))
--- a/tests/test-topic-stack.t
+++ b/tests/test-topic-stack.t
@@ -216,6 +216,14 @@
   4 default {foo} draft c_e
   5 default {foo} draft c_f
 
+  $ hg log -r 'stack(foo)'
+  hg: parse error: stack() takes no argument, it works on current topic
+  [255]
+
+  $ hg log -r 'stack(foobar)'
+  hg: parse error: stack() takes no argument, it works on current topic
+  [255]
+
 Case with multiple heads on the topic
 -------------------------------------