Merge "diff_branches: add RST support"
This commit is contained in:
commit
cc6f9331d7
|
@ -215,8 +215,9 @@ def get_env(project, new_branch, old_list, new_list):
|
||||||
for name in sorted(new_opts, _cmpopts):
|
for name in sorted(new_opts, _cmpopts):
|
||||||
opt = new_list[name][1]
|
opt = new_list[name][1]
|
||||||
name = format_option_name(name)
|
name = format_option_name(name)
|
||||||
cells = ("%(name)s = %(default)s" % {'name': name,
|
cells = (("%(name)s = %(default)s" %
|
||||||
'default': opt['default']},
|
{'name': name,
|
||||||
|
'default': opt['default']}).strip(),
|
||||||
"(%(type)s) %(help)s" % {'type': opt['type'],
|
"(%(type)s) %(help)s" % {'type': opt['type'],
|
||||||
'help': opt['help']})
|
'help': opt['help']})
|
||||||
env['new_opts'].append(cells)
|
env['new_opts'].append(cells)
|
||||||
|
@ -266,6 +267,13 @@ def main():
|
||||||
required=False,
|
required=False,
|
||||||
default='.',
|
default='.',
|
||||||
type=str,)
|
type=str,)
|
||||||
|
parser.add_argument('-f', '--format',
|
||||||
|
dest='format',
|
||||||
|
help='Output format (docbook or rst).',
|
||||||
|
required=False,
|
||||||
|
default='rst',
|
||||||
|
type=str,
|
||||||
|
choices=('docbook', 'rst'),)
|
||||||
parser.add_argument('-n', '--no-venv-update',
|
parser.add_argument('-n', '--no-venv-update',
|
||||||
dest='novenvupdate',
|
dest='novenvupdate',
|
||||||
help='Don\'t update the virtual envs.',
|
help='Don\'t update the virtual envs.',
|
||||||
|
@ -288,9 +296,10 @@ def main():
|
||||||
|
|
||||||
release = args.new_branch.replace('stable/', '')
|
release = args.new_branch.replace('stable/', '')
|
||||||
env = get_env(project, release, old_list, new_list)
|
env = get_env(project, release, old_list, new_list)
|
||||||
filename = ("%(project)s-conf-changes.xml" %
|
ext = 'rst' if args.format == 'rst' else 'xml'
|
||||||
{'project': project, 'release': release})
|
filename = ("%(project)s-conf-changes.%(ext)s" %
|
||||||
tmpl_file = 'templates/changes.docbook.j2'
|
{'project': project, 'ext': ext})
|
||||||
|
tmpl_file = 'templates/changes.%s.j2' % args.format
|
||||||
if not os.path.exists(args.target):
|
if not os.path.exists(args.target):
|
||||||
os.makedirs(args.target)
|
os.makedirs(args.target)
|
||||||
dest = os.path.join(args.target, filename)
|
dest = os.path.join(args.target, filename)
|
||||||
|
|
|
@ -0,0 +1,52 @@
|
||||||
|
New, updated, and deprecated options in {{ release }} for {{ codename }}
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{{ '~' * release|length }}~~~~~{{ '~' * codename|length }}
|
||||||
|
|
||||||
|
..
|
||||||
|
Warning: Do not edit this file. It is automatically generated and your
|
||||||
|
changes will be overwritten. The tool to do so lives in the
|
||||||
|
openstack-doc-tools repository.
|
||||||
|
|
||||||
|
{% if new_opts %}
|
||||||
|
.. list-table:: New options
|
||||||
|
:header-rows: 1
|
||||||
|
:class: config-ref-table
|
||||||
|
|
||||||
|
* - Option = default value
|
||||||
|
- (Type) Help string
|
||||||
|
{% for cells in new_opts %}
|
||||||
|
* - ``{{ cells[0] }}``
|
||||||
|
- ``{{ cells[1] }}``
|
||||||
|
{% endfor %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if new_defaults %}
|
||||||
|
.. list-table:: New default values
|
||||||
|
:header-rows: 1
|
||||||
|
:class: config-ref-table
|
||||||
|
|
||||||
|
* - Option
|
||||||
|
- Previous default value
|
||||||
|
- New default value
|
||||||
|
{% for cells in new_defaults %}
|
||||||
|
* - ``{{ cells[0] }}``
|
||||||
|
- ``{{ cells[1] }}``
|
||||||
|
- ``{{ cells[2]|default(' ', true) }}``
|
||||||
|
{% endfor %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if deprecated_opts %}
|
||||||
|
.. list-table:: Deprecated options
|
||||||
|
:header-rows: 1
|
||||||
|
:class: config-ref-table
|
||||||
|
|
||||||
|
* - Deprecated option
|
||||||
|
- New Option
|
||||||
|
{% for cells in new_opts %}
|
||||||
|
* - ``{{ cells[0] }}``
|
||||||
|
- ``{{ cells[1] }}``
|
||||||
|
{% endfor %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if not new_opts and not new_defaults and not deprecated_opts %}
|
||||||
|
There are no new, updated, and deprecated options in {{ release }} for {{ codename }}.
|
||||||
|
{% endif %}
|
Loading…
Reference in New Issue