##// 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 288 from rhodecode import CONFIG
289 289 _ = self.request.translate
290 290 self.load_default_context()
291
291 default_at_path = '/'
292 292 fname = self.request.matchdict['fname']
293 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 296 if not self.db_repo.enable_downloads:
297 297 return Response(_('Downloads disabled'))
@@ -318,10 +318,22 b' class RepoFilesView(RepoAppView):'
318 318
319 319 path_sha = sha1(at_path)[:8]
320 320
321 # original backward compat name of archive
322 clean_name = safe_str(self.db_repo_name.replace('/', '_'))
323 short_sha = safe_str(commit.short_id)
324
325 if at_path == default_at_path:
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:
321 333 archive_name = '{}-{}{}-{}{}'.format(
322 safe_str(self.db_repo_name.replace('/', '_')),
334 clean_name,
323 335 '-sub' if subrepos else '',
324 safe_str(commit.short_id),
336 short_sha,
325 337 path_sha,
326 338 ext)
327 339
General Comments 0
You need to be logged in to leave comments. Login now