Patchwork [5,of,6,topic-experiment] topics: return a parse error if stack() revset is passed with argument

login
register
mail settings
Submitter Pulkit Goyal
Date June 28, 2017, 9:08 p.m.
Message ID <25bdd52e3c2a7c0acd92.1498684107@workspace>
Download mbox | patch
Permalink /patch/21811/
State Accepted
Headers show

Comments

Pulkit Goyal - June 28, 2017, 9:08 p.m.
# HG changeset patch
# User Pulkit Goyal <7895pulkit@gmail.com>
# Date 1498681706 -19800
#      Thu Jun 29 01:58:26 2017 +0530
# Node ID 25bdd52e3c2a7c0acd925b241fb14b04ac3ceacf
# Parent  d1083a0b28ba3b13e41047c0a127cc8d585387af
# EXP-Topic resolvetopic
topics: return a parse error if stack() revset is passed with argument

Patch

diff --git a/hgext3rd/topic/revset.py b/hgext3rd/topic/revset.py
--- 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'))
diff --git a/tests/test-topic-stack.t b/tests/test-topic-stack.t
--- 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
 -------------------------------------