jenkins-bot has submitted this change and it was merged.
Change subject: [FIX] imagetransfer: Compare image repositories ......................................................................
[FIX] imagetransfer: Compare image repositories
It checks if the file is already shared and skips transferring them. But that is assuming the target site is using the same image repository.
Bug: T87082 Change-Id: I3da1f7b5a8738b649f0eec2da330518f9efb3b35 --- M scripts/imagetransfer.py 1 file changed, 5 insertions(+), 2 deletions(-)
Approvals: John Vandenberg: Looks good to me, approved jenkins-bot: Verified
diff --git a/scripts/imagetransfer.py b/scripts/imagetransfer.py index 670c809..b207cda 100755 --- a/scripts/imagetransfer.py +++ b/scripts/imagetransfer.py @@ -294,9 +294,12 @@ break todo = int(todo) if todo in range(len(imagelist)): - if imagelist[todo].fileIsShared(): + if (imagelist[todo].fileIsShared() and + imagelist[todo].site.image_repository() == + self.targetSite.image_repository()): pywikibot.output( - u'The image is already on Wikimedia Commons.') + 'The image is already shared on {0}.'.format( + self.targetSite.image_repository())) else: self.transferImage(imagelist[todo]) # remove the selected image from the list
pywikibot-commits@lists.wikimedia.org