topic: make revset argument messages be similar to such messages in core stable
authorAnton Shestakov <av6@dwimlabs.net>
Wed, 05 Dec 2018 23:15:29 +0800
branchstable
changeset 4290 09337aae08d4
parent 4289 cabe3b5d5139
child 4296 b8cb1bdbc8d7
child 4297 699e25687cc5
topic: make revset argument messages be similar to such messages in core
CHANGELOG
hgext3rd/topic/revset.py
tests/test-topic-stack.t
--- a/CHANGELOG	Wed Dec 05 23:13:26 2018 +0800
+++ b/CHANGELOG	Wed Dec 05 23:15:29 2018 +0800
@@ -5,6 +5,7 @@
 -------------------
 
   * test: avoid leaking `hg serve` process
+  * topic: fix error message for the `ngtip` revset
 
 8.3.2 -- 2017-11-27
 -------------------
--- a/hgext3rd/topic/revset.py	Wed Dec 05 23:13:26 2018 +0800
+++ b/hgext3rd/topic/revset.py	Wed Dec 05 23:15:29 2018 +0800
@@ -82,9 +82,9 @@
 
     Name is horrible so that people change it.
     """
-    args = revset.getargs(x, 1, 1, 'topic takes one')
+    args = revset.getargs(x, 1, 1, 'ngtip takes one argument')
     # match a specific topic
-    branch = revset.getstring(args[0], 'ngtip() argument must be a string')
+    branch = revset.getstring(args[0], 'ngtip requires a string')
     if branch == '.':
         branch = repo['.'].branch()
     return subset & revset.baseset(destination.ngtip(repo, branch))
@@ -95,8 +95,9 @@
 
     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'
+    run).
+    """
+    err = 'stack takes no arguments, it works on current topic'
     revset.getargs(x, 0, 0, err)
     topic = None
     branch = None
--- a/tests/test-topic-stack.t	Wed Dec 05 23:13:26 2018 +0800
+++ b/tests/test-topic-stack.t	Wed Dec 05 23:15:29 2018 +0800
@@ -322,11 +322,11 @@
   5 default {foo} draft c_f
 
   $ hg log -r 'stack(foo)'
-  hg: parse error: stack() takes no argument, it works on current topic
+  hg: parse error: stack takes no arguments, it works on current topic
   [255]
 
   $ hg log -r 'stack(foobar)'
-  hg: parse error: stack() takes no argument, it works on current topic
+  hg: parse error: stack takes no arguments, it works on current topic
   [255]
 
 Case with multiple heads on the topic