topic: make --clear + topicname invalid
The two flags are mutually exclusive.
--- a/hgext3rd/topic/__init__.py Mon Aug 28 17:15:08 2017 +0200
+++ b/hgext3rd/topic/__init__.py Mon Aug 28 17:35:44 2017 +0200
@@ -345,6 +345,8 @@
raise error.Abort(_("cannot use --current when setting a topic"))
if current and clear:
raise error.Abort(_("cannot use --current and --clear"))
+ if clear and topic:
+ raise error.Abort(_("cannot use --clear when setting a topic"))
if list:
if clear or rev:
--- a/tests/test-topic.t Mon Aug 28 17:15:08 2017 +0200
+++ b/tests/test-topic.t Mon Aug 28 17:35:44 2017 +0200
@@ -82,6 +82,9 @@
$ hg topics --current --clear
abort: cannot use --current and --clear
[255]
+ $ hg topics --clear somerandomtopic
+ abort: cannot use --clear when setting a topic
+ [255]
Test commit flag and help text