@@ -200,6 +200,11 @@ urlpatterns = [
content_type='text/plain; charset=utf-8',
template_name='layerindex/branchcompare_rst.txt'),
name='branch_comparison_rst'),
+ re_path(r'^branch_comparison_csv/$',
+ BranchCompareView.as_view(
+ content_type='text/csv; charset=utf-8',
+ template_name='layerindex/branchcompare_csv.txt'),
+ name='branch_comparison_csv'),
re_path(r'^recipe_deps/$',
RecipeDependenciesView.as_view(
template_name='layerindex/recipedeps.html'),
@@ -152,6 +152,7 @@
<span class="pull-right">
<a class="btn btn-default" href="{% url 'branch_comparison_plain' %}?{{ request.GET.urlencode }}"><i class="glyphicon glyphicon-file"></i> Plain text</a>
<a class="btn btn-default" href="{% url 'branch_comparison_rst' %}?{{ request.GET.urlencode }}"><i class="glyphicon glyphicon-file"></i> rST</a>
+ <a class="btn btn-default" href="{% url 'branch_comparison_csv' %}?{{ request.GET.urlencode }}"><i class="glyphicon glyphicon-file"></i> CSV text</a>
</span>
new file mode 100644
@@ -0,0 +1,11 @@
+{# Header #}
+recipe.pn,recipe.pv.{{from_branch}},recipe.pv.{{to_branch}}
+{# Added #}
+{% for recipe in added %}{{ recipe.pn }},,{% for rv in recipe.to_versions %}{{ rv.pv }}{% if not forloop.last %}{% endif %}{% endfor %}
+{% endfor %}
+{# Changed #}
+{% for recipe in changed %}{% with pv_changed=recipe.pv_changed %}{{ recipe.pn }},{% for rv in recipe.from_versions %}{{ rv.pv }}{% if rv.srcrev and not pv_changed %},({{ rv.srcrev|truncatechars:13 }}){% endif %}{% if not forloop.last %}, {% endif %}{% endfor %} -> {% for rv in recipe.to_versions %}{{ rv.pv }}{% if rv.srcrev and not pv_changed %} ({{ rv.srcrev|truncatechars:13 }}){% endif %}{% if not forloop.last %}, {% endif %}{% endfor %}
+{% endwith %}{% endfor %}
+{# Removed #}
+{% for recipe in removed %}{{ recipe.pn }},,
+{% endfor %}
Add a new template, URL and button for CSV text file output. This makes it easier to consume the BranchComparison for automation or other usage, such as in a spreadsheet. Signed-off-by: Tim Orling <tim.orling@konsulko.com> --- layerindex/urls.py | 5 +++++ templates/layerindex/branchcompare.html | 1 + templates/layerindex/branchcompare_csv.txt | 11 +++++++++++ 3 files changed, 17 insertions(+) create mode 100644 templates/layerindex/branchcompare_csv.txt