# HG changeset patch # User Pierre-Yves David # Date 1503934544 -7200 # Node ID e46b68547017cc30545ab8ce5cdb9c4302b77f60 # Parent 5c0b6af37b2100ba7157cf2f7678c44426fafe04 topic: make --clear + topicname invalid The two flags are mutually exclusive. diff -r 5c0b6af37b21 -r e46b68547017 hgext3rd/topic/__init__.py --- 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: diff -r 5c0b6af37b21 -r e46b68547017 tests/test-topic.t --- 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