comparison lib/redmine/scm/adapters/abstract_adapter.rb @ 3:7c48bad7d85d yuya

* Import Mercurial overhaul patches from Yuya Nishihara (see http://www.redmine.org/issues/4455)
author Chris Cannam
date Wed, 28 Jul 2010 12:40:01 +0100
parents 513646585e45
children b859cc0c4fa1
comparison
equal deleted inserted replaced
2:b940d200fbd2 3:7c48bad7d85d
269 }.last 269 }.last
270 end 270 end
271 end 271 end
272 272
273 class Revision 273 class Revision
274 attr_accessor :identifier, :scmid, :name, :author, :time, :message, :paths, :revision, :branch 274 attr_accessor :scmid, :name, :author, :time, :message, :paths, :revision, :branch
275 attr_writer :identifier
275 276
276 def initialize(attributes={}) 277 def initialize(attributes={})
277 self.identifier = attributes[:identifier] 278 self.identifier = attributes[:identifier]
278 self.scmid = attributes[:scmid] 279 self.scmid = attributes[:scmid]
279 self.name = attributes[:name] || self.identifier 280 self.name = attributes[:name] || self.identifier
281 self.time = attributes[:time] 282 self.time = attributes[:time]
282 self.message = attributes[:message] || "" 283 self.message = attributes[:message] || ""
283 self.paths = attributes[:paths] 284 self.paths = attributes[:paths]
284 self.revision = attributes[:revision] 285 self.revision = attributes[:revision]
285 self.branch = attributes[:branch] 286 self.branch = attributes[:branch]
287 end
288
289 # Returns the identifier of this revision.
290 # e.g. revision number for centralized system; hash id for DVCS
291 def identifier
292 @identifier || scmid || revision
286 end 293 end
287 294
288 def save(repo) 295 def save(repo)
289 Changeset.transaction do 296 Changeset.transaction do
290 changeset = Changeset.new( 297 changeset = Changeset.new(