##// END OF EJS Templates
scm: mercurial: use 12 chars id for format_changeset_identifier (#14361)...
Toshi MARUYAMA -
r12474:5dcecec1bd8a
parent child
Show More
@@ -59,7 +59,7 class Repository::Mercurial < Repository
59
59
60 # Returns the readable identifier for the given mercurial changeset
60 # Returns the readable identifier for the given mercurial changeset
61 def self.format_changeset_identifier(changeset)
61 def self.format_changeset_identifier(changeset)
62 "#{changeset.revision}:#{changeset.scmid}"
62 "#{changeset.revision}:#{changeset.scmid[0, 12]}"
63 end
63 end
64
64
65 # Returns the identifier for the given Mercurial changeset
65 # Returns the identifier for the given Mercurial changeset
@@ -297,6 +297,17 class RepositoryMercurialTest < ActiveSupport::TestCase
297 assert_equal '2:400bb8672109', c.format_identifier
297 assert_equal '2:400bb8672109', c.format_identifier
298 end
298 end
299
299
300 def test_format_identifier_long_id
301 assert_equal 0, @repository.changesets.count
302 Changeset.create!(:repository => @repository,
303 :committed_on => Time.now,
304 :revision => '0',
305 :scmid => '0885933ad4f68d77c2649cd11f8311276e7ef7ce',
306 :comments => 'test')
307 c = @repository.changesets.find_by_revision('0')
308 assert_equal '0:0885933ad4f6', c.format_identifier
309 end
310
300 def test_find_changeset_by_empty_name
311 def test_find_changeset_by_empty_name
301 assert_equal 0, @repository.changesets.count
312 assert_equal 0, @repository.changesets.count
302 @repository.fetch_changesets
313 @repository.fetch_changesets
General Comments 0
You need to be logged in to leave comments. Login now