Feature #4155 » fix-scmid-all-number.diff
| app/models/changeset.rb | ||
|---|---|---|
|
end
|
||
|
def text_tag
|
||
|
c = scmid? ? scmid : revision
|
||
|
if c.to_s =~ /^[0-9]*$/
|
||
|
"r#{c}"
|
||
|
if scmid?
|
||
|
"commit:#{scmid}"
|
||
|
else
|
||
|
"commit:#{c}"
|
||
|
"r#{revision}"
|
||
|
end
|
||
|
end
|
||
|
|
||
| test/unit/changeset_test.rb | ||
|---|---|---|
|
c = Changeset.new(:repository => Project.find(1).repository,
|
||
|
:committed_on => 24.hours.ago,
|
||
|
:comments => 'Worked on this issue #1 @2h',
|
||
|
:scmid => '520',
|
||
|
:revision => '520',
|
||
|
:user => User.find(2))
|
||
|
assert_difference 'TimeEntry.count' do
|
||
| ... | ... | |
|
assert c.issues.first.project != c.project
|
||
|
end
|
||
|
|
||
|
def test_text_tag_numeric
|
||
|
c = Changeset.new(:scmid => '520', :revision => '520')
|
||
|
def test_text_tag_revision
|
||
|
c = Changeset.new(:revision => '520')
|
||
|
assert_equal 'r520', c.text_tag
|
||
|
end
|
||
|
|
||
| ... | ... | |
|
assert_equal 'commit:7234cb2750b63f47bff735edc50a1c0a433c2518', c.text_tag
|
||
|
end
|
||
|
def test_text_tag_hash_all_number
|
||
|
c = Changeset.new(:scmid => '0123456789', :revision => '0123456789')
|
||
|
assert_equal 'commit:0123456789', c.text_tag
|
||
|
end
|
||
|
def test_previous
|
||
|
changeset = Changeset.find_by_revision('3')
|
||
|
assert_equal Changeset.find_by_revision('2'), changeset.previous
|
||
- « Previous
- 1
- …
- 11
- 12
- 13
- Next »