##// END OF EJS Templates
files: Include the repository groups when computing files url, fixes #4104.
Martin Bornhold -
r458:d58b1643 default
parent child Browse files
Show More
@@ -236,7 +236,7 b' class SummaryController(BaseRepoControll'
236 (_("Tag"), repo.tags, 'tag'),
236 (_("Tag"), repo.tags, 'tag'),
237 (_("Bookmark"), repo.bookmarks, 'book'),
237 (_("Bookmark"), repo.bookmarks, 'book'),
238 ]
238 ]
239 res = self._create_reference_data(repo, refs_to_create)
239 res = self._create_reference_data(repo, repo_name, refs_to_create)
240 data = {
240 data = {
241 'more': False,
241 'more': False,
242 'results': res
242 'results': res
@@ -253,14 +253,14 b' class SummaryController(BaseRepoControll'
253 # TODO: enable when vcs can handle bookmarks filters
253 # TODO: enable when vcs can handle bookmarks filters
254 # (_("Bookmarks"), repo.bookmarks, "book"),
254 # (_("Bookmarks"), repo.bookmarks, "book"),
255 ]
255 ]
256 res = self._create_reference_data(repo, refs_to_create)
256 res = self._create_reference_data(repo, repo_name, refs_to_create)
257 data = {
257 data = {
258 'more': False,
258 'more': False,
259 'results': res
259 'results': res
260 }
260 }
261 return data
261 return data
262
262
263 def _create_reference_data(self, repo, refs_to_create):
263 def _create_reference_data(self, repo, full_repo_name, refs_to_create):
264 format_ref_id = utils.get_format_ref_id(repo)
264 format_ref_id = utils.get_format_ref_id(repo)
265
265
266 result = []
266 result = []
@@ -269,28 +269,32 b' class SummaryController(BaseRepoControll'
269 result.append({
269 result.append({
270 'text': title,
270 'text': title,
271 'children': self._create_reference_items(
271 'children': self._create_reference_items(
272 repo, refs, ref_type, format_ref_id),
272 repo, full_repo_name, refs, ref_type, format_ref_id),
273 })
273 })
274 return result
274 return result
275
275
276 def _create_reference_items(self, repo, refs, ref_type, format_ref_id):
276 def _create_reference_items(self, repo, full_repo_name, refs, ref_type,
277 format_ref_id):
277 result = []
278 result = []
278 is_svn = h.is_svn(repo)
279 is_svn = h.is_svn(repo)
279 for name, raw_id in refs.iteritems():
280 for ref_name, raw_id in refs.iteritems():
281 files_url = self._create_files_url(
282 repo, full_repo_name, ref_name, raw_id, is_svn)
280 result.append({
283 result.append({
281 'text': name,
284 'text': ref_name,
282 'id': format_ref_id(name, raw_id),
285 'id': format_ref_id(ref_name, raw_id),
283 'raw_id': raw_id,
286 'raw_id': raw_id,
284 'type': ref_type,
287 'type': ref_type,
285 'files_url': self._create_files_url(repo, name, raw_id, is_svn)
288 'files_url': files_url,
286 })
289 })
287 return result
290 return result
288
291
289 def _create_files_url(self, repo, name, raw_id, is_svn):
292 def _create_files_url(self, repo, full_repo_name, ref_name, raw_id,
290 use_commit_id = '/' in name or is_svn
293 is_svn):
294 use_commit_id = '/' in ref_name or is_svn
291 return h.url(
295 return h.url(
292 'files_home',
296 'files_home',
293 repo_name=repo.name,
297 repo_name=full_repo_name,
294 f_path=name if is_svn else '',
298 f_path=ref_name if is_svn else '',
295 revision=raw_id if use_commit_id else name,
299 revision=raw_id if use_commit_id else ref_name,
296 at=name)
300 at=ref_name)
General Comments 0
You need to be logged in to leave comments. Login now