diff lib/redmine/scm/adapters/abstract_adapter.rb @ 117:af80e5618e9b redmine-1.1

* Update to Redmine 1.1-stable branch (Redmine SVN rev 4707)
author Chris Cannam
date Thu, 13 Jan 2011 12:53:21 +0000
parents 513646585e45
children b859cc0c4fa1 051f544170fe
line wrap: on
line diff
--- a/lib/redmine/scm/adapters/abstract_adapter.rb	Fri Nov 19 14:05:24 2010 +0000
+++ b/lib/redmine/scm/adapters/abstract_adapter.rb	Thu Jan 13 12:53:21 2011 +0000
@@ -271,7 +271,8 @@
       end
       
       class Revision
-        attr_accessor :identifier, :scmid, :name, :author, :time, :message, :paths, :revision, :branch
+        attr_accessor :scmid, :name, :author, :time, :message, :paths, :revision, :branch
+        attr_writer :identifier
 
         def initialize(attributes={})
           self.identifier = attributes[:identifier]
@@ -285,6 +286,16 @@
           self.branch = attributes[:branch]
         end
 
+        # Returns the identifier of this revision; see also Changeset model
+        def identifier
+          (@identifier || revision).to_s
+        end
+
+        # Returns the readable identifier.
+        def format_identifier
+          identifier
+        end
+
         def save(repo)
           Changeset.transaction do
             changeset = Changeset.new(