This commit is contained in:
Paul Gauthier 2023-05-11 21:05:15 -07:00
parent 797372c69e
commit ae41782cb4

View file

@ -145,9 +145,21 @@ pattern = re.compile(
re.MULTILINE | re.DOTALL,
)
ORIGINAL = "<<<<<<< ORIGINAL"
DIVIDER = "======="
UPDATED = ">>>>>>> UPDATED"
separators = "|".join([ORIGINAL, DIVIDER, UPDATED])
split_re = re.compile(r"^(" + separators + r")\s*\n")
def find_original_update_blocks(content):
for match in pattern.finditer(content):
_, path, _, original, updated = match.groups()
path = path.strip()
yield path, original, updated
def test_find_original_update_blocks():
pass