INNER CODE UNIT · Python

renames_between

lissy93/portainer-templates · lib/changelog.py:103

def renames_between(old_tag, previous, new_tag):
    """Every rename step from old_tag to new_tag, one tag at a time. A release spans
    several tags, and a title renamed twice only matches up when each hop is paired."""
    chain = {}
    for tag in semver_tags():
        if not version(old_tag) < version(tag) <= version(new_tag):
            continue
        current = templates_at(tag)
        if current is None:
            continue
        added = sorted(current.keys() - previous.keys())
        removed = sorted(previous.keys() - current.keys())
        for pair in match_renames(previous, current, added, removed):
            chain[pair['from']] = pair['to']
        previous = current
    return chain

def final_title(chain, title):

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…