summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG2
-rw-r--r--app/assets/javascripts/api.js.coffee2
-rw-r--r--app/models/key.rb2
-rw-r--r--app/models/project.rb2
-rw-r--r--app/views/projects/issues/_issue.html.haml2
-rw-r--r--db/migrate/20130611210815_increase_snippet_text_column_size.rb9
-rw-r--r--doc/api/projects.md22
-rw-r--r--lib/api/entities.rb2
-rw-r--r--lib/api/projects.rb22
-rw-r--r--lib/backup/database.rb2
-rw-r--r--lib/gitlab/backend/grack_helpers.rb2
-rw-r--r--lib/tasks/gitlab/import.rake2
12 files changed, 43 insertions, 28 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 57f37d36a47..833c9f7a6a4 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -24,7 +24,7 @@ v 5.4.0
- Fixed nav for empty repos
- GitLab Markdown help page
- Misspelling fixes
- - Added suppoort of unicorn and fog gems
+ - Added support of unicorn and fog gems
- Added client list to API doc
v 5.3.0
diff --git a/app/assets/javascripts/api.js.coffee b/app/assets/javascripts/api.js.coffee
index 7cac971f247..db80e7b0f3c 100644
--- a/app/assets/javascripts/api.js.coffee
+++ b/app/assets/javascripts/api.js.coffee
@@ -50,5 +50,5 @@
callback(users)
buildUrl: (url) ->
- url = gon.relative_url_root + url if gon.relative_url_root.present?
+ url = gon.relative_url_root + url if gon.relative_url_root?
return url.replace(':version', gon.api_version)
diff --git a/app/models/key.rb b/app/models/key.rb
index 0f2fc45abc9..11c01242b15 100644
--- a/app/models/key.rb
+++ b/app/models/key.rb
@@ -24,7 +24,7 @@ class Key < ActiveRecord::Base
before_validation :strip_white_space
validates :title, presence: true, length: { within: 0..255 }
- validates :key, presence: true, length: { within: 0..5000 }, format: { with: /\Assh-.*\Z/ }, uniqueness: true
+ validates :key, presence: true, length: { within: 0..5000 }, format: { with: /\A(ssh|ecdsa)-.*\Z/ }, uniqueness: true
validate :fingerprintable_key
delegate :name, :email, to: :user, prefix: true
diff --git a/app/models/project.rb b/app/models/project.rb
index 4beba83df2c..8297c11ba8a 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -88,7 +88,7 @@ class Project < ActiveRecord::Base
validates_uniqueness_of :path, scope: :namespace_id
validates :import_url,
- format: { with: URI::regexp(%w(http https)), message: "should be a valid url" },
+ format: { with: URI::regexp(%w(git http https)), message: "should be a valid url" },
if: :import?
validate :check_limit
diff --git a/app/views/projects/issues/_issue.html.haml b/app/views/projects/issues/_issue.html.haml
index f44c0a6c81f..0f3c4f752eb 100644
--- a/app/views/projects/issues/_issue.html.haml
+++ b/app/views/projects/issues/_issue.html.haml
@@ -18,7 +18,7 @@
%span
%i.icon-comments
= issue.notes.count
- - if issue.milestone_id?
+ - if issue.milestone
%span
%i.icon-time
= issue.milestone.title
diff --git a/db/migrate/20130611210815_increase_snippet_text_column_size.rb b/db/migrate/20130611210815_increase_snippet_text_column_size.rb
new file mode 100644
index 00000000000..f7b4447e43e
--- /dev/null
+++ b/db/migrate/20130611210815_increase_snippet_text_column_size.rb
@@ -0,0 +1,9 @@
+class IncreaseSnippetTextColumnSize < ActiveRecord::Migration
+ def up
+ # MYSQL LARGETEXT for snippet
+ change_column :snippets, :content, :text, :limit => 4294967295
+ end
+
+ def down
+ end
+end
diff --git a/doc/api/projects.md b/doc/api/projects.md
index 41b6b6add39..b3e4ec0214e 100644
--- a/doc/api/projects.md
+++ b/doc/api/projects.md
@@ -53,6 +53,7 @@ GET /projects
"merge_requests_enabled": true,
"wall_enabled": true,
"wiki_enabled": true,
+ "snippets_enabled": true,
"created_at": "2012-05-30T12:49:20Z",
"last_activity_at": "2012-05-23T08:05:02Z"
}
@@ -95,6 +96,7 @@ Parameters:
"merge_requests_enabled": true,
"wall_enabled": true,
"wiki_enabled": true,
+ "snippets_enabled": true,
"created_at": "2012-05-30T12:49:20Z",
"last_activity_at": "2012-05-23T08:05:02Z"
}
@@ -182,10 +184,11 @@ Parameters:
+ `name` (required) - new project name
+ `description` (optional) - short project description
+ `default_branch` (optional) - 'master' by default
-+ `issues_enabled` (optional) - enabled by default
-+ `wall_enabled` (optional) - enabled by default
-+ `merge_requests_enabled` (optional) - enabled by default
-+ `wiki_enabled` (optional) - enabled by default
++ `issues_enabled` (optional)
++ `wall_enabled` (optional)
++ `merge_requests_enabled` (optional)
++ `wiki_enabled` (optional)
++ `snippets_enabled` (optional)
**Project access levels**
@@ -213,10 +216,11 @@ Parameters:
+ `name` (required) - new project name
+ `description` (optional) - short project description
+ `default_branch` (optional) - 'master' by default
-+ `issues_enabled` (optional) - enabled by default
-+ `wall_enabled` (optional) - enabled by default
-+ `merge_requests_enabled` (optional) - enabled by default
-+ `wiki_enabled` (optional) - enabled by default
++ `issues_enabled` (optional)
++ `wall_enabled` (optional)
++ `merge_requests_enabled` (optional)
++ `wiki_enabled` (optional)
++ `snippets_enabled` (optional)
@@ -477,4 +481,4 @@ DELETE /projects/:id/fork
Parameter:
-+ `id` (required) - The ID of the project \ No newline at end of file
++ `id` (required) - The ID of the project
diff --git a/lib/api/entities.rb b/lib/api/entities.rb
index 7fcc7eba9d2..f31050b008d 100644
--- a/lib/api/entities.rb
+++ b/lib/api/entities.rb
@@ -36,7 +36,7 @@ module API
expose :owner, using: Entities::UserBasic
expose :name, :name_with_namespace
expose :path, :path_with_namespace
- expose :issues_enabled, :merge_requests_enabled, :wall_enabled, :wiki_enabled, :created_at, :last_activity_at
+ expose :issues_enabled, :merge_requests_enabled, :wall_enabled, :wiki_enabled, :snippets_enabled, :created_at, :last_activity_at
expose :namespace
expose :forked_from_project, using: Entities::ForkedFromProject, :if => lambda{ | project, options | project.forked? }
end
diff --git a/lib/api/projects.rb b/lib/api/projects.rb
index d5709f5cb59..eb8a814be5d 100644
--- a/lib/api/projects.rb
+++ b/lib/api/projects.rb
@@ -61,10 +61,11 @@ module API
# name (required) - name for new project
# description (optional) - short project description
# default_branch (optional) - 'master' by default
- # issues_enabled (optional) - enabled by default
- # wall_enabled (optional) - enabled by default
- # merge_requests_enabled (optional) - enabled by default
- # wiki_enabled (optional) - enabled by default
+ # issues_enabled (optional)
+ # wall_enabled (optional)
+ # merge_requests_enabled (optional)
+ # wiki_enabled (optional)
+ # snippets_enabled (optional)
# namespace_id (optional) - defaults to user namespace
# Example Request
# POST /projects
@@ -77,6 +78,7 @@ module API
:wall_enabled,
:merge_requests_enabled,
:wiki_enabled,
+ :snippets_enabled,
:namespace_id]
@project = ::Projects::CreateContext.new(current_user, attrs).execute
if @project.saved?
@@ -96,10 +98,11 @@ module API
# name (required) - name for new project
# description (optional) - short project description
# default_branch (optional) - 'master' by default
- # issues_enabled (optional) - enabled by default
- # wall_enabled (optional) - enabled by default
- # merge_requests_enabled (optional) - enabled by default
- # wiki_enabled (optional) - enabled by default
+ # issues_enabled (optional)
+ # wall_enabled (optional)
+ # merge_requests_enabled (optional)
+ # wiki_enabled (optional)
+ # snippets_enabled (optional)
# Example Request
# POST /projects/user/:user_id
post "user/:user_id" do
@@ -111,7 +114,8 @@ module API
:issues_enabled,
:wall_enabled,
:merge_requests_enabled,
- :wiki_enabled]
+ :wiki_enabled,
+ :snippets_enabled]
@project = ::Projects::CreateContext.new(user, attrs).execute
if @project.saved?
present @project, with: Entities::Project
diff --git a/lib/backup/database.rb b/lib/backup/database.rb
index 2c43ed4f6e0..c4fb2e2e159 100644
--- a/lib/backup/database.rb
+++ b/lib/backup/database.rb
@@ -26,7 +26,7 @@ module Backup
system("mysql #{mysql_args} #{config['database']} < #{db_file_name}")
when "postgresql" then
pg_env
- system("pg_restore #{config['database']} #{db_file_name}")
+ system("psql #{config['database']} -f #{db_file_name}")
end
end
diff --git a/lib/gitlab/backend/grack_helpers.rb b/lib/gitlab/backend/grack_helpers.rb
index 88b2d167312..5ac9e9f325b 100644
--- a/lib/gitlab/backend/grack_helpers.rb
+++ b/lib/gitlab/backend/grack_helpers.rb
@@ -3,7 +3,7 @@ module Grack
def project_by_path(path)
if m = /^\/([\w\.\/-]+)\.git/.match(path).to_a
path_with_namespace = m.last
- path_with_namespace.gsub!(/.wiki$/, '')
+ path_with_namespace.gsub!(/\.wiki$/, '')
Project.find_with_namespace(path_with_namespace)
end
diff --git a/lib/tasks/gitlab/import.rake b/lib/tasks/gitlab/import.rake
index c11284e3d78..2fd7d017db8 100644
--- a/lib/tasks/gitlab/import.rake
+++ b/lib/tasks/gitlab/import.rake
@@ -29,8 +29,6 @@ namespace :gitlab do
# Skip if group or user
next if namespaces.include?(name)
- next if name == 'gitolite-admin'
-
puts "Processing #{repo_path}".yellow
project = Project.find_with_namespace(path)