Commit e5ff5c28694daee117f22ba3a8c21f38a5f14966

Authored by Dmitriy Zaporozhets
1 parent 30d63707

Use project with namespace in email subject

app/mailers/notify.rb
@@ -154,6 +154,6 @@ class Notify < ActionMailer::Base @@ -154,6 +154,6 @@ class Notify < ActionMailer::Base
154 # >> subject('Lorem ipsum', 'Dolor sit amet') 154 # >> subject('Lorem ipsum', 'Dolor sit amet')
155 # => "GitLab | Lorem ipsum | Dolor sit amet" 155 # => "GitLab | Lorem ipsum | Dolor sit amet"
156 def subject(*extra) 156 def subject(*extra)
157 - "GitLab | " << extra.join(' | ') << (@project ? " | #{@project.name}" : "") 157 + "GitLab | " << extra.join(' | ') << (@project ? " | #{@project.name_with_namespace}" : "")
158 end 158 end
159 end 159 end
lib/gitlab/graph/json_builder.rb
@@ -17,14 +17,14 @@ module Gitlab @@ -17,14 +17,14 @@ module Gitlab
17 @commits = collect_commits 17 @commits = collect_commits
18 @days = index_commits 18 @days = index_commits
19 end 19 end
20 - 20 +
21 def to_json(*args) 21 def to_json(*args)
22 { 22 {
23 days: @days.compact.map { |d| [d.day, d.strftime("%b")] }, 23 days: @days.compact.map { |d| [d.day, d.strftime("%b")] },
24 commits: @commits.map(&:to_graph_hash) 24 commits: @commits.map(&:to_graph_hash)
25 }.to_json(*args) 25 }.to_json(*args)
26 end 26 end
27 - 27 +
28 protected 28 protected
29 29
30 # Get commits from repository 30 # Get commits from repository
lib/tasks/gitlab/backup.rake
@@ -118,10 +118,10 @@ namespace :gitlab do @@ -118,10 +118,10 @@ namespace :gitlab do
118 task :create => :environment do 118 task :create => :environment do
119 backup_path_repo = File.join(Gitlab.config.backup.path, "repositories") 119 backup_path_repo = File.join(Gitlab.config.backup.path, "repositories")
120 FileUtils.mkdir_p(backup_path_repo) until Dir.exists?(backup_path_repo) 120 FileUtils.mkdir_p(backup_path_repo) until Dir.exists?(backup_path_repo)
121 - puts "Dumping repositories ..." 121 + puts "Dumping repositories ...".blue
122 122
123 Project.find_each(:batch_size => 1000) do |project| 123 Project.find_each(:batch_size => 1000) do |project|
124 - print "#{project.path_with_namespace} ... " 124 + print " * #{project.path_with_namespace} ... "
125 125
126 if project.empty_repo? 126 if project.empty_repo?
127 puts "[SKIPPED]".cyan 127 puts "[SKIPPED]".cyan
@@ -174,9 +174,9 @@ namespace :gitlab do @@ -174,9 +174,9 @@ namespace :gitlab do
174 backup_path_db = File.join(Gitlab.config.backup.path, "db") 174 backup_path_db = File.join(Gitlab.config.backup.path, "db")
175 FileUtils.mkdir_p(backup_path_db) unless Dir.exists?(backup_path_db) 175 FileUtils.mkdir_p(backup_path_db) unless Dir.exists?(backup_path_db)
176 176
177 - puts "Dumping database tables ... " 177 + puts "Dumping database tables ... ".blue
178 ActiveRecord::Base.connection.tables.each do |tbl| 178 ActiveRecord::Base.connection.tables.each do |tbl|
179 - print "#{tbl.yellow} ... " 179 + print " * #{tbl.yellow} ... "
180 count = 1 180 count = 1
181 File.open(File.join(backup_path_db, tbl + ".yml"), "w+") do |file| 181 File.open(File.join(backup_path_db, tbl + ".yml"), "w+") do |file|
182 ActiveRecord::Base.connection.select_all("SELECT * FROM `#{tbl}`").each do |line| 182 ActiveRecord::Base.connection.select_all("SELECT * FROM `#{tbl}`").each do |line|