# HG changeset patch # User Pulkit Goyal <7895pulkit@gmail.com> # Date 1506290456 -19800 # Node ID dbc896a7a1c3260c5e5c1ef47dd8f70ccd6ee74b # Parent 1e8ac0fcd6b7f22a2c53f3684aae7dddeb425804 topics: make sure user don't pass both the age option and a topic name diff -r 1e8ac0fcd6b7 -r dbc896a7a1c3 hgext3rd/topic/__init__.py --- a/hgext3rd/topic/__init__.py Mon Sep 25 03:29:45 2017 +0530 +++ b/hgext3rd/topic/__init__.py Mon Sep 25 03:30:56 2017 +0530 @@ -423,6 +423,7 @@ list = opts.get('list') rev = opts.get('rev') current = opts.get('current') + age = opts.get('age') if current and topic: raise error.Abort(_("cannot use --current when setting a topic")) @@ -430,6 +431,8 @@ raise error.Abort(_("cannot use --current and --clear")) if clear and topic: raise error.Abort(_("cannot use --clear when setting a topic")) + if age and topic: + raise error.Abort(_("cannot use --age while setting a topic")) touchedrevs = set() if rev: diff -r 1e8ac0fcd6b7 -r dbc896a7a1c3 tests/test-topic.t --- a/tests/test-topic.t Mon Sep 25 03:29:45 2017 +0530 +++ b/tests/test-topic.t Mon Sep 25 03:30:56 2017 +0530 @@ -999,4 +999,7 @@ topic1990 (1990-01-01 by foo) * topic1970 (1970-01-01 by test) + $ hg topics --age random + abort: cannot use --age while setting a topic + [255] $ cd ..