continue
revs.append(line)
+ mr_re = re.compile("<([0-9a-f]{40})")
+
for rev in revs:
rv, out, err = mrlib.run(["git", "show", "--format=%b", rev])
lines = out.split("\n")
if not lines[1].lower().startswith("in-reply-to: "):
sys.exit("Expecting 2nd line '{}' to be 'In-Reply-To' header.".format(lines[1]))
+ match = mr_re.match(lines[1].split()[1])
+ if not match:
+ sys.exit("Cannot find MR in '{}'.".format(lines[1]))
+
+ if match[1] != ref_mr:
+ sys.exit("MR '{}' in In-Reply-To header does not match '{}'.".format(match[1], ref_mr))
+
if lines[2]:
sys.exit("Expecting 3rd line '{}' to be empty.".format(lines[2]))