From 0ab3653f360e530402d17bc1c78fbeea4f2cd9fd Mon Sep 17 00:00:00 2001 From: Roy Nieterau Date: Mon, 24 Jun 2024 10:45:33 +0200 Subject: [PATCH] Report whether it's hardlinking or copying; also report whether hardlinking failed. --- .../plugins/publish/integrate_hero_version.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/client/ayon_core/plugins/publish/integrate_hero_version.py b/client/ayon_core/plugins/publish/integrate_hero_version.py index 95b9f418f9..4fb8b886a9 100644 --- a/client/ayon_core/plugins/publish/integrate_hero_version.py +++ b/client/ayon_core/plugins/publish/integrate_hero_version.py @@ -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):