summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2011-02-24 05:58:59 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2011-02-24 05:58:59 +0000
commit9937ac677f388d84f689c54539ee5f833cec3d49 (patch)
treef8ca511e83b8fd18f853b3127c33e83e02e186f5 /lib
parent4bf84ca468dbd31d77747868156c01cd87cf3ff6 (diff)
downloadredmine-9937ac677f388d84f689c54539ee5f833cec3d49.tar.gz
redmine-9937ac677f388d84f689c54539ee5f833cec3d49.zip
scm: update adapter initialize() to use path encoding (#2664, #2274).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4941 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib')
-rw-r--r--lib/redmine/scm/adapters/abstract_adapter.rb15
-rw-r--r--lib/redmine/scm/adapters/cvs_adapter.rb3
-rw-r--r--lib/redmine/scm/adapters/darcs_adapter.rb3
-rw-r--r--lib/redmine/scm/adapters/filesystem_adapter.rb5
-rw-r--r--lib/redmine/scm/adapters/mercurial_adapter.rb4
5 files changed, 17 insertions, 13 deletions
diff --git a/lib/redmine/scm/adapters/abstract_adapter.rb b/lib/redmine/scm/adapters/abstract_adapter.rb
index 2bd82f5bc..3f9bc0ef1 100644
--- a/lib/redmine/scm/adapters/abstract_adapter.rb
+++ b/lib/redmine/scm/adapters/abstract_adapter.rb
@@ -34,14 +34,14 @@ module Redmine
def client_version
[]
end
-
+
# Returns the version string of the scm client
# Eg: '1.5.0' or 'Unknown version' if unknown
def client_version_string
v = client_version || 'Unknown version'
v.is_a?(Array) ? v.join('.') : v.to_s
end
-
+
# Returns true if the current client version is above
# or equals the given one
# If option is :unknown is set to true, it will return
@@ -63,17 +63,18 @@ module Redmine
end
end
- def initialize(url, root_url=nil, login=nil, password=nil)
+ def initialize(url, root_url=nil, login=nil, password=nil,
+ path_encoding=nil)
@url = url
@login = login if login && !login.empty?
@password = (password || "") if @login
@root_url = root_url.blank? ? retrieve_root_url : root_url
end
-
+
def adapter_name
'Abstract'
end
-
+
def supports_cat?
true
end
@@ -81,11 +82,11 @@ module Redmine
def supports_annotate?
respond_to?('annotate')
end
-
+
def root_url
@root_url
end
-
+
def url
@url
end
diff --git a/lib/redmine/scm/adapters/cvs_adapter.rb b/lib/redmine/scm/adapters/cvs_adapter.rb
index 25d4e420e..762e5c68d 100644
--- a/lib/redmine/scm/adapters/cvs_adapter.rb
+++ b/lib/redmine/scm/adapters/cvs_adapter.rb
@@ -62,7 +62,8 @@ module Redmine
# root_url -> the good old, sometimes damned, CVSROOT
# login -> unnecessary
# password -> unnecessary too
- def initialize(url, root_url=nil, login=nil, password=nil)
+ def initialize(url, root_url=nil, login=nil, password=nil,
+ path_encoding=nil)
@url = url
@login = login if login && !login.empty?
@password = (password || "") if @login
diff --git a/lib/redmine/scm/adapters/darcs_adapter.rb b/lib/redmine/scm/adapters/darcs_adapter.rb
index 279d503f0..9b79e653f 100644
--- a/lib/redmine/scm/adapters/darcs_adapter.rb
+++ b/lib/redmine/scm/adapters/darcs_adapter.rb
@@ -57,7 +57,8 @@ module Redmine
end
end
- def initialize(url, root_url=nil, login=nil, password=nil)
+ def initialize(url, root_url=nil, login=nil, password=nil,
+ path_encoding=nil)
@url = url
@root_url = url
end
diff --git a/lib/redmine/scm/adapters/filesystem_adapter.rb b/lib/redmine/scm/adapters/filesystem_adapter.rb
index 477629536..3f3f131e2 100644
--- a/lib/redmine/scm/adapters/filesystem_adapter.rb
+++ b/lib/redmine/scm/adapters/filesystem_adapter.rb
@@ -32,9 +32,10 @@ module Redmine
end
end
- def initialize(url, root_url=nil, login=nil, password=nil)
+ def initialize(url, root_url=nil, login=nil, password=nil,
+ path_encoding=nil)
@url = with_trailling_slash(url)
- @path_encoding = 'UTF-8'
+ @path_encoding = path_encoding || 'UTF-8'
end
def format_path_ends(path, leading=true, trailling=true)
diff --git a/lib/redmine/scm/adapters/mercurial_adapter.rb b/lib/redmine/scm/adapters/mercurial_adapter.rb
index 9b12dd383..11eb66b64 100644
--- a/lib/redmine/scm/adapters/mercurial_adapter.rb
+++ b/lib/redmine/scm/adapters/mercurial_adapter.rb
@@ -81,9 +81,9 @@ module Redmine
end
end
- def initialize(url, root_url=nil, login=nil, password=nil)
+ def initialize(url, root_url=nil, login=nil, password=nil, path_encoding=nil)
super
- @path_encoding = 'UTF-8'
+ @path_encoding = path_encoding || 'UTF-8'
end
def info