hgext/releasenotes.py
changeset 50906 9ed17632ad83
parent 49933 a47e86e8fd51
equal deleted inserted replaced
50905:75b90a8eb168 50906:9ed17632ad83
    22     cmdutil,
    22     cmdutil,
    23     config,
    23     config,
    24     error,
    24     error,
    25     logcmdutil,
    25     logcmdutil,
    26     minirst,
    26     minirst,
    27     pycompat,
       
    28     registrar,
    27     registrar,
    29     util,
    28     util,
    30 )
    29 )
    31 from mercurial.utils import (
    30 from mercurial.utils import (
    32     procutil,
    31     procutil,
   663     The -l/--list option, presents the user with a list of existing available
   662     The -l/--list option, presents the user with a list of existing available
   664     admonitions along with their title. This also includes the custom
   663     admonitions along with their title. This also includes the custom
   665     admonitions (if any).
   664     admonitions (if any).
   666     """
   665     """
   667 
   666 
   668     opts = pycompat.byteskwargs(opts)
       
   669     sections = releasenotessections(ui, repo)
   667     sections = releasenotessections(ui, repo)
   670 
   668 
   671     cmdutil.check_incompatible_arguments(opts, b'list', [b'rev', b'check'])
   669     cmdutil.check_incompatible_arguments(opts, 'list', ['rev', 'check'])
   672 
   670 
   673     if opts.get(b'list'):
   671     if opts.get('list'):
   674         return _getadmonitionlist(ui, sections)
   672         return _getadmonitionlist(ui, sections)
   675 
   673 
   676     rev = opts.get(b'rev')
   674     rev = opts.get('rev')
   677     revs = logcmdutil.revrange(repo, [rev or b'not public()'])
   675     revs = logcmdutil.revrange(repo, [rev or b'not public()'])
   678     if opts.get(b'check'):
   676     if opts.get('check'):
   679         return checkadmonitions(ui, repo, sections.names(), revs)
   677         return checkadmonitions(ui, repo, sections.names(), revs)
   680 
   678 
   681     incoming = parsenotesfromrevisions(repo, sections.names(), revs)
   679     incoming = parsenotesfromrevisions(repo, sections.names(), revs)
   682 
   680 
   683     if file_ is None:
   681     if file_ is None: