Project

General

Profile

Actions

Defect #13005

closed

Can't link to changeset or source in repository that contains underscores

Added by A B almost 12 years ago. Updated almost 12 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Text formatting
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Duplicate
Affected version:

Description

If the repository identifier contains underscores (which is legal according to the help text when adding a repository) then the commit:<repo>|<changeset> and source:<repo&gt;|<changeset> links will not be created. The reason is that the regexp to match the repository identifier is missing the underscore. The following patch fixes this:

--- app/helpers/application_helper.rb.orig    2013-01-20 12:05:33.000000000 -0800
+++ app/helpers/application_helper.rb    2013-01-28 01:35:29.820872421 -0800
@@ -793,7 +793,7 @@
           when 'commit', 'source', 'export'
             if project
               repository = nil
-              if name =~ %r{^(([a-z0-9\-]+)\|)(.+)$}
+              if name =~ %r{^(([a-z0-9_\-]+)\|)(.+)$}
                 repo_prefix, repo_identifier, name = $1, $2, $3
                 repository = project.repositories.detect {|repo| repo.identifier == repo_identifier}
               else


Related issues

Is duplicate of Redmine - Defect #12979: Wiki link syntax commit:repo_a:abcd doesn't workClosedJean-Philippe Lang

Actions
Actions

Also available in: Atom PDF