@@ -157,6 +157,9 class Changeset < ActiveRecord::Base | |||||
157 | else |
|
157 | else | |
158 | "r#{revision}" |
|
158 | "r#{revision}" | |
159 | end |
|
159 | end | |
|
160 | if repository && repository.identifier.present? | |||
|
161 | tag = "#{repository.identifier}|#{tag}" | |||
|
162 | end | |||
160 | if ref_project && project && ref_project != project |
|
163 | if ref_project && project && ref_project != project | |
161 | tag = "#{project.identifier}:#{tag}" |
|
164 | tag = "#{project.identifier}:#{tag}" | |
162 | end |
|
165 | end |
@@ -255,6 +255,17 class ChangesetTest < ActiveSupport::TestCase | |||||
255 | assert_equal 'ecookbook:r520', c.text_tag(Project.find(2)) |
|
255 | assert_equal 'ecookbook:r520', c.text_tag(Project.find(2)) | |
256 | end |
|
256 | end | |
257 |
|
257 | |||
|
258 | def test_text_tag_revision_with_repository_identifier | |||
|
259 | r = Repository::Subversion.create!( | |||
|
260 | :project_id => 1, | |||
|
261 | :url => 'svn://localhost/test', | |||
|
262 | :identifier => 'documents') | |||
|
263 | ||||
|
264 | c = Changeset.new(:revision => '520', :repository => r) | |||
|
265 | assert_equal 'documents|r520', c.text_tag | |||
|
266 | assert_equal 'ecookbook:documents|r520', c.text_tag(Project.find(2)) | |||
|
267 | end | |||
|
268 | ||||
258 | def test_text_tag_hash |
|
269 | def test_text_tag_hash | |
259 | c = Changeset.new( |
|
270 | c = Changeset.new( | |
260 | :scmid => '7234cb2750b63f47bff735edc50a1c0a433c2518', |
|
271 | :scmid => '7234cb2750b63f47bff735edc50a1c0a433c2518', |
General Comments 0
You need to be logged in to leave comments.
Login now