Defect #13036 » cs_mod.patch
| app/models/changeset.rb 2013-03-14 16:30:16.639922046 -0700 | ||
|---|---|---|
|
end
|
||
|
def text_tag(ref_project=nil)
|
||
|
tag = if scmid?
|
||
|
"commit:#{scmid}"
|
||
|
repo_id = if (repository && repository.identifier.present?)
|
||
|
"#{repository.identifier}"
|
||
|
else
|
||
|
"r#{revision}"
|
||
|
""
|
||
|
end
|
||
|
if repository && repository.identifier.present?
|
||
|
tag = "#{repository.identifier}|#{tag}"
|
||
|
tag = if scmid?
|
||
|
"commit:#{repo_id}|#{scmid}"
|
||
|
else
|
||
|
"#{repo_id}|r#{revision}"
|
||
|
end
|
||
|
if ref_project && project && ref_project != project
|
||
|
tag = "#{project.identifier}:#{tag}"
|
||
|
-- test/unit/changeset_test.rb.orig 2013-03-14 16:30:10.003824745 -0700
|
||
|
++ test/unit/changeset_test.rb 2013-03-16 22:44:42.898105363 -0700
|
||
| ... | ... | |
|
assert_equal 'commit:0123456789', c.text_tag
|
||
|
end
|
||
|
def test_text_tag_hash_with_repository_identifier
|
||
|
r = Repository::Git.create!(
|
||
|
:project_id => 1,
|
||
|
:url => 'git://localhost/test',
|
||
|
:identifier => 'documents')
|
||
|
|
||
|
c = Changeset.new(:revision => '7234cb27', :scmid => '7234cb27', :repository => r)
|
||
|
assert_equal 'commit:documents|7234cb27', c.text_tag
|
||
|
assert_equal 'ecookbook:commit:documents|7234cb27', c.text_tag(Project.find(2))
|
||
|
end
|
||
|
def test_previous
|
||
|
changeset = Changeset.find_by_revision('3')
|
||
|
assert_equal Changeset.find_by_revision('2'), changeset.previous
|
||
- « Previous
- 1
- 2
- Next »