merge-approved-backports.py [plain text]
"""\
Automatic backport merging script.
This script is run from cron. It may also be run interactively, however, it
has no interactive features.
Run this script from the root of a stable branch's working copy (e.g.,
a working copy of /branches/1.9.x). This script will iterate the STATUS file
and commit every nomination in the section "Approved changes".
"""
import sys
assert sys.version_info[0] == 3, "This script targets Python 3"
import backport.status
import backport.merger
if sys.argv[1:]:
print(__doc__)
sys.exit(0)
backport.merger.no_local_mods('./STATUS')
while True:
backport.merger.run_svn_quiet(['update'])
sf = backport.status.StatusFile(open('./STATUS', encoding="UTF-8"))
for entry_para in sf.entries_paras():
if entry_para.approved():
entry = entry_para.entry()
backport.merger.merge(entry, commit=True)
break else:
break