##// END OF EJS Templates
files: archive, ensure we use same hash structure for old version of archives with full tree
marcink -
r3726:206336e2 new-ui
parent child Browse files
Show More
@@ -288,10 +288,10 b' class RepoFilesView(RepoAppView):'
288 from rhodecode import CONFIG
288 from rhodecode import CONFIG
289 _ = self.request.translate
289 _ = self.request.translate
290 self.load_default_context()
290 self.load_default_context()
291
291 default_at_path = '/'
292 fname = self.request.matchdict['fname']
292 fname = self.request.matchdict['fname']
293 subrepos = self.request.GET.get('subrepos') == 'true'
293 subrepos = self.request.GET.get('subrepos') == 'true'
294 at_path = self.request.GET.get('at_path') or '/'
294 at_path = self.request.GET.get('at_path') or default_at_path
295
295
296 if not self.db_repo.enable_downloads:
296 if not self.db_repo.enable_downloads:
297 return Response(_('Downloads disabled'))
297 return Response(_('Downloads disabled'))
@@ -318,12 +318,24 b' class RepoFilesView(RepoAppView):'
318
318
319 path_sha = sha1(at_path)[:8]
319 path_sha = sha1(at_path)[:8]
320
320
321 archive_name = '{}-{}{}-{}{}'.format(
321 # original backward compat name of archive
322 safe_str(self.db_repo_name.replace('/', '_')),
322 clean_name = safe_str(self.db_repo_name.replace('/', '_'))
323 '-sub' if subrepos else '',
323 short_sha = safe_str(commit.short_id)
324 safe_str(commit.short_id),
324
325 path_sha,
325 if at_path == default_at_path:
326 ext)
326 archive_name = '{}-{}{}{}'.format(
327 clean_name,
328 '-sub' if subrepos else '',
329 short_sha,
330 ext)
331 # custom path and new name
332 else:
333 archive_name = '{}-{}{}-{}{}'.format(
334 clean_name,
335 '-sub' if subrepos else '',
336 short_sha,
337 path_sha,
338 ext)
327
339
328 use_cached_archive = False
340 use_cached_archive = False
329 archive_cache_enabled = CONFIG.get(
341 archive_cache_enabled = CONFIG.get(
General Comments 0
You need to be logged in to leave comments. Login now