Report whether it's hardlinking or copying; also report whether hardlinking failed.

This commit is contained in:
Roy Nieterau 2024-06-24 10:45:33 +02:00
parent 67ed43a6b2
commit 0ab3653f36

View file

@ -619,12 +619,11 @@ class IntegrateHeroVersion(
self.log.debug("Folder already exists: \"{}\"".format(dirname))
self.log.debug("Copying file \"{}\" to \"{}\"".format(
src_path, dst_path
))
if self.use_hardlinks:
# First try hardlink and copy if paths are cross drive
self.log.debug("Hardlinking file \"{}\" to \"{}\"".format(
src_path, dst_path
))
try:
create_hard_link(src_path, dst_path)
# Return when successful
@ -639,6 +638,13 @@ class IntegrateHeroVersion(
if exc.errno not in [errno.EXDEV, errno.EINVAL]:
raise
self.log.debug(
"Hardlinking failed, falling back to regular copy...")
self.log.debug("Copying file \"{}\" to \"{}\"".format(
src_path, dst_path
))
shutil.copy(src_path, dst_path)
def version_from_representations(self, project_name, repres):