add warning to fix_migrations script for when the filename is different

This commit is contained in:
Leo Hemsted
2017-12-07 10:41:10 +00:00
parent 08b21bc0f4
commit da468681f2

View File

@@ -46,8 +46,11 @@ def reorder_revisions(revisions, old_base, new_base):
file_data = rev_file.read()
file_data = file_data.replace(head.revision, new_revision_id).replace(old_base, new_base)
new_filename = head.path.replace(head.revision, new_revision_id)
with open(head.path.replace(head.revision, new_revision_id), 'w') as rev_file:
assert head.path != new_filename, 'Old filename not same as revision id, please rename file before continuing'
with open(new_filename, 'w') as rev_file:
rev_file.write(file_data)
print("Removing {}".format(head.path))