]> source.dussan.org Git - redmine.git/commitdiff
scm: mercurial: use revision text mercurial style "2:400bb8672109" (#3724).
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Tue, 11 Jan 2011 16:03:45 +0000 (16:03 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Tue, 11 Jan 2011 16:03:45 +0000 (16:03 +0000)
Contributed by Yuya Nishihara.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4697 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/repository/mercurial.rb
test/unit/repository_mercurial_test.rb

index 2157f9d790b88c9e731ba8a72a7711b001bc16f6..d9d0806d148a4ea252fdce5f1ec4792d058ab6e6 100644 (file)
@@ -34,8 +34,7 @@ class Repository::Mercurial < Repository
 
   # Returns the readable identifier for the given mercurial changeset
   def self.format_changeset_identifier(changeset)
-    # "#{changeset.revision}:#{changeset.scmid}"
-    changeset.revision
+    "#{changeset.revision}:#{changeset.scmid}"
   end
 
   # Returns the identifier for the given Mercurial changeset
index 09798edab937d4dccea892bfb6051a41eb33056b..8921acb765846641128687dfc47774075714a701 100644 (file)
@@ -146,6 +146,23 @@ class RepositoryMercurialTest < ActiveSupport::TestCase
       c = @repository.changesets.find_by_revision('2')
       assert_equal c.scmid, c.identifier
     end
+
+    def test_format_identifier
+      @repository.fetch_changesets
+      @repository.reload
+      c = @repository.changesets.find_by_revision('2')
+      assert_equal '2:400bb8672109', c.format_identifier
+    end
+
+    def test_activities
+      c = Changeset.new(:repository   => @repository,
+                        :committed_on => Time.now,
+                        :revision     => '123',
+                        :scmid        => 'abc400bb8672',
+                        :comments     => 'test')
+      assert c.event_title.include?('123:abc400bb8672:')
+      assert_equal 'abc400bb8672', c.event_url[:rev]
+    end
   else
     puts "Mercurial test repository NOT FOUND. Skipping unit tests !!!"
     def test_fake; assert true end