scm: split Repository#entries (#14361)

git-svn-id: http://svn.redmine.org/redmine/trunk@12754 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Toshi MARUYAMA 2014-02-02 00:40:59 +00:00
parent f2ec6f8d77
commit d45bf0a83e
5 changed files with 15 additions and 11 deletions

View File

@ -188,8 +188,13 @@ class Repository < ActiveRecord::Base
scm.entry(path, identifier) scm.entry(path, identifier)
end end
def scm_entries(path=nil, identifier=nil)
scm.entries(path, identifier)
end
protected :scm_entries
def entries(path=nil, identifier=nil) def entries(path=nil, identifier=nil)
entries = scm.entries(path, identifier) entries = scm_entries(path, identifier)
load_entries_changesets(entries) load_entries_changesets(entries)
entries entries
end end

View File

@ -57,7 +57,7 @@ class Repository::Bazaar < Repository
scm.diff(path, rev, rev_to) scm.diff(path, rev, rev_to)
end end
def entries(path=nil, identifier=nil) def scm_entries(path=nil, identifier=nil)
scm.bzr_path_encodig = log_encoding scm.bzr_path_encodig = log_encoding
entries = scm.entries(path, identifier) entries = scm.entries(path, identifier)
if entries if entries
@ -80,9 +80,9 @@ class Repository::Bazaar < Repository
end end
end end
end end
load_entries_changesets(entries)
entries entries
end end
protected :scm_entries
def fetch_changesets def fetch_changesets
scm.bzr_path_encodig = log_encoding scm.bzr_path_encodig = log_encoding

View File

@ -47,7 +47,7 @@ class Repository::Cvs < Repository
scm.entry(path, rev.nil? ? nil : rev.committed_on) scm.entry(path, rev.nil? ? nil : rev.committed_on)
end end
def entries(path=nil, identifier=nil) def scm_entries(path=nil, identifier=nil)
rev = nil rev = nil
if ! identifier.nil? if ! identifier.nil?
rev = changesets.find_by_revision(identifier) rev = changesets.find_by_revision(identifier)
@ -69,9 +69,9 @@ class Repository::Cvs < Repository
end end
end end
end end
load_entries_changesets(entries)
entries entries
end end
protected :scm_entries
def cat(path, identifier=nil) def cat(path, identifier=nil)
rev = nil rev = nil

View File

@ -45,7 +45,7 @@ class Repository::Darcs < Repository
scm.entry(path, patch.nil? ? nil : patch.scmid) scm.entry(path, patch.nil? ? nil : patch.scmid)
end end
def entries(path=nil, identifier=nil) def scm_entries(path=nil, identifier=nil)
patch = nil patch = nil
if ! identifier.nil? if ! identifier.nil?
patch = changesets.find_by_revision(identifier) patch = changesets.find_by_revision(identifier)
@ -66,9 +66,9 @@ class Repository::Darcs < Repository
end end
end end
end end
load_entries_changesets(entries)
entries entries
end end
protected :scm_entries
def cat(path, identifier=nil) def cat(path, identifier=nil)
patch = identifier.nil? ? nil : changesets.find_by_revision(identifier.to_s) patch = identifier.nil? ? nil : changesets.find_by_revision(identifier.to_s)

View File

@ -93,11 +93,10 @@ class Repository::Git < Repository
end end
end end
def entries(path=nil, identifier=nil) def scm_entries(path=nil, identifier=nil)
entries = scm.entries(path, identifier, :report_last_commit => extra_report_last_commit) scm.entries(path, identifier, :report_last_commit => extra_report_last_commit)
load_entries_changesets(entries)
entries
end end
protected :scm_entries
# With SCMs that have a sequential commit numbering, # With SCMs that have a sequential commit numbering,
# such as Subversion and Mercurial, # such as Subversion and Mercurial,