From cbcce704006c6827b4a3134a2dda9de7c47f18ae Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micha=C3=ABl=20Rigart?= <michael@netronix.be>
Date: Fri, 24 Feb 2012 10:18:06 +0100
Subject: [PATCH] Fix requiring SCM classes in dev mode #828

Change require to require_dependency so SCM classes get loaded on each request in dev mode
---
 app/models/repository/bazaar.rb                | 2 +-
 app/models/repository/cvs.rb                   | 2 +-
 app/models/repository/darcs.rb                 | 2 +-
 app/models/repository/filesystem.rb            | 2 +-
 app/models/repository/git.rb                   | 2 +-
 app/models/repository/mercurial.rb             | 2 +-
 app/models/repository/subversion.rb            | 2 +-
 lib/redmine/scm/adapters/bazaar_adapter.rb     | 2 +-
 lib/redmine/scm/adapters/cvs_adapter.rb        | 2 +-
 lib/redmine/scm/adapters/darcs_adapter.rb      | 2 +-
 lib/redmine/scm/adapters/filesystem_adapter.rb | 2 +-
 lib/redmine/scm/adapters/git_adapter.rb        | 2 +-
 lib/redmine/scm/adapters/mercurial_adapter.rb  | 2 +-
 lib/redmine/scm/adapters/subversion_adapter.rb | 2 +-
 14 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/app/models/repository/bazaar.rb b/app/models/repository/bazaar.rb
index 7fa3cb1e3..8178e6dbf 100644
--- a/app/models/repository/bazaar.rb
+++ b/app/models/repository/bazaar.rb
@@ -12,7 +12,7 @@
 # See doc/COPYRIGHT.rdoc for more details.
 #++
 
-require 'redmine/scm/adapters/bazaar_adapter'
+require_dependency 'redmine/scm/adapters/bazaar_adapter'
 
 class Repository::Bazaar < Repository
   attr_protected :root_url
diff --git a/app/models/repository/cvs.rb b/app/models/repository/cvs.rb
index 99b8ccfa9..fa37a17e3 100644
--- a/app/models/repository/cvs.rb
+++ b/app/models/repository/cvs.rb
@@ -12,7 +12,7 @@
 # See doc/COPYRIGHT.rdoc for more details.
 #++
 
-require 'redmine/scm/adapters/cvs_adapter'
+require_dependency 'redmine/scm/adapters/cvs_adapter'
 require 'digest/sha1'
 
 class Repository::Cvs < Repository
diff --git a/app/models/repository/darcs.rb b/app/models/repository/darcs.rb
index 1f5bf69af..96924de20 100644
--- a/app/models/repository/darcs.rb
+++ b/app/models/repository/darcs.rb
@@ -12,7 +12,7 @@
 # See doc/COPYRIGHT.rdoc for more details.
 #++
 
-require 'redmine/scm/adapters/darcs_adapter'
+require_dependency 'redmine/scm/adapters/darcs_adapter'
 
 class Repository::Darcs < Repository
   validates_presence_of :url, :log_encoding
diff --git a/app/models/repository/filesystem.rb b/app/models/repository/filesystem.rb
index 722e5316c..7d6ffbeb2 100644
--- a/app/models/repository/filesystem.rb
+++ b/app/models/repository/filesystem.rb
@@ -12,7 +12,7 @@
 # See doc/COPYRIGHT.rdoc for more details.
 #++
 
-require 'redmine/scm/adapters/filesystem_adapter'
+require_dependency 'redmine/scm/adapters/filesystem_adapter'
 
 class Repository::Filesystem < Repository
   attr_protected :root_url
diff --git a/app/models/repository/git.rb b/app/models/repository/git.rb
index 7817aff42..9bacac687 100644
--- a/app/models/repository/git.rb
+++ b/app/models/repository/git.rb
@@ -12,7 +12,7 @@
 # See doc/COPYRIGHT.rdoc for more details.
 #++
 
-require 'redmine/scm/adapters/git_adapter'
+require_dependency 'redmine/scm/adapters/git_adapter'
 
 class Repository::Git < Repository
   attr_protected :root_url
diff --git a/app/models/repository/mercurial.rb b/app/models/repository/mercurial.rb
index 24c9d7a78..a67826a19 100644
--- a/app/models/repository/mercurial.rb
+++ b/app/models/repository/mercurial.rb
@@ -12,7 +12,7 @@
 # See doc/COPYRIGHT.rdoc for more details.
 #++
 
-require 'redmine/scm/adapters/mercurial_adapter'
+require_dependency 'redmine/scm/adapters/mercurial_adapter'
 
 class Repository::Mercurial < Repository
   # sort changesets by revision number
diff --git a/app/models/repository/subversion.rb b/app/models/repository/subversion.rb
index 0515460db..19f8e26be 100644
--- a/app/models/repository/subversion.rb
+++ b/app/models/repository/subversion.rb
@@ -12,7 +12,7 @@
 # See doc/COPYRIGHT.rdoc for more details.
 #++
 
-require 'redmine/scm/adapters/subversion_adapter'
+require_dependency 'redmine/scm/adapters/subversion_adapter'
 
 class Repository::Subversion < Repository
   attr_protected :root_url
diff --git a/lib/redmine/scm/adapters/bazaar_adapter.rb b/lib/redmine/scm/adapters/bazaar_adapter.rb
index bbc44b4d6..58b6e0b48 100644
--- a/lib/redmine/scm/adapters/bazaar_adapter.rb
+++ b/lib/redmine/scm/adapters/bazaar_adapter.rb
@@ -12,7 +12,7 @@
 # See doc/COPYRIGHT.rdoc for more details.
 #++
 
-require 'redmine/scm/adapters/abstract_adapter'
+require_dependency 'redmine/scm/adapters/abstract_adapter'
 
 module Redmine
   module Scm
diff --git a/lib/redmine/scm/adapters/cvs_adapter.rb b/lib/redmine/scm/adapters/cvs_adapter.rb
index 4a74df6a2..cee5b7010 100644
--- a/lib/redmine/scm/adapters/cvs_adapter.rb
+++ b/lib/redmine/scm/adapters/cvs_adapter.rb
@@ -12,7 +12,7 @@
 # See doc/COPYRIGHT.rdoc for more details.
 #++
 
-require 'redmine/scm/adapters/abstract_adapter'
+require_dependency 'redmine/scm/adapters/abstract_adapter'
 
 module Redmine
   module Scm
diff --git a/lib/redmine/scm/adapters/darcs_adapter.rb b/lib/redmine/scm/adapters/darcs_adapter.rb
index a31ee593c..796efdb11 100644
--- a/lib/redmine/scm/adapters/darcs_adapter.rb
+++ b/lib/redmine/scm/adapters/darcs_adapter.rb
@@ -12,7 +12,7 @@
 # See doc/COPYRIGHT.rdoc for more details.
 #++
 
-require 'redmine/scm/adapters/abstract_adapter'
+require_dependency 'redmine/scm/adapters/abstract_adapter'
 require 'rexml/document'
 
 module Redmine
diff --git a/lib/redmine/scm/adapters/filesystem_adapter.rb b/lib/redmine/scm/adapters/filesystem_adapter.rb
index 9051093be..687e95340 100644
--- a/lib/redmine/scm/adapters/filesystem_adapter.rb
+++ b/lib/redmine/scm/adapters/filesystem_adapter.rb
@@ -12,7 +12,7 @@
 # See doc/COPYRIGHT.rdoc for more details.
 #++
 
-require 'redmine/scm/adapters/abstract_adapter'
+require_dependency 'redmine/scm/adapters/abstract_adapter'
 require 'find'
 
 module Redmine
diff --git a/lib/redmine/scm/adapters/git_adapter.rb b/lib/redmine/scm/adapters/git_adapter.rb
index 0674c22d8..8f3008df8 100644
--- a/lib/redmine/scm/adapters/git_adapter.rb
+++ b/lib/redmine/scm/adapters/git_adapter.rb
@@ -12,7 +12,7 @@
 # See doc/COPYRIGHT.rdoc for more details.
 #++
 
-require 'redmine/scm/adapters/abstract_adapter'
+require_dependency 'redmine/scm/adapters/abstract_adapter'
 
 module Redmine
   module Scm
diff --git a/lib/redmine/scm/adapters/mercurial_adapter.rb b/lib/redmine/scm/adapters/mercurial_adapter.rb
index 06d80c1f7..c119e0862 100644
--- a/lib/redmine/scm/adapters/mercurial_adapter.rb
+++ b/lib/redmine/scm/adapters/mercurial_adapter.rb
@@ -12,7 +12,7 @@
 # See doc/COPYRIGHT.rdoc for more details.
 #++
 
-require 'redmine/scm/adapters/abstract_adapter'
+require_dependency 'redmine/scm/adapters/abstract_adapter'
 require 'cgi'
 
 module Redmine
diff --git a/lib/redmine/scm/adapters/subversion_adapter.rb b/lib/redmine/scm/adapters/subversion_adapter.rb
index 1171a1ec4..ab8b5d15e 100644
--- a/lib/redmine/scm/adapters/subversion_adapter.rb
+++ b/lib/redmine/scm/adapters/subversion_adapter.rb
@@ -12,7 +12,7 @@
 # See doc/COPYRIGHT.rdoc for more details.
 #++
 
-require 'redmine/scm/adapters/abstract_adapter'
+require_dependency 'redmine/scm/adapters/abstract_adapter'
 require 'uri'
 
 module Redmine
-- 
GitLab