diff --git a/hgext/releasenotes.py b/hgext/releasenotes.py --- a/hgext/releasenotes.py +++ b/hgext/releasenotes.py @@ -552,6 +552,12 @@ release note after it has been added to the release notes file. """ sections = releasenotessections(ui, repo) + + if opts.get('list') and opts.get('rev'): + raise error.Abort(_('cannot use both \'--rev\' and \'--list\'')) + if opts.get('list') and opts.get('check'): + raise error.Abort(_('cannot use both \'--list\' and \'--check\'')) + if opts.get('list'): return _getadmonitionlist(ui, sections) diff --git a/tests/test-releasenotes-formatting.t b/tests/test-releasenotes-formatting.t --- a/tests/test-releasenotes-formatting.t +++ b/tests/test-releasenotes-formatting.t @@ -420,3 +420,17 @@ fix: Bug Fixes perf: Performance Improvements api: API Changes + + $ cd .. + +Raise error on simultaneous usage of flags + + $ hg init relnotes-raise-error + $ cd relnotes-raise-error + $ hg releasenotes -r . -l + abort: cannot use both '--rev' and '--list' + [255] + + $ hg releasenotes -l -c + abort: cannot use both '--list' and '--check' + [255]