Mercurial > hg > soundsoftware-site
comparison app/models/.svn/text-base/repository.rb.svn-base @ 128:07fa8a8b56a8
Update to Redmine trunk rev 4732
author | Chris Cannam |
---|---|
date | Wed, 19 Jan 2011 15:04:22 +0000 |
parents | 8661b858af72 |
children | 5e974759e8b2 051f544170fe |
comparison
equal
deleted
inserted
replaced
119:8661b858af72 | 128:07fa8a8b56a8 |
---|---|
96 | 96 |
97 # Returns a path relative to the url of the repository | 97 # Returns a path relative to the url of the repository |
98 def relative_path(path) | 98 def relative_path(path) |
99 path | 99 path |
100 end | 100 end |
101 | 101 |
102 # Finds and returns a revision with a number or the beginning of a hash | 102 # Finds and returns a revision with a number or the beginning of a hash |
103 def find_changeset_by_name(name) | 103 def find_changeset_by_name(name) |
104 return nil if name.nil? || name.empty? | 104 return nil if name.blank? |
105 changesets.find(:first, :conditions => (name.match(/^\d*$/) ? ["revision = ?", name.to_s] : ["revision LIKE ?", name + '%'])) | 105 changesets.find(:first, :conditions => (name.match(/^\d*$/) ? ["revision = ?", name.to_s] : ["revision LIKE ?", name + '%'])) |
106 end | 106 end |
107 | 107 |
108 def latest_changeset | 108 def latest_changeset |
109 @latest_changeset ||= changesets.find(:first) | 109 @latest_changeset ||= changesets.find(:first) |
110 end | 110 end |
111 | 111 |
112 # Returns the latest changesets for +path+ | 112 # Returns the latest changesets for +path+ |