Revision 1298:4f746d8966dd app/models/repository

View differences:

app/models/repository/bazaar.rb
1 1
# Redmine - project management software
2
# Copyright (C) 2006-2012  Jean-Philippe Lang
2
# Copyright (C) 2006-2013  Jean-Philippe Lang
3 3
#
4 4
# This program is free software; you can redistribute it and/or
5 5
# modify it under the terms of the GNU General Public License
app/models/repository/cvs.rb
1 1
# Redmine - project management software
2
# Copyright (C) 2006-2012  Jean-Philippe Lang
2
# Copyright (C) 2006-2013  Jean-Philippe Lang
3 3
#
4 4
# This program is free software; you can redistribute it and/or
5 5
# modify it under the terms of the GNU General Public License
app/models/repository/darcs.rb
1 1
# Redmine - project management software
2
# Copyright (C) 2006-2012  Jean-Philippe Lang
2
# Copyright (C) 2006-2013  Jean-Philippe Lang
3 3
#
4 4
# This program is free software; you can redistribute it and/or
5 5
# modify it under the terms of the GNU General Public License
app/models/repository/filesystem.rb
1 1
# Redmine - project management software
2
# Copyright (C) 2006-2012  Jean-Philippe Lang
2
# Copyright (C) 2006-2013  Jean-Philippe Lang
3 3
#
4 4
# FileSystem adapter
5 5
# File written by Paul Rivier, at Demotera.
app/models/repository/git.rb
1 1
# Redmine - project management software
2
# Copyright (C) 2006-2012  Jean-Philippe Lang
2
# Copyright (C) 2006-2013  Jean-Philippe Lang
3 3
# Copyright (C) 2007  Patrick Aljord patcito@ŋmail.com
4 4
#
5 5
# This program is free software; you can redistribute it and/or
......
251 251
      :conditions => [
252 252
        "scmid IN (?)",
253 253
        revisions.map!{|c| c.scmid}
254
      ],
255
      :order => 'committed_on DESC'
254
      ]
256 255
    )
257 256
  end
258 257

  
app/models/repository/mercurial.rb
1 1
# Redmine - project management software
2
# Copyright (C) 2006-2012  Jean-Philippe Lang
2
# Copyright (C) 2006-2013  Jean-Philippe Lang
3 3
#
4 4
# This program is free software; you can redistribute it and/or
5 5
# modify it under the terms of the GNU General Public License
......
92 92
  # Sqlite3 and PostgreSQL pass.
93 93
  # Is this MySQL bug?
94 94
  def latest_changesets(path, rev, limit=10)
95
    changesets.find(:all,
96
                    :include    => :user,
97
                    :conditions => latest_changesets_cond(path, rev, limit),
98
                    :limit      => limit,
99
                    :order      => "#{Changeset.table_name}.id DESC")
95
    changesets.
96
      includes(:user).
97
      where(latest_changesets_cond(path, rev, limit)).
98
      limit(limit).
99
      order("#{Changeset.table_name}.id DESC").
100
      all
100 101
  end
101 102

  
102 103
  def latest_changesets_cond(path, rev, limit)
app/models/repository/subversion.rb
1 1
# Redmine - project management software
2
# Copyright (C) 2006-2012  Jean-Philippe Lang
2
# Copyright (C) 2006-2013  Jean-Philippe Lang
3 3
#
4 4
# This program is free software; you can redistribute it and/or
5 5
# modify it under the terms of the GNU General Public License
......
20 20
class Repository::Subversion < Repository
21 21
  attr_protected :root_url
22 22
  validates_presence_of :url
23
  validates_format_of :url, :with => /^(http|https|svn(\+[^\s:\/\\]+)?|file):\/\/.+/i
23
  validates_format_of :url, :with => /\A(http|https|svn(\+[^\s:\/\\]+)?|file):\/\/.+/i
24 24

  
25 25
  def self.scm_adapter_class
26 26
    Redmine::Scm::Adapters::SubversionAdapter

Also available in: Unified diff