mirror of
https://github.com/redmine/redmine.git
synced 2026-05-09 00:37:29 +02:00
Contributed by Yuya Nishihara. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4613 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -271,7 +271,8 @@ module Redmine
|
||||
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 @@ module Redmine
|
||||
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(
|
||||
|
||||
@@ -264,6 +264,13 @@ module Redmine
|
||||
return nil if $? && $?.exitstatus != 0
|
||||
cat
|
||||
end
|
||||
|
||||
class Revision < Redmine::Scm::Adapters::Revision
|
||||
# Returns the readable identifier
|
||||
def format_identifier
|
||||
identifier[0,8]
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user