Skip to content

Commit 5eac4a8

Browse files
committed
Additional fix for diff regression: make the RFC part of the version list.
- Legacy-Id: 5881
1 parent 6a2ae39 commit 5eac4a8

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

ietf/doc/views_doc.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -455,20 +455,25 @@ def document_main(request, name, rev=None):
455455
raise Http404
456456

457457

458-
@debug.trace
459458
def document_history(request, name):
460459
doc = get_object_or_404(Document, docalias__name=name)
461460
top = render_document_top(request, doc, "history", name)
462461

463462
# pick up revisions from events
464463
diff_revisions = []
465-
466464
diffable = [ name.startswith(prefix) for prefix in ["rfc", "draft", "charter", "conflict-review", "status-change", ]]
467465
if diffable:
468466
diff_documents = [ doc ]
469467
diff_documents.extend(Document.objects.filter(docalias__relateddocument__source=doc, docalias__relateddocument__relationship="replaces"))
470-
468+
debug.pprint('diff_documents')
471469
seen = set()
470+
471+
if doc.get_state_slug() == "rfc":
472+
e = doc.latest_event(type="published_rfc")
473+
aliases = doc.docalias_set.filter(name__startswith="rfc")
474+
if aliases:
475+
name = aliases[0].name
476+
diff_revisions.append((name, "", e.time if e else doc.time, name))
472477
for e in NewRevisionDocEvent.objects.filter(type="new_revision", doc__in=diff_documents).select_related('doc').order_by("-time", "-id"):
473478
if (e.doc.name, e.rev) in seen:
474479
continue
@@ -484,7 +489,7 @@ def document_history(request, name):
484489
elif name.startswith("status-change"):
485490
h = find_history_active_at(e.doc, e.time)
486491
url = settings.STATUS_CHANGE_TXT_URL + ("%s-%s.txt" % ((h or doc).canonical_name(), e.rev))
487-
elif name.startswith("draft"):
492+
elif name.startswith("draft") or name.startswith("rfc"):
488493
# rfcdiff tool has special support for IDs
489494
url = e.doc.name + "-" + e.rev
490495

0 commit comments

Comments
 (0)