@@ -0,0 +1,18 | |||||
|
1 | class CopyRepositoriesLogEncoding < ActiveRecord::Migration | |||
|
2 | def self.up | |||
|
3 | encoding = Setting.commit_logs_encoding.to_s.strip | |||
|
4 | encoding = encoding.blank? ? 'UTF-8' : encoding | |||
|
5 | Repository.find(:all).each do |repo| | |||
|
6 | scm = repo.scm_name | |||
|
7 | case scm | |||
|
8 | when 'Subversion', 'Mercurial', 'Git', 'Filesystem' | |||
|
9 | repo.update_attribute(:log_encoding, nil) | |||
|
10 | else | |||
|
11 | repo.update_attribute(:log_encoding, encoding) | |||
|
12 | end | |||
|
13 | end | |||
|
14 | end | |||
|
15 | ||||
|
16 | def self.down | |||
|
17 | end | |||
|
18 | end |
General Comments 0
You need to be logged in to leave comments.
Login now