diff options
Diffstat (limited to 'app/models/repository.rb')
-rw-r--r-- | app/models/repository.rb | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/app/models/repository.rb b/app/models/repository.rb index bf181bfad..860395b5c 100644 --- a/app/models/repository.rb +++ b/app/models/repository.rb @@ -62,6 +62,18 @@ class Repository < ActiveRecord::Base def entries(path=nil, identifier=nil) scm.entries(path, identifier) end + + def branches + scm.branches + end + + def tags + scm.tags + end + + def default_branch + scm.default_branch + end def properties(path, identifier=nil) scm.properties(path, identifier) @@ -92,11 +104,15 @@ class Repository < ActiveRecord::Base def latest_changeset @latest_changeset ||= changesets.find(:first) end + + def latest_changesets(path,rev,limit=10) + @latest_changesets ||= changesets.find(:all, limit, :order => "committed_on DESC") + end def scan_changesets_for_issue_ids self.changesets.each(&:scan_comment_for_issue_ids) end - + # Returns an array of committers usernames and associated user_id def committers @committers ||= Changeset.connection.select_rows("SELECT DISTINCT committer, user_id FROM #{Changeset.table_name} WHERE repository_id = #{id}") |