Add initial support for changelog links for upgrade package diffs
definitely still just playing around so far...
This commit is contained in:
parent
4360d263e4
commit
55f96c4730
3 changed files with 25 additions and 2 deletions
|
@ -204,6 +204,7 @@ class UpgradeView(MasterView):
|
|||
after = self.parse_requirements(upgrade, 'after')
|
||||
diff = self.make_diff(before, after,
|
||||
columns=["package", "old version", "new version"],
|
||||
render_field=self.render_diff_field,
|
||||
render_value=self.render_diff_value,
|
||||
)
|
||||
showing = HTML.tag('div',
|
||||
|
@ -216,6 +217,21 @@ class UpgradeView(MasterView):
|
|||
except:
|
||||
return "(not available for this upgrade)"
|
||||
|
||||
def render_diff_field(self, field, diff):
|
||||
if field == 'rattail':
|
||||
# TODO: use changelog from latest docs *unless* running from src
|
||||
# url = 'https://rattailproject.org/buildbot/docs/rattail/changelog.html'
|
||||
url = 'https://rattailproject.org/trac/log/rattail/?rev={}&stop_rev={}&limit=100'.format(
|
||||
diff.new_value(field), diff.old_value(field))
|
||||
return tags.link_to(field, url, target='_blank')
|
||||
if field == 'Tailbone':
|
||||
# TODO: use changelog from latest docs *unless* running from src
|
||||
# url = 'https://rattailproject.org/buildbot/docs/tailbone/changelog.html'
|
||||
url = 'https://rattailproject.org/trac/log/tailbone/?rev={}&stop_rev={}&limit=100'.format(
|
||||
diff.new_value(field), diff.old_value(field))
|
||||
return tags.link_to(field, url, target='_blank')
|
||||
return field
|
||||
|
||||
def render_diff_value(self, field, value):
|
||||
if value.startswith("u'") and value.endswith("'"):
|
||||
return value[2:1]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue