mirror of
https://github.com/meineerde/redmine.git
synced 2025-12-20 15:31:12 +00:00
add empty line after guard clause to app/models/repository/mercurial.rb
git-svn-id: http://svn.redmine.org/redmine/trunk@20043 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
77fceb7585
commit
8b49aeeb32
@ -82,6 +82,7 @@ class Repository::Mercurial < Repository
|
|||||||
def entry(path=nil, identifier=nil)
|
def entry(path=nil, identifier=nil)
|
||||||
entry = scm.entry(path, identifier)
|
entry = scm.entry(path, identifier)
|
||||||
return nil if entry.nil?
|
return nil if entry.nil?
|
||||||
|
|
||||||
modify_entry_lastrev_identifier(entry)
|
modify_entry_lastrev_identifier(entry)
|
||||||
entry
|
entry
|
||||||
end
|
end
|
||||||
@ -89,6 +90,7 @@ class Repository::Mercurial < Repository
|
|||||||
def scm_entries(path=nil, identifier=nil)
|
def scm_entries(path=nil, identifier=nil)
|
||||||
entries = scm.entries(path, identifier)
|
entries = scm.entries(path, identifier)
|
||||||
return nil if entries.nil?
|
return nil if entries.nil?
|
||||||
|
|
||||||
entries.each {|entry| modify_entry_lastrev_identifier(entry)}
|
entries.each {|entry| modify_entry_lastrev_identifier(entry)}
|
||||||
entries
|
entries
|
||||||
end
|
end
|
||||||
@ -97,6 +99,7 @@ class Repository::Mercurial < Repository
|
|||||||
# Finds and returns a revision with a number or the beginning of a hash
|
# Finds and returns a revision with a number or the beginning of a hash
|
||||||
def find_changeset_by_name(name)
|
def find_changeset_by_name(name)
|
||||||
return nil if name.blank?
|
return nil if name.blank?
|
||||||
|
|
||||||
s = name.to_s
|
s = name.to_s
|
||||||
if /[^\d]/.match?(s) || s.size > 8
|
if /[^\d]/.match?(s) || s.size > 8
|
||||||
cs = changesets.where(:scmid => s).first
|
cs = changesets.where(:scmid => s).first
|
||||||
@ -104,6 +107,7 @@ class Repository::Mercurial < Repository
|
|||||||
cs = changesets.find_by(:revision => s)
|
cs = changesets.find_by(:revision => s)
|
||||||
end
|
end
|
||||||
return cs if cs
|
return cs if cs
|
||||||
|
|
||||||
changesets.where('scmid LIKE ?', "#{s}%").first
|
changesets.where('scmid LIKE ?', "#{s}%").first
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -126,6 +130,7 @@ class Repository::Mercurial < Repository
|
|||||||
|
|
||||||
def is_short_id_in_db?
|
def is_short_id_in_db?
|
||||||
return @is_short_id_in_db unless @is_short_id_in_db.nil?
|
return @is_short_id_in_db unless @is_short_id_in_db.nil?
|
||||||
|
|
||||||
cs = changesets.first
|
cs = changesets.first
|
||||||
@is_short_id_in_db = (!cs.nil? && cs.scmid.length != 40)
|
@is_short_id_in_db = (!cs.nil? && cs.scmid.length != 40)
|
||||||
end
|
end
|
||||||
@ -179,6 +184,7 @@ class Repository::Mercurial < Repository
|
|||||||
|
|
||||||
def fetch_changesets
|
def fetch_changesets
|
||||||
return if scm.info.nil?
|
return if scm.info.nil?
|
||||||
|
|
||||||
scm_rev = scm.info.lastrev.revision.to_i
|
scm_rev = scm.info.lastrev.revision.to_i
|
||||||
db_rev = latest_changeset ? latest_changeset.revision.to_i : -1
|
db_rev = latest_changeset ? latest_changeset.revision.to_i : -1
|
||||||
return unless db_rev < scm_rev # already up-to-date
|
return unless db_rev < scm_rev # already up-to-date
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user