comparison app/models/.svn/text-base/repository.rb.svn-base @ 129:5e974759e8b2 cannam

Merge from the default branch
author Chris Cannam
date Wed, 19 Jan 2011 15:15:02 +0000
parents cd2282d2aa55 07fa8a8b56a8
children eeebe205a056
comparison
equal deleted inserted replaced
127:32b5adec7422 129:5e974759e8b2
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+