Permalink
Browse files

fix up failed merge of --delete-after-fetch

  • Loading branch information...
1 parent 4021b68 commit 8928efea6ddecd438e0c84aed47d0141bd6fa1ae @mdomsch committed Dec 6, 2012
Showing with 3 additions and 23 deletions.
  1. +3 −23 s3cmd
View
26 s3cmd
@@ -838,33 +838,16 @@ def cmd_sync_remote2local(args):
except S3DownloadError, e:
error(u"%s: download failed too many times. Skipping that file." % file)
continue
-<<<<<<< HEAD
speed_fmt = formatSize(response["speed"], human_readable = True, floating_point = True)
if not Config().progress_meter:
output(u"File '%s' stored as '%s' (%d bytes in %0.1f seconds, %0.2f %sB/s) %s" %
(uri, unicodise(dst_file), response["size"], response["elapsed"], speed_fmt[0], speed_fmt[1],
seq_label))
total_size += response["size"]
+ if Config().delete_after_fetch:
+ s3.object_delete(uri)
+ output(u"File '%s' removed after syncing" % (uri))
return seq, total_size
-=======
- # We have to keep repeating this call because
- # Python 2.4 doesn't support try/except/finally
- # construction :-(
- try: dst_stream.close()
- except: pass
- except S3DownloadError, e:
- error(u"%s: download failed too many times. Skipping that file." % file)
- continue
- speed_fmt = formatSize(response["speed"], human_readable = True, floating_point = True)
- if not Config().progress_meter:
- output(u"File '%s' stored as '%s' (%d bytes in %0.1f seconds, %0.2f %sB/s) %s" %
- (uri, unicodise(dst_file), response["size"], response["elapsed"], speed_fmt[0], speed_fmt[1],
- seq_label))
- if Config().delete_after_fetch:
- s3.object_delete(uri)
- output(u"File '%s' removed after syncing" % (uri))
- total_size += response["size"]
->>>>>>> nicjansma/master
total_size = 0
total_elapsed = 0.0
@@ -1705,13 +1688,10 @@ def main():
optparser.add_option( "--delete-removed", dest="delete_removed", action="store_true", help="Delete remote objects with no corresponding local file [sync]")
optparser.add_option( "--no-delete-removed", dest="delete_removed", action="store_false", help="Don't delete remote objects.")
-<<<<<<< HEAD
optparser.add_option( "--delete-after", dest="delete_after", action="store_true", help="Perform deletes after new uploads [sync]")
optparser.add_option( "--delay-updates", dest="delay_updates", action="store_true", help="Put all updated files into place at end [sync]")
optparser.add_option( "--add-destination", dest="additional_destinations", action="append", help="Additional destination for parallel uploads, in addition to last arg. May be repeated.")
-=======
optparser.add_option( "--delete-after-fetch", dest="delete_after_fetch", action="store_true", help="Delete remote objects after fetching to local file (only for [get] and [sync] commands).")
->>>>>>> nicjansma/master
optparser.add_option("-p", "--preserve", dest="preserve_attrs", action="store_true", help="Preserve filesystem attributes (mode, ownership, timestamps). Default for [sync] command.")
optparser.add_option( "--no-preserve", dest="preserve_attrs", action="store_false", help="Don't store FS attributes")
optparser.add_option( "--exclude", dest="exclude", action="append", metavar="GLOB", help="Filenames and paths matching GLOB will be excluded from sync")

0 comments on commit 8928efe

Please sign in to comment.