##// END OF EJS Templates
Leave wiki links untouched if target project doesn't exist or have no wiki....
Leave wiki links untouched if target project doesn't exist or have no wiki. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2436 e93f8b46-1217-0410-a6f0-8f06a7374b81

File last commit:

r2348:ab5e07e83ef2
r2375:70efee1bc5b8
Show More
git.rb
71 lines | 2.7 KiB | text/x-ruby | RubyLexer
Jean-Philippe Lang
Merged Git support branch (r1200 to r1226)....
r1222 # redMine - project management software
# Copyright (C) 2006-2007 Jean-Philippe Lang
# Copyright (C) 2007 Patrick Aljord patcito@ŋmail.com
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
require 'redmine/scm/adapters/git_adapter'
class Repository::Git < Repository
attr_protected :root_url
validates_presence_of :url
def scm_adapter
Redmine::Scm::Adapters::GitAdapter
end
def self.scm_name
'Git'
end
Jean-Philippe Lang
Adds a setting to limit the number of revisions displayed on a repository file log (default=100)....
r2348 def changesets_for_path(path, options={})
Jean-Philippe Lang
Eager-load users....
r2007 Change.find(:all, :include => {:changeset => :user},
Jean-Philippe Lang
Merged Git support branch (r1200 to r1226)....
r1222 :conditions => ["repository_id = ? AND path = ?", id, path],
Jean-Philippe Lang
Adds a setting to limit the number of revisions displayed on a repository file log (default=100)....
r2348 :order => "committed_on DESC, #{Changeset.table_name}.revision DESC",
:limit => options[:limit]).collect(&:changeset)
Jean-Philippe Lang
Merged Git support branch (r1200 to r1226)....
r1222 end
def fetch_changesets
scm_info = scm.info
if scm_info
# latest revision found in database
db_revision = latest_changeset ? latest_changeset.revision : nil
# latest revision in the repository
scm_revision = scm_info.lastrev.scmid
unless changesets.find_by_scmid(scm_revision)
Jean-Philippe Lang
Reduces memory usage when importing large git repositories (#1482)....
r1585 scm.revisions('', db_revision, nil, :reverse => true) do |revision|
Jean-Philippe Lang
Check that git changeset is not in the database before creating it (#1419)....
r1951 if changesets.find_by_scmid(revision.scmid.to_s).nil?
transaction do
changeset = Changeset.create!(:repository => self,
:revision => revision.identifier,
:scmid => revision.scmid,
:committer => revision.author,
:committed_on => revision.time,
:comments => revision.message)
revision.paths.each do |change|
Change.create!(:changeset => changeset,
:action => change[:action],
:path => change[:path],
:from_path => change[:from_path],
:from_revision => change[:from_revision])
end
Jean-Philippe Lang
Merged Git support branch (r1200 to r1226)....
r1222 end
end
end
end
end
end
end