Skip to content
Snippets Groups Projects
Commit bb3f86ee authored by Henrik tom Wörden's avatar Henrik tom Wörden Committed by Timm Fitschen
Browse files

ENH: treat case of removed files

parent e2320592
Branches
Tags
2 merge requests!41REL: update changelog, bump version of pom.xml, update DEPENDENCIES,!5ENH: treat case of removed files
......@@ -63,14 +63,20 @@ def rename(changes, chunksize=10):
cont = db.Container()
for _, (old, new) in chunk.iterrows():
cont.append(db.File(path=old))
try:
fi = db.File(path=old)
fi.retrieve()
cont.retrieve()
for fi, (_, (old, new)) in zip(cont, chunk.iterrows()):
if not fi.is_valid():
continue
assert fi.path == old
fi.path = new
cont.update()
cont.append(fi)
except Exception as e:
print(e)
if len(cont) > 0:
cont.update(unique=False)
i += 1
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment