Browse code

sync remote2remote: set target_uri on updated files too, bug 131

fixes bug https://github.com/s3tools/s3cmd/issues/131

We were not setting the target_uri field on files that had changed,
only on files that were to be newly uploaded. This was causing a
traceback when referencing the target_uri field when copying the
changed file.

Matt Domsch authored on 2013/03/07 00:08:48
Showing 1 changed files
... ...
@@ -656,10 +656,11 @@ def cmd_sync_remote2remote(args):
656 656
 
657 657
     print(u"Summary: %d source files to copy, %d files at destination to delete" % (src_count, dst_count))
658 658
 
659
-    if src_count > 0:
660
-        ### Populate 'remote_uri' only if we've got something to sync from src to dst
661
-        for key in src_list:
662
-            src_list[key]['target_uri'] = destination_base + key
659
+    ### Populate 'target_uri' only if we've got something to sync from src to dst
660
+    for key in src_list:
661
+        src_list[key]['target_uri'] = destination_base + key
662
+    for key in update_list:
663
+        update_list[key]['target_uri'] = destination_base + key
663 664
 
664 665
     if cfg.dry_run:
665 666
         for key in exclude_list: