##// END OF EJS Templates
vcsserver: fixed archival calls
super-admin -
r1072:6a99d09b python3
parent child Browse files
Show More
@@ -24,7 +24,7 b' from vcsserver.lib.rc_cache import regio'
24
24
25 from vcsserver import exceptions
25 from vcsserver import exceptions
26 from vcsserver.exceptions import NoContentException
26 from vcsserver.exceptions import NoContentException
27 from vcsserver.hgcompat import (archival)
27 from vcsserver.hgcompat import archival
28 from vcsserver.str_utils import safe_bytes
28 from vcsserver.str_utils import safe_bytes
29
29
30 log = logging.getLogger(__name__)
30 log = logging.getLogger(__name__)
@@ -101,16 +101,17 b' def archive_repo(walker, archive_dest_pa'
101 yield ArchiveNode(fn, mode, is_link, ctx[fn].data)
101 yield ArchiveNode(fn, mode, is_link, ctx[fn].data)
102 """
102 """
103 extra_metadata = extra_metadata or {}
103 extra_metadata = extra_metadata or {}
104 archive_dest_path = safe_bytes(archive_dest_path)
104
105
105 if kind == "tgz":
106 if kind == "tgz":
106 archiver = archival.tarit(archive_dest_path, mtime, "gz")
107 archiver = archival.tarit(archive_dest_path, mtime, b"gz")
107 elif kind == "tbz2":
108 elif kind == "tbz2":
108 archiver = archival.tarit(archive_dest_path, mtime, "bz2")
109 archiver = archival.tarit(archive_dest_path, mtime, b"bz2")
109 elif kind == 'zip':
110 elif kind == 'zip':
110 archiver = archival.zipit(archive_dest_path, mtime)
111 archiver = archival.zipit(archive_dest_path, mtime)
111 else:
112 else:
112 raise exceptions.ArchiveException()(
113 raise exceptions.ArchiveException()(
113 'Remote does not support: "%s" archive type.' % kind)
114 f'Remote does not support: "{kind}" archive type.')
114
115
115 for f in walker(commit_id, archive_at_path):
116 for f in walker(commit_id, archive_at_path):
116 f_path = os.path.join(safe_bytes(archive_dir_name), f.path.lstrip(b'/'))
117 f_path = os.path.join(safe_bytes(archive_dir_name), f.path.lstrip(b'/'))
General Comments 0
You need to be logged in to leave comments. Login now