def add_to_sitemap(sitemap, output_sitemap):
    '''
       Adds release note entry to sitemap.txt.
    '''
    sitemapfile = Path(sitemap)
    with sitemapfile.open(encoding='utf-8') as s_f:
        lines = s_f.readlines()
    relnotes = None
    to_version = None
    output = Path(output_sitemap)
    output.parent.mkdir(exist_ok=True, parents=True)
    with output.open('w', encoding='utf-8') as s_f:
        for line in lines:
            if relnotes is None:
                m = re.match(r'[\s]*Release-notes-for-([0-9]+)\.([0-9]+)\.([0-9]+)\.md', line)
                if m:
                    from_version = f'{m[1]}.{m[2]}.{m[3]}'
                    if from_version == '0.64.0':
                        to_version = '1.0.0'
                    else:
                        to_version = f'{m[1]}.{int(m[2]) + 1}.{m[3]}'
                    new_line = line.replace(from_version, to_version)
                    relnotes = new_line.strip()
                    s_f.write(new_line)
            s_f.write(line)

    if sitemapfile == output:
        subprocess.check_call(['git', 'add', output])

    return relnotes, to_version

       Adds release note entry to sitemap.txt.
    
docs/genrelnotes.py