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)
end
def scm_entries(path=nil, identifier=nil)
scm.entries(path, identifier)
end
protected :scm_entries
def entries(path=nil, identifier=nil)
entries = scm.entries(path, identifier)
entries = scm_entries(path, identifier)
load_entries_changesets(entries)
entries
end

View File

@ -57,7 +57,7 @@ class Repository::Bazaar < Repository
scm.diff(path, rev, rev_to)
end
def entries(path=nil, identifier=nil)
def scm_entries(path=nil, identifier=nil)
scm.bzr_path_encodig = log_encoding
entries = scm.entries(path, identifier)
if entries
@ -80,9 +80,9 @@ class Repository::Bazaar < Repository
end
end
end
load_entries_changesets(entries)
entries
end
protected :scm_entries
def fetch_changesets
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)
end
def entries(path=nil, identifier=nil)
def scm_entries(path=nil, identifier=nil)
rev = nil
if ! identifier.nil?
rev = changesets.find_by_revision(identifier)
@ -69,9 +69,9 @@ class Repository::Cvs < Repository
end
end
end
load_entries_changesets(entries)
entries
end
protected :scm_entries
def cat(path, identifier=nil)
rev = nil

View File

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

View File

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