@@ -755,7 +755,7 module ApplicationHelper | |||
|
755 | 755 | end |
|
756 | 756 | else |
|
757 | 757 | if repository && User.current.allowed_to?(:browse_repository, project) |
|
758 |
name =~ %r{^[/\\]*(.*?)(@([ |
|
|
758 | name =~ %r{^[/\\]*(.*?)(@([^/\\@]+?))?(#(L\d+))?$} | |
|
759 | 759 | path, rev, anchor = $1, $3, $5 |
|
760 | 760 | link = link_to h("#{project_prefix}#{prefix}:#{repo_prefix}#{name}"), {:controller => 'repositories', :action => (prefix == 'export' ? 'raw' : 'entry'), :id => project, :repository_id => repository.identifier_param, |
|
761 | 761 | :path => to_path_param(path), |
@@ -280,11 +280,13 RAW | |||
|
280 | 280 | source_url_with_rev = '/projects/ecookbook/repository/revisions/52/entry/some/file' |
|
281 | 281 | source_url_with_ext = '/projects/ecookbook/repository/entry/some/file.ext' |
|
282 | 282 | source_url_with_rev_and_ext = '/projects/ecookbook/repository/revisions/52/entry/some/file.ext' |
|
283 | source_url_with_branch = '/projects/ecookbook/repository/revisions/branch/entry/some/file' | |
|
283 | 284 | |
|
284 | 285 | export_url = '/projects/ecookbook/repository/raw/some/file' |
|
285 | 286 | export_url_with_rev = '/projects/ecookbook/repository/revisions/52/raw/some/file' |
|
286 | 287 | export_url_with_ext = '/projects/ecookbook/repository/raw/some/file.ext' |
|
287 | 288 | export_url_with_rev_and_ext = '/projects/ecookbook/repository/revisions/52/raw/some/file.ext' |
|
289 | export_url_with_branch = '/projects/ecookbook/repository/revisions/branch/raw/some/file' | |
|
288 | 290 | |
|
289 | 291 | to_test = { |
|
290 | 292 | # tickets |
@@ -315,6 +317,7 RAW | |||
|
315 | 317 | 'source:/some/file.ext. ' => link_to('source:/some/file.ext', source_url_with_ext, :class => 'source') + ".", |
|
316 | 318 | 'source:/some/file, ' => link_to('source:/some/file', source_url, :class => 'source') + ",", |
|
317 | 319 | 'source:/some/file@52' => link_to('source:/some/file@52', source_url_with_rev, :class => 'source'), |
|
320 | 'source:/some/file@branch' => link_to('source:/some/file@branch', source_url_with_branch, :class => 'source'), | |
|
318 | 321 | 'source:/some/file.ext@52' => link_to('source:/some/file.ext@52', source_url_with_rev_and_ext, :class => 'source'), |
|
319 | 322 | 'source:/some/file#L110' => link_to('source:/some/file#L110', source_url + "#L110", :class => 'source'), |
|
320 | 323 | 'source:/some/file.ext#L110' => link_to('source:/some/file.ext#L110', source_url_with_ext + "#L110", :class => 'source'), |
@@ -324,6 +327,7 RAW | |||
|
324 | 327 | 'export:/some/file.ext' => link_to('export:/some/file.ext', export_url_with_ext, :class => 'source download'), |
|
325 | 328 | 'export:/some/file@52' => link_to('export:/some/file@52', export_url_with_rev, :class => 'source download'), |
|
326 | 329 | 'export:/some/file.ext@52' => link_to('export:/some/file.ext@52', export_url_with_rev_and_ext, :class => 'source download'), |
|
330 | 'export:/some/file@branch' => link_to('export:/some/file@branch', export_url_with_branch, :class => 'source download'), | |
|
327 | 331 | # forum |
|
328 | 332 | 'forum#2' => link_to('Discussion', board_url, :class => 'board'), |
|
329 | 333 | 'forum:Discussion' => link_to('Discussion', board_url, :class => 'board'), |
General Comments 0
You need to be logged in to leave comments.
Login now