comparison app/models/.svn/text-base/repository.rb.svn-base @ 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 cd2282d2aa55
comparison
equal deleted inserted replaced
39:150ceac17a8d 117:af80e5618e9b
92 path 92 path
93 end 93 end
94 94
95 # Finds and returns a revision with a number or the beginning of a hash 95 # Finds and returns a revision with a number or the beginning of a hash
96 def find_changeset_by_name(name) 96 def find_changeset_by_name(name)
97 return nil if name.nil? || name.empty?
97 changesets.find(:first, :conditions => (name.match(/^\d*$/) ? ["revision = ?", name.to_s] : ["revision LIKE ?", name + '%'])) 98 changesets.find(:first, :conditions => (name.match(/^\d*$/) ? ["revision = ?", name.to_s] : ["revision LIKE ?", name + '%']))
98 end 99 end
99 100
100 def latest_changeset 101 def latest_changeset
101 @latest_changeset ||= changesets.find(:first) 102 @latest_changeset ||= changesets.find(:first)