Index: tools/backup/hot-backup.py.in
===================================================================
--- tools/backup/hot-backup.py.in	(Revision 1929569)
+++ tools/backup/hot-backup.py.in	(Arbeitskopie)
@@ -55,10 +55,35 @@
 archive_map = {
   'gz'  : ".tar.gz",
   'bz2' : ".tar.bz2",
+  'xz' : ".tar.xz",
+  'zst' : ".tar.zst",
   'zip' : ".zip",
   'zip64' : ".zip"
   }
 
+try:
+  import lzma
+except ImportError:
+  del archive_map['xz']
+else:
+  del lzma
+
+try:
+  from compression import zstd
+except ImportError:
+  del archive_map['zst']
+else:
+  del zstd
+
+archive_desc = {
+  'bz2': 'Creates a bzip2 compressed tar file.',
+  'gz': 'Creates a gzip compressed tar file.',
+  'xz': 'Creates a xz compressed tar file.',
+  'zst': 'Creates a Zstandard compressed tar file.',
+  'zip': 'Creates a compressed zip file.',
+  'zip64': 'Creates a zip64 file (can be > 2GB).',
+}
+
 # Chmod recursively on a whole subtree
 def chmod_tree(path, mode, mask):
   for dirpath, dirs, files in os.walk(path):
@@ -103,19 +128,22 @@
 
 Options:
   --archive-type=FMT Create an archive of the backup. FMT can be one of:
-                       bz2  : Creates a bzip2 compressed tar file.
-                       gz   : Creates a gzip compressed tar file.
-                       zip  : Creates a compressed zip file.
-                       zip64: Creates a zip64 file (can be > 2GB).
+""" % scriptname)
+  for fmt in sorted(archive_map):
+    out.write('                       %-5s: %s\n' % (fmt, archive_desc[fmt]))
+  out.write("""\
+  --no-increment     Do not create an incremented backup version if the
+                     revision already exists.
   --num-backups=N    Number of prior backups to keep around (0 to keep all).
   --verify           Verify the backup.
   --help      -h     Print this help message and exit.
 
-""" % (scriptname,))
+""")
 
 
 try:
   opts, args = getopt.gnu_getopt(sys.argv[1:], "h?", ["archive-type=",
+                                                      "no-increment",
                                                       "num-backups=",
                                                       "verify",
                                                       "help"])
@@ -126,11 +154,14 @@
   sys.exit(2)
 
 archive_type = None
+no_increment = False
 verify_copy = False
 
 for o, a in opts:
   if o == "--archive-type":
     archive_type = a
+  elif o == "--no-increment":
+    no_increment = True
   elif o == "--num-backups":
     num_backups = int(a)
   elif o == "--verify":
@@ -139,7 +170,7 @@
     usage()
     sys.exit()
 
-if archive_type not in (None, 'bz2', 'gz', 'zip', 'zip64'):
+if archive_type and archive_type not in archive_map:
   sys.stderr.write("ERROR: Bad --archive-type\n")
   usage(sys.stderr)
   sys.exit(2)
@@ -265,6 +296,11 @@
 directory_list = os.listdir(backup_dir)
 young_list = [x for x in directory_list if regexp.search(x)]
 if young_list:
+  if no_increment:
+    print("Backup of revision %s already exists, not doing incremented "
+          "backup." % youngest)
+    sys.exit(0)
+
   young_list.sort(key = functools.cmp_to_key(comparator))
   increment = regexp.search(young_list.pop()).groupdict()['increment']
   if increment:
@@ -303,7 +339,7 @@
   err_msg = ""
 
   print("Archiving backup to '" + archive_path + "'...")
-  if archive_type == 'gz' or archive_type == 'bz2':
+  if archive_map.get(archive_type, '').startswith('.tar.'):
     try:
       import tarfile
       tar = tarfile.open(archive_path, 'w:' + archive_type)
