##// END OF EJS Templates
archives: if implicit ref name was used to obtain archive, redirect to explicit commit sha so we can...
milka -
r4648:e8391c99 default
parent child
Show More
@@ -373,6 +373,11 class RepoFilesView(RepoAppView):
373 except EmptyRepositoryError:
373 except EmptyRepositoryError:
374 return Response(_('Empty repository'))
374 return Response(_('Empty repository'))
375
375
376 # we used a ref, or a shorter version, lets redirect client ot use explicit hash
377 if commit_id != commit.raw_id:
378 fname='{}{}'.format(commit.raw_id, ext)
379 raise HTTPFound(self.request.current_route_path(fname=fname))
380
376 try:
381 try:
377 at_path = commit.get_node(at_path).path or default_at_path
382 at_path = commit.get_node(at_path).path or default_at_path
378 except Exception:
383 except Exception:
@@ -405,9 +410,10 class RepoFilesView(RepoAppView):
405 cached_archive_path = None
410 cached_archive_path = None
406
411
407 if archive_cache_enabled:
412 if archive_cache_enabled:
408 # check if we it's ok to write
413 # check if we it's ok to write, and re-create the archive cache
409 if not os.path.isdir(CONFIG['archive_cache_dir']):
414 if not os.path.isdir(CONFIG['archive_cache_dir']):
410 os.makedirs(CONFIG['archive_cache_dir'])
415 os.makedirs(CONFIG['archive_cache_dir'])
416
411 cached_archive_path = os.path.join(
417 cached_archive_path = os.path.join(
412 CONFIG['archive_cache_dir'], archive_name)
418 CONFIG['archive_cache_dir'], archive_name)
413 if os.path.isfile(cached_archive_path):
419 if os.path.isfile(cached_archive_path):
General Comments 0
You need to be logged in to leave comments. Login now