summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CONTRIBUTING.md54
-rw-r--r--Gemfile3
-rw-r--r--Gemfile.lock13
-rw-r--r--README.md59
-rw-r--r--app/assets/javascripts/main.js.coffee8
-rw-r--r--app/assets/stylesheets/common.scss28
-rw-r--r--app/assets/stylesheets/gitlab_bootstrap/typography.scss9
-rw-r--r--app/assets/stylesheets/sections/login.scss4
-rw-r--r--app/controllers/merge_requests_controller.rb16
-rw-r--r--app/models/ability.rb1
-rw-r--r--app/models/merge_request.rb9
-rw-r--r--app/observers/activity_observer.rb14
-rw-r--r--app/services/git_push_service.rb4
-rw-r--r--app/services/project_transfer_service.rb2
-rw-r--r--app/views/layouts/_flash.html.haml11
-rw-r--r--app/views/layouts/admin.html.haml2
-rw-r--r--app/views/layouts/application.html.haml2
-rw-r--r--app/views/layouts/devise.html.haml4
-rw-r--r--app/views/layouts/errors.html.haml2
-rw-r--r--app/views/layouts/group.html.haml2
-rw-r--r--app/views/layouts/profile.html.haml2
-rw-r--r--app/views/layouts/project_resource.html.haml2
-rw-r--r--app/views/layouts/user_team.html.haml2
-rw-r--r--app/views/merge_requests/show/_mr_accept.html.haml6
-rw-r--r--app/views/notify/issue_status_changed_email.text.erb4
-rw-r--r--app/views/notify/new_issue_email.text.erb4
-rw-r--r--app/views/notify/new_merge_request_email.text.erb9
-rw-r--r--app/views/notify/new_user_email.text.erb8
-rw-r--r--app/views/notify/note_commit_email.text.erb9
-rw-r--r--app/views/notify/note_issue_email.text.erb9
-rw-r--r--app/views/notify/note_merge_request_email.text.erb9
-rw-r--r--app/views/notify/note_wall_email.text.erb9
-rw-r--r--app/views/notify/project_access_granted_email.text.erb4
-rw-r--r--app/views/notify/project_was_moved_email.text.erb8
-rw-r--r--app/views/notify/reassigned_issue_email.text.erb7
-rw-r--r--app/views/notify/reassigned_merge_request_email.text.erb7
-rw-r--r--db/migrate/20130218141258_convert_closed_to_state_in_issue.rb6
-rw-r--r--db/migrate/20130218141327_convert_closed_to_state_in_merge_request.rb6
-rw-r--r--db/migrate/20130218141344_convert_closed_to_state_in_milestone.rb6
-rw-r--r--doc/install/installation.md10
-rw-r--r--features/steps/project/project_merge_requests.rb34
-rw-r--r--lib/api.rb1
-rw-r--r--lib/api/projects.rb2
-rw-r--r--lib/tasks/sidekiq.rake10
44 files changed, 288 insertions, 133 deletions
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 00304dd3d64..005837f2ca9 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -1,26 +1,56 @@
-# Contact & support
+# Contribute to GitLab
-If you want quick help, head over to our [Support Forum](https://groups.google.com/forum/#!forum/gitlabhq).
-Otherwise you can follow our [Issue Submission Guide](https://github.com/gitlabhq/gitlabhq/wiki/Issue-Submission-Guide) for a more systematic and thorough guide to solving your issues.
+If you have a question or want to contribute to GitLab this guide show you the appropriate channel to use.
+## Ruling out common errors
+Some errors are common and it may so happen, that you are not the only one who stumbled over a particular issue. We have [collected several of those and documented quick solutions](https://github.com/gitlabhq/gitlab-public-wiki/wiki/Trouble-Shooting-Guide) for them.
-# Contribute to GitLab
+## Support forum
+
+Please visit our [Support Forum](https://groups.google.com/forum/#!forum/gitlabhq) for any kind of question regarding the usage or adiministration/configuration of GitLab.
-## Recipes
+### Use the support forum if ...
-We collect user submitted installation scripts and config file templates for platforms we don't support officially.
-We believe there is merit in allowing a certain amount of diversity.
-You can get and submit your solution to running/configuring GitLab with your favorite OS/distro, database, web server, cloud hoster, configuration management tool, etc.
+* You get permission denied errors
+* You can't see your repos
+* You have issues cloning, pulling or pushing
+* You have issues with web_hooks not firing
-Help us improve the collection of [GitLab Recipes](https://github.com/gitlabhq/gitlab-recipes/)
+**Search** for similar issues before posting your own, there's a good chance somebody else had the same issue you have now and had it resolved.
+## Paid support
+
+Community support in the [Support Forum](https://groups.google.com/forum/#!forum/gitlabhq) is done by volunteers. Paid support is available from [GitLab.com](http://blog.gitlab.com/services/)
## Feature suggestions
-Follow the [Issue Submission Guide](https://github.com/gitlabhq/gitlabhq/wiki/Issue-Submission-Guide) and support other peoples ideas or propose your own.
+Feature suggestions don't belong in issues but can go to [Feedback forum](http://gitlab.uservoice.com/forums/176466-general) where they can be voted on.
+
+## Pull requests
+
+Code speaks louder than words. If you can please submit a pull request with the fix including tests. Starting point would be the [Developer Guide](https://github.com/gitlabhq/gitlabhq/wiki/Developer-Guide)
+
+## Submitting via GitHub's issue tracker
+
+* For obvious bugs or misbehavior in GitLab in the master branch. Please include the revision id and a reproducible test case.
+* For problematic or insufficient documentation. Please include a suggestion to improve it.
+
+If you're unsure where to post, post it to the [Support Forum](https://groups.google.com/forum/#!forum/gitlabhq) first.
+There are a lot of helpful GitLab users there who may be able to help you quickly.
+If your particular issue turns out to be a bug, it will find its way from there to the [issue tracker on GitHub](https://github.com/gitlabhq/gitlabhq/issues).
+
+### When submitting an issue
+
+**Search** for similar entries before submitting your own, there's a good chance somebody else had the same issue or idea. Show your support with `:+1:` and/or join the discussion.
+
+Please consider the following points when submitting an **issue**:
+* Summarize your issue in one sentence (what happened wrong, when you did/expected something else)
+* Describe your issue in detail (including steps to reproduce)
+* Add logs or screen shots when possible
+* Describe your setup (use relevant parts from `sudo -u gitlab -H bundle exec rake gitlab:env:info`)
-## Code
+## Thank you!
-Follow our [Developer Guide](https://github.com/gitlabhq/gitlabhq/wiki/Developer-Guide) to set you up for hacking on GitLab.
+By taking the time to use the right channel, you help the development team to organize and prioritize issues and suggestions in order to make GitLab a better product for us all.
diff --git a/Gemfile b/Gemfile
index 9c8467b1733..723cfd8b058 100644
--- a/Gemfile
+++ b/Gemfile
@@ -39,7 +39,8 @@ gem "pygments.rb", git: "https://github.com/gitlabhq/pygments.rb.git", branch:
gem "github-linguist", "~> 2.3.4" , require: "linguist"
# API
-gem "grape", "~> 0.2.1"
+gem "grape", "~> 0.3.1"
+gem "grape-entity", "~> 0.2.0"
# Format dates and times
# based on human-friendly examples
diff --git a/Gemfile.lock b/Gemfile.lock
index 65fd6f363fb..9ee413d4738 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -94,7 +94,8 @@ GEM
better_errors (0.3.2)
coderay (>= 1.0.0)
erubis (>= 2.7.0)
- binding_of_caller (0.6.8)
+ binding_of_caller (0.7.1)
+ debug_inspector (>= 0.0.1)
bootstrap-sass (2.2.1.1)
sass (~> 3.2)
builder (3.0.4)
@@ -132,6 +133,7 @@ GEM
connection_pool (1.0.0)
crack (0.3.1)
daemons (1.1.9)
+ debug_inspector (0.0.2)
devise (2.1.2)
bcrypt-ruby (~> 3.0)
orm_adapter (~> 0.1)
@@ -185,17 +187,19 @@ GEM
rubyntlm (~> 0.1.1)
gitlab_yaml_db (1.0.0)
gon (4.0.2)
+ grape (0.3.1)
actionpack (>= 2.3.0)
- json
- grape (0.2.2)
activesupport
+ grape-entity (~> 0.2.0)
hashie (~> 1.2)
+ json
multi_json (>= 1.3.2)
multi_xml
rack
rack-accept
rack-mount
virtus
+ grape-entity (0.2.0)
growl (1.0.3)
guard (1.5.4)
listen (>= 0.4.2)
@@ -488,7 +492,8 @@ DEPENDENCIES
gitlab_yaml_db (= 1.0.0)
gon
grack!
- grape (~> 0.2.1)
+ grape (~> 0.3.1)
+ grape-entity (~> 0.2.0)
grit!
grit_ext!
growl
diff --git a/README.md b/README.md
index ee029f9bfcb..b8ae9d38456 100644
--- a/README.md
+++ b/README.md
@@ -1,45 +1,52 @@
-# Welcome to GitLab [![build status](https://secure.travis-ci.org/gitlabhq/gitlabhq.png)](https://travis-ci.org/gitlabhq/gitlabhq) [![build status](https://secure.travis-ci.org/gitlabhq/grit.png)](https://travis-ci.org/gitlabhq/grit) [![Code Climate](https://codeclimate.com/badge.png)](https://codeclimate.com/github/gitlabhq/gitlabhq) [![Dependency Status](https://gemnasium.com/gitlabhq/gitlabhq.png)](https://gemnasium.com/gitlabhq/gitlabhq)
+## GitLab is a self hosted Git management software.
-GitLab is a free project and repository management application
+Check out [gitlab.org](http://gitlab.org)
-[![CI](http://ci.gitlab.org/projects/1/status?ref=master)](http://ci.gitlab.org/projects/1?ref=master)
+![logo](https://raw.github.com/gitlabhq/gitlabhq/master/public/gitlab_logo.png)
-## Application details
+With GitLab you can:
+ * create projects and repositories
+ * manage repositories access
+ * do code review
-* based on Ruby on Rails
+- - -
+
+### Code status:
+
+* master: travis-ci.org
+ [![build status](https://secure.travis-ci.org/gitlabhq/gitlabhq.png)](https://travis-ci.org/gitlabhq/gitlabhq)
+
+* master: ci.gitlab.org
+ [![CI](http://ci.gitlab.org/projects/1/status?ref=master)](http://ci.gitlab.org/projects/1?ref=master)
+
+* [![Code Climate](https://codeclimate.com/badge.png)](https://codeclimate.com/github/gitlabhq/gitlabhq)
+* [![Dependency Status](https://gemnasium.com/gitlabhq/gitlabhq.png)](https://gemnasium.com/gitlabhq/gitlabhq)
+
+### Application details
+
+* powered by Ruby on Rails
+* its completely free and open source
* distributed under the MIT License
-* works with gitolite
-## Requirements
+### Requirements
* Ubuntu/Debian
* ruby 1.9.3+
* MySQL
* git
-* gitolite
+* gitlab-shell
* redis
-## Install
-
-Checkout wiki pages for installation information, migration, etc.
-
-## Community
-
-[Google Group](https://groups.google.com/group/gitlabhq)
-
-## Contacts
+More details are in the [requirements doc](https://github.com/gitlabhq/gitlabhq/blob/master/doc/install/requirements.md)
-Twitter:
+### Install
- * @gitlabhq
- * @dzaporozhets
+Checkout [wiki](https://github.com/gitlabhq/gitlabhq/wiki) pages for installation information, migration, etc.
-Email
+### [Community](http://gitlab.org/community/)
- * m@gitlabhq.com
+### [Contact](http://gitlab.org/contact/)
-## Contribute
+### [Contributing Guide](https://github.com/gitlabhq/gitlabhq/blob/master/CONTRIBUTING.md)
-[Developer Guide](https://github.com/gitlabhq/gitlabhq/wiki/Developer-Guide)
-Want to help - send a pull request.
-We'll accept good pull requests.
+### [Developer Guide](https://github.com/gitlabhq/gitlabhq/wiki/Developer-Guide)
diff --git a/app/assets/javascripts/main.js.coffee b/app/assets/javascripts/main.js.coffee
index d789f54a4e6..d707657d4bf 100644
--- a/app/assets/javascripts/main.js.coffee
+++ b/app/assets/javascripts/main.js.coffee
@@ -54,10 +54,10 @@ $ ->
$(@).parents('form').submit()
# Flash
- if (flash = $("#flash-container")).length > 0
- flash.click -> $(@).slideUp("slow")
- flash.slideDown "slow"
- setTimeout (-> flash.slideUp("slow")), 3000
+ if (flash = $(".flash-container")).length > 0
+ flash.click -> $(@).fadeOut()
+ flash.show()
+ setTimeout (-> flash.fadeOut()), 3000
# Disable form buttons while a form is submitting
$('body').on 'ajax:complete, ajax:beforeSend, submit', 'form', (e) ->
diff --git a/app/assets/stylesheets/common.scss b/app/assets/stylesheets/common.scss
index 7ac8c2dd91c..ead27922cc4 100644
--- a/app/assets/stylesheets/common.scss
+++ b/app/assets/stylesheets/common.scss
@@ -67,27 +67,17 @@ table a code {
}
/** FLASH message **/
-#flash-container {
- height: 50px;
- position: fixed;
- z-index: 10001;
- top: 0px;
- width: 100%;
- margin-bottom: 15px;
- overflow: hidden;
- background: white;
- cursor: pointer;
- border-bottom: 1px solid #ccc;
- text-align: center;
+.flash-container {
display: none;
+ .alert {
+ cursor: pointer;
+ margin: 0;
+ text-align: center;
+ border-radius: 0;
- h4 {
- color: #666;
- font-size: 18px;
- line-height: 38px;
- padding-top: 5px;
- margin: 2px;
- font-weight: normal;
+ span {
+ font-size: 14px;
+ }
}
}
diff --git a/app/assets/stylesheets/gitlab_bootstrap/typography.scss b/app/assets/stylesheets/gitlab_bootstrap/typography.scss
index 781577c2147..2f7b1d25a45 100644
--- a/app/assets/stylesheets/gitlab_bootstrap/typography.scss
+++ b/app/assets/stylesheets/gitlab_bootstrap/typography.scss
@@ -88,13 +88,14 @@ a:focus {
*/
.wiki {
font-size: 13px;
+ line-height: 20px;
code { padding: 0 4px; }
p { font-size: 13px; }
- h1 { font-size: 32px; line-height: 40px; margin: 10px 0;}
- h2 { font-size: 26px; line-height: 40px; margin: 10px 0;}
- h3 { font-size: 22px; line-height: 40px; margin: 10px 0;}
- h4 { font-size: 18px; line-height: 20px; margin: 10px 0;}
+ h1 { font-size: 26px; line-height: 40px; margin: 10px 0;}
+ h2 { font-size: 22px; line-height: 40px; margin: 10px 0;}
+ h3 { font-size: 18px; line-height: 40px; margin: 10px 0;}
+ h4 { font-size: 16px; line-height: 20px; margin: 10px 0;}
h5 { font-size: 14px; line-height: 20px; margin: 10px 0;}
h6 { font-size: 12px; line-height: 20px; margin: 10px 0;}
.white .highlight pre { background: #f5f5f5; }
diff --git a/app/assets/stylesheets/sections/login.scss b/app/assets/stylesheets/sections/login.scss
index 89b8f1c0055..e3fe0b436c3 100644
--- a/app/assets/stylesheets/sections/login.scss
+++ b/app/assets/stylesheets/sections/login.scss
@@ -1,7 +1,7 @@
/* Login Page */
body.login-page{
- padding-top: 7%;
- background: #666;
+ background: #EEE;
+ .container .content { padding-top: 5%; }
}
.login-box{
diff --git a/app/controllers/merge_requests_controller.rb b/app/controllers/merge_requests_controller.rb
index 67f96178335..c8fe2e6bfe8 100644
--- a/app/controllers/merge_requests_controller.rb
+++ b/app/controllers/merge_requests_controller.rb
@@ -81,7 +81,8 @@ class MergeRequestsController < ProjectResourceController
end
def automerge
- return access_denied! unless can?(current_user, :accept_mr, @project)
+ return access_denied! unless allowed_to_merge?
+
if @merge_request.opened? && @merge_request.can_be_merged?
@merge_request.should_remove_source_branch = params[:should_remove_source_branch]
@merge_request.automerge!(current_user)
@@ -143,5 +144,18 @@ class MergeRequestsController < ProjectResourceController
# or from cache if already merged
@commits = @merge_request.commits
@commits = CommitDecorator.decorate(@commits)
+
+ @allowed_to_merge = allowed_to_merge?
+ @show_merge_controls = @merge_request.opened? && @commits.any? && @allowed_to_merge
+ end
+
+ def allowed_to_merge?
+ action = if project.protected_branch?(@merge_request.target_branch)
+ :push_code_to_protected_branches
+ else
+ :push_code
+ end
+
+ can?(current_user, action, @project)
end
end
diff --git a/app/models/ability.rb b/app/models/ability.rb
index 6fda2e52c7c..41f7127403c 100644
--- a/app/models/ability.rb
+++ b/app/models/ability.rb
@@ -91,7 +91,6 @@ class Ability
:admin_team_member,
:admin_merge_request,
:admin_note,
- :accept_mr,
:admin_wiki,
:admin_project
]
diff --git a/app/models/merge_request.rb b/app/models/merge_request.rb
index 12a6dd2d7b2..c26d40c5703 100644
--- a/app/models/merge_request.rb
+++ b/app/models/merge_request.rb
@@ -177,15 +177,8 @@ class MergeRequest < ActiveRecord::Base
end
def merge!(user_id)
+ self.author_id_of_changes = user_id
self.merge
-
- Event.create(
- project: self.project,
- action: Event::MERGED,
- target_id: self.id,
- target_type: "MergeRequest",
- author_id: user_id
- )
end
def automerge!(current_user)
diff --git a/app/observers/activity_observer.rb b/app/observers/activity_observer.rb
index 919a50f00c8..152e497794b 100644
--- a/app/observers/activity_observer.rb
+++ b/app/observers/activity_observer.rb
@@ -39,4 +39,18 @@ class ActivityObserver < ActiveRecord::Observer
author_id: record.author_id_of_changes
)
end
+
+ def after_merge(record, transition)
+ # Since MR can be merged via sidekiq
+ # to prevent event duplication do this check
+ return true if record.merge_event
+
+ Event.create(
+ project: record.project,
+ target_id: record.id,
+ target_type: record.class.name,
+ action: Event::MERGED,
+ author_id: record.author_id_of_changes
+ )
+ end
end
diff --git a/app/services/git_push_service.rb b/app/services/git_push_service.rb
index 40d57c67573..208ccf699d2 100644
--- a/app/services/git_push_service.rb
+++ b/app/services/git_push_service.rb
@@ -19,6 +19,8 @@ class GitPushService
# Collect data for this git push
@push_data = post_receive_data(oldrev, newrev, ref)
+ create_push_event
+
project.ensure_satellite_exists
project.discover_default_branch
@@ -27,8 +29,6 @@ class GitPushService
project.execute_hooks(@push_data.dup)
project.execute_services(@push_data.dup)
end
-
- create_push_event
end
# This method provide a sample data
diff --git a/app/services/project_transfer_service.rb b/app/services/project_transfer_service.rb
index f91a3cd1992..35d9517ad29 100644
--- a/app/services/project_transfer_service.rb
+++ b/app/services/project_transfer_service.rb
@@ -25,7 +25,7 @@ class ProjectTransferService
Gitlab::ProjectMover.new(project, old_dir, new_dir).execute
- save!
+ project.save!
end
rescue Gitlab::ProjectMover::ProjectMoveError => ex
raise Project::TransferError.new(ex.message)
diff --git a/app/views/layouts/_flash.html.haml b/app/views/layouts/_flash.html.haml
index 9961ce8dd34..a3bed593e1c 100644
--- a/app/views/layouts/_flash.html.haml
+++ b/app/views/layouts/_flash.html.haml
@@ -1,3 +1,8 @@
-- if text = alert || notice
- #flash-container
- %h4= text
+.flash-container
+ - if alert
+ .alert
+ %span= alert
+
+ - elsif notice
+ .alert.alert-info
+ %span= notice
diff --git a/app/views/layouts/admin.html.haml b/app/views/layouts/admin.html.haml
index a01886cdabf..00a08e6131d 100644
--- a/app/views/layouts/admin.html.haml
+++ b/app/views/layouts/admin.html.haml
@@ -2,8 +2,8 @@
%html{ lang: "en"}
= render "layouts/head", title: "Admin area"
%body{class: "#{app_theme} admin"}
- = render "layouts/flash"
= render "layouts/head_panel", title: "Admin area"
+ = render "layouts/flash"
.container
%ul.main_menu
= nav_link(controller: :dashboard, html_options: {class: 'home'}) do
diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml
index 7ee44238d10..90c2653438d 100644
--- a/app/views/layouts/application.html.haml
+++ b/app/views/layouts/application.html.haml
@@ -2,8 +2,8 @@
%html{ lang: "en"}
= render "layouts/head", title: "Dashboard"
%body{class: "#{app_theme} application"}
- = render "layouts/flash"
= render "layouts/head_panel", title: "Dashboard"
+ = render "layouts/flash"
.container
%ul.main_menu
= nav_link(path: 'dashboard#show', html_options: {class: 'home'}) do
diff --git a/app/views/layouts/devise.html.haml b/app/views/layouts/devise.html.haml
index 36c6b4c6c35..a9758f19d36 100644
--- a/app/views/layouts/devise.html.haml
+++ b/app/views/layouts/devise.html.haml
@@ -3,4 +3,6 @@
= render "layouts/head"
%body.ui_basic.login-page
= render "layouts/flash"
- .container= yield
+ .container
+ .content
+ = yield
diff --git a/app/views/layouts/errors.html.haml b/app/views/layouts/errors.html.haml
index 3554d88f10c..b9395873c33 100644
--- a/app/views/layouts/errors.html.haml
+++ b/app/views/layouts/errors.html.haml
@@ -2,8 +2,8 @@
%html{ lang: "en"}
= render "layouts/head", title: "Error"
%body{class: "#{app_theme} application"}
- = render "layouts/flash"
= render "layouts/head_panel", title: ""
+ = render "layouts/flash"
.container
.content
%center.padded.prepend-top-20
diff --git a/app/views/layouts/group.html.haml b/app/views/layouts/group.html.haml
index 9057ad50ce6..2c144de49b3 100644
--- a/app/views/layouts/group.html.haml
+++ b/app/views/layouts/group.html.haml
@@ -2,8 +2,8 @@
%html{ lang: "en"}
= render "layouts/head", title: "#{@group.name}"
%body{class: "#{app_theme} application"}
- = render "layouts/flash"
= render "layouts/head_panel", title: "group: #{@group.name}"
+ = render "layouts/flash"
.container
%ul.main_menu
= nav_link(path: 'groups#show', html_options: {class: 'home'}) do
diff --git a/app/views/layouts/profile.html.haml b/app/views/layouts/profile.html.haml
index 57f250c775b..611063e8c99 100644
--- a/app/views/layouts/profile.html.haml
+++ b/app/views/layouts/profile.html.haml
@@ -2,8 +2,8 @@
%html{ lang: "en"}
= render "layouts/head", title: "Profile"
%body{class: "#{app_theme} profile"}
- = render "layouts/flash"
= render "layouts/head_panel", title: "Profile"
+ = render "layouts/flash"
.container
%ul.main_menu
= nav_link(path: 'profiles#show', html_options: {class: 'home'}) do
diff --git a/app/views/layouts/project_resource.html.haml b/app/views/layouts/project_resource.html.haml
index 55abe8ab5f1..37d0f16fa20 100644
--- a/app/views/layouts/project_resource.html.haml
+++ b/app/views/layouts/project_resource.html.haml
@@ -2,8 +2,8 @@
%html{ lang: "en"}
= render "layouts/head", title: @project.name_with_namespace
%body{class: "#{app_theme} project"}
- = render "layouts/flash"
= render "layouts/head_panel", title: project_title(@project)
+ = render "layouts/flash"
- if can?(current_user, :download_code, @project)
= render 'shared/no_ssh'
diff --git a/app/views/layouts/user_team.html.haml b/app/views/layouts/user_team.html.haml
index 19bbc373f46..e5e08aab13c 100644
--- a/app/views/layouts/user_team.html.haml
+++ b/app/views/layouts/user_team.html.haml
@@ -2,8 +2,8 @@
%html{ lang: "en"}
= render "layouts/head", title: "#{@team.name}"
%body{class: "#{app_theme} application"}
- = render "layouts/flash"
= render "layouts/head_panel", title: "team: #{@team.name}"
+ = render "layouts/flash"
.container
%ul.main_menu
= nav_link(path: 'teams#show', html_options: {class: 'home'}) do
diff --git a/app/views/merge_requests/show/_mr_accept.html.haml b/app/views/merge_requests/show/_mr_accept.html.haml
index 64f25a5118c..d4271c5551f 100644
--- a/app/views/merge_requests/show/_mr_accept.html.haml
+++ b/app/views/merge_requests/show/_mr_accept.html.haml
@@ -1,9 +1,9 @@
-- unless can?(current_user, :accept_mr, @project)
+- unless @allowed_to_merge
.alert
- %strong Only masters can accept MR
+ %strong You don't have enough permissions to merge this MR
-- if @merge_request.opened? && @commits.any? && can?(current_user, :accept_mr, @project)
+- if @show_merge_controls
.automerge_widget.can_be_merged{style: "display:none"}
.alert.alert-success
%span
diff --git a/app/views/notify/issue_status_changed_email.text.erb b/app/views/notify/issue_status_changed_email.text.erb
new file mode 100644
index 00000000000..bbca3474d50
--- /dev/null
+++ b/app/views/notify/issue_status_changed_email.text.erb
@@ -0,0 +1,4 @@
+Issue was <%= @issue_status %> by <%= @updated_by.name %>
+
+Issue <%= @issue.id %>: <%= url_for(project_issue_url(@issue.project, @issue)) %>
+
diff --git a/app/views/notify/new_issue_email.text.erb b/app/views/notify/new_issue_email.text.erb
new file mode 100644
index 00000000000..5ed55c35b23
--- /dev/null
+++ b/app/views/notify/new_issue_email.text.erb
@@ -0,0 +1,4 @@
+New Issue was created and assigned to you.
+
+
+Issue <%= @issue.id %>: <%= url_for(project_issue_url(@issue.project, @issue)) %>
diff --git a/app/views/notify/new_merge_request_email.text.erb b/app/views/notify/new_merge_request_email.text.erb
new file mode 100644
index 00000000000..3393d8384f1
--- /dev/null
+++ b/app/views/notify/new_merge_request_email.text.erb
@@ -0,0 +1,9 @@
+New Merge Request <%= @merge_request.id %>
+
+<%= url_for(project_merge_request_url(@merge_request.project, @merge_request)) %>
+
+
+Branches: <%= @merge_request.source_branch %> to <%= @merge_request.target_branch %>
+Author: <%= @merge_request.author_name %>
+Asignee: <%= @merge_request.assignee_name %>
+
diff --git a/app/views/notify/new_user_email.text.erb b/app/views/notify/new_user_email.text.erb
new file mode 100644
index 00000000000..794d5a2c3e8
--- /dev/null
+++ b/app/views/notify/new_user_email.text.erb
@@ -0,0 +1,8 @@
+Hi <%= @user.name %>!
+
+Administrator created account for you. Now you are a member of company GitLab application.
+
+login.................. <%= @user.email %>
+password............... <%= @password %>
+
+Click here to login: <%= url_for(root_url) %>
diff --git a/app/views/notify/note_commit_email.text.erb b/app/views/notify/note_commit_email.text.erb
new file mode 100644
index 00000000000..aab8e5cfb6c
--- /dev/null
+++ b/app/views/notify/note_commit_email.text.erb
@@ -0,0 +1,9 @@
+New comment for Commit <%= @commit.short_id %>
+
+<%= url_for(project_commit_url(@note.project, id: @commit.id, anchor: "note_#{@note.id}")) %>
+
+
+Author: <%= @note.author_name %>
+
+<%= @note.note %>
+
diff --git a/app/views/notify/note_issue_email.text.erb b/app/views/notify/note_issue_email.text.erb
new file mode 100644
index 00000000000..a476b286ae4
--- /dev/null
+++ b/app/views/notify/note_issue_email.text.erb
@@ -0,0 +1,9 @@
+New comment for Issue <%= @issue.id %>
+
+<%= url_for(project_issue_url(@issue.project, @issue, anchor: "note_#{@note.id}")) %>
+
+
+Author: <%= @note.author_name %>
+
+<%= @note.note %>
+
diff --git a/app/views/notify/note_merge_request_email.text.erb b/app/views/notify/note_merge_request_email.text.erb
new file mode 100644
index 00000000000..26c73bdaa38
--- /dev/null
+++ b/app/views/notify/note_merge_request_email.text.erb
@@ -0,0 +1,9 @@
+New comment for Merge Request <%= @merge_request.id %>
+
+<%= url_for(project_merge_request_url(@merge_request.project, @merge_request, anchor: "note_#{@note.id}")) %>
+
+
+<%= @note.author_name %>
+
+<%= @note.note %>
+
diff --git a/app/views/notify/note_wall_email.text.erb b/app/views/notify/note_wall_email.text.erb
new file mode 100644
index 00000000000..ea1b7efbe84
--- /dev/null
+++ b/app/views/notify/note_wall_email.text.erb
@@ -0,0 +1,9 @@
+New message on the project wall <%= @note.project %>
+
+<%= url_for(wall_project_url(@note.project, anchor: "note_#{@note.id}")) %>
+
+
+<%= @note.author_name %>
+
+<%= @note.note %>
+
diff --git a/app/views/notify/project_access_granted_email.text.erb b/app/views/notify/project_access_granted_email.text.erb
new file mode 100644
index 00000000000..077c3b8a7de
--- /dev/null
+++ b/app/views/notify/project_access_granted_email.text.erb
@@ -0,0 +1,4 @@
+
+You have been granted <%= @users_project.project_access_human %> access to project <%= @project.name_with_namespace %>
+
+<%= url_for(project_url(@project)) %>
diff --git a/app/views/notify/project_was_moved_email.text.erb b/app/views/notify/project_was_moved_email.text.erb
new file mode 100644
index 00000000000..da123c2f89c
--- /dev/null
+++ b/app/views/notify/project_was_moved_email.text.erb
@@ -0,0 +1,8 @@
+Project was moved to another location
+
+The project is now located under
+<%= url_for(link_to project_url(@project)) %>
+
+
+To update the remote url in your local repository run:
+ git remote set-url origin <%= @project.ssh_url_to_repo %>
diff --git a/app/views/notify/reassigned_issue_email.text.erb b/app/views/notify/reassigned_issue_email.text.erb
new file mode 100644
index 00000000000..497044184dc
--- /dev/null
+++ b/app/views/notify/reassigned_issue_email.text.erb
@@ -0,0 +1,7 @@
+Reassigned Issue <%= @issue.id %>
+
+<%= url_for(project_issue_url(@issue.project, @issue)) %>
+
+
+Assignee changed from <%= @previous_assignee.name %> to <%= @issue.assignee_name %>
+
diff --git a/app/views/notify/reassigned_merge_request_email.text.erb b/app/views/notify/reassigned_merge_request_email.text.erb
new file mode 100644
index 00000000000..1af4ab559f6
--- /dev/null
+++ b/app/views/notify/reassigned_merge_request_email.text.erb
@@ -0,0 +1,7 @@
+Reassigned Merge Request <%= @merge_request.id %>
+
+<%= url_for(project_merge_request_url(@merge_request.project, @merge_request)) %>
+
+
+Assignee changed from <%= @previous_assignee.name %> to <%= @merge_request.assignee_name %>
+
diff --git a/db/migrate/20130218141258_convert_closed_to_state_in_issue.rb b/db/migrate/20130218141258_convert_closed_to_state_in_issue.rb
index 0614a5c0064..9fa96203ffd 100644
--- a/db/migrate/20130218141258_convert_closed_to_state_in_issue.rb
+++ b/db/migrate/20130218141258_convert_closed_to_state_in_issue.rb
@@ -1,14 +1,14 @@
class ConvertClosedToStateInIssue < ActiveRecord::Migration
def up
Issue.transaction do
- Issue.where(closed: true).update_all("state = 'closed'")
- Issue.where(closed: false).update_all("state = 'opened'")
+ Issue.where(closed: true).update_all(state: :closed)
+ Issue.where(closed: false).update_all(state: :opened)
end
end
def down
Issue.transaction do
- Issue.where(state: :closed).update_all("closed = 1")
+ Issue.where(state: :closed).update_all(closed: true)
end
end
end
diff --git a/db/migrate/20130218141327_convert_closed_to_state_in_merge_request.rb b/db/migrate/20130218141327_convert_closed_to_state_in_merge_request.rb
index 5e7477d84e1..ebb7ae585e6 100644
--- a/db/migrate/20130218141327_convert_closed_to_state_in_merge_request.rb
+++ b/db/migrate/20130218141327_convert_closed_to_state_in_merge_request.rb
@@ -1,9 +1,9 @@
class ConvertClosedToStateInMergeRequest < ActiveRecord::Migration
def up
MergeRequest.transaction do
- MergeRequest.where(closed: true, merged: true).update_all("state = 'merged'")
- MergeRequest.where(closed: true, merged: true).update_all("state = 'closed'")
- MergeRequest.where(closed: false).update_all("state = 'opened'")
+ MergeRequest.where(closed: true, merged: true).update_all(state: :merged)
+ MergeRequest.where(closed: true, merged: false).update_all(state: :closed)
+ MergeRequest.where(closed: false).update_all(state: :opened)
end
end
diff --git a/db/migrate/20130218141344_convert_closed_to_state_in_milestone.rb b/db/migrate/20130218141344_convert_closed_to_state_in_milestone.rb
index 78096666393..1978ea89153 100644
--- a/db/migrate/20130218141344_convert_closed_to_state_in_milestone.rb
+++ b/db/migrate/20130218141344_convert_closed_to_state_in_milestone.rb
@@ -1,14 +1,14 @@
class ConvertClosedToStateInMilestone < ActiveRecord::Migration
def up
Milestone.transaction do
- Milestone.where(closed: false).update_all("state = 'opened'")
- Milestone.where(closed: false).update_all("state = 'active'")
+ Milestone.where(closed: true).update_all(state: :closed)
+ Milestone.where(closed: false).update_all(state: :active)
end
end
def down
Milestone.transaction do
- Milestone.where(state: :closed).update_all("closed = 1")
+ Milestone.where(state: :closed).update_all(closed: true)
end
end
end
diff --git a/doc/install/installation.md b/doc/install/installation.md
index 4d2ab63b2e9..2de6bab97c1 100644
--- a/doc/install/installation.md
+++ b/doc/install/installation.md
@@ -92,8 +92,11 @@ Create a `git` user for Gitlab:
sudo adduser --disabled-login --gecos 'GitLab' git
+
# 4. GitLab shell
+GitLab Shell is a ssh access and repository management software developed specially for GitLab.
+
# Login as git
sudo su git
@@ -103,9 +106,14 @@ Create a `git` user for Gitlab:
# Clone gitlab shell
git clone https://github.com/gitlabhq/gitlab-shell.git
- # Setup
cd gitlab-shell
cp config.yml.example config.yml
+
+ # Edit config and replace gitlab_url
+ # with something like 'http://domain.com/'
+ vim config.yml
+
+ # Do setup
./bin/install
diff --git a/features/steps/project/project_merge_requests.rb b/features/steps/project/project_merge_requests.rb
index ff95a47d4cf..09ce6b720d7 100644
--- a/features/steps/project/project_merge_requests.rb
+++ b/features/steps/project/project_merge_requests.rb
@@ -25,8 +25,8 @@ class ProjectMergeRequests < Spinach::FeatureSteps
end
Then 'I should see closed merge request "Bug NS-04"' do
- mr = MergeRequest.find_by_title("Bug NS-04")
- mr.closed?.should be_true
+ merge_request = MergeRequest.find_by_title!("Bug NS-04")
+ merge_request.closed?.should be_true
page.should have_content "Closed by"
end
@@ -63,7 +63,6 @@ class ProjectMergeRequests < Spinach::FeatureSteps
end
And 'project "Shop" have "Bug NS-04" open merge request' do
- project = Project.find_by_name("Shop")
create(:merge_request,
title: "Bug NS-04",
project: project,
@@ -71,7 +70,6 @@ class ProjectMergeRequests < Spinach::FeatureSteps
end
And 'project "Shop" have "Bug NS-05" open merge request with diffs inside' do
- project = Project.find_by_name("Shop")
create(:merge_request_with_diffs,
title: "Bug NS-05",
project: project,
@@ -79,7 +77,6 @@ class ProjectMergeRequests < Spinach::FeatureSteps
end
And 'project "Shop" have "Feature NS-03" closed merge request' do
- project = Project.find_by_name("Shop")
create(:closed_merge_request,
title: "Feature NS-03",
project: project,
@@ -87,18 +84,16 @@ class ProjectMergeRequests < Spinach::FeatureSteps
end
And 'I switch to the diff tab' do
- mr = MergeRequest.find_by_title("Bug NS-05")
- visit diffs_project_merge_request_path(mr.project, mr)
+ visit diffs_project_merge_request_path(merge_request.project, merge_request)
end
And 'I switch to the merge request\'s comments tab' do
- mr = MergeRequest.find_by_title("Bug NS-05")
- visit project_merge_request_path(mr.project, mr)
+ visit project_merge_request_path(merge_request.project, merge_request)
end
And 'I click on the first commit in the merge request' do
- mr = MergeRequest.find_by_title("Bug NS-05")
- click_link mr.commits.first.short_id(8)
+
+ click_link merge_request.commits.first.short_id(8)
end
And 'I leave a comment on the diff page' do
@@ -121,8 +116,7 @@ class ProjectMergeRequests < Spinach::FeatureSteps
end
Then 'I should see a discussion has started on line 185' do
- mr = MergeRequest.find_by_title("Bug NS-05")
- first_commit = mr.commits.first
+ first_commit = merge_request.commits.first
first_diff = first_commit.diffs.first
page.should have_content "#{current_user.name} started a discussion on this merge request diff"
page.should have_content "#{first_diff.b_path}:L185"
@@ -130,8 +124,7 @@ class ProjectMergeRequests < Spinach::FeatureSteps
end
Then 'I should see a discussion has started on commit bcf03b5de6c:L185' do
- mr = MergeRequest.find_by_title("Bug NS-05")
- first_commit = mr.commits.first
+ first_commit = merge_request.commits.first
first_diff = first_commit.diffs.first
page.should have_content "#{current_user.name} started a discussion on commit"
page.should have_content first_commit.short_id(8)
@@ -140,12 +133,19 @@ class ProjectMergeRequests < Spinach::FeatureSteps
end
Then 'I should see a discussion has started on commit bcf03b5de6c' do
- mr = MergeRequest.find_by_title("Bug NS-05")
- first_commit = mr.st_commits.first
+ first_commit = merge_request.st_commits.first
first_diff = first_commit.diffs.first
page.should have_content "#{current_user.name} started a discussion on commit bcf03b5de6c"
page.should have_content first_commit.short_id(8)
page.should have_content "One comment to rule them all"
page.should have_content "#{first_diff.b_path}:L185"
end
+
+ def project
+ @project ||= Project.find_by_name!("Shop")
+ end
+
+ def merge_request
+ @merge_request ||= MergeRequest.find_by_title!("Bug NS-05")
+ end
end
diff --git a/lib/api.rb b/lib/api.rb
index d9dce7c70cc..da31a1519dd 100644
--- a/lib/api.rb
+++ b/lib/api.rb
@@ -9,7 +9,6 @@ module Gitlab
end
format :json
- error_format :json
helpers APIHelpers
mount Groups
diff --git a/lib/api/projects.rb b/lib/api/projects.rb
index 631ed535459..c4d9cd96960 100644
--- a/lib/api/projects.rb
+++ b/lib/api/projects.rb
@@ -292,7 +292,7 @@ module Gitlab
authorize! :download_code, user_project
page = params[:page] || 0
- per_page = params[:per_page] || 20
+ per_page = (params[:per_page] || 20).to_i
ref = params[:ref_name] || user_project.try(:default_branch) || 'master'
commits = user_project.repository.commits(ref, nil, per_page, page * per_page)
diff --git a/lib/tasks/sidekiq.rake b/lib/tasks/sidekiq.rake
index cf99951e027..d0e9dfe46a1 100644
--- a/lib/tasks/sidekiq.rake
+++ b/lib/tasks/sidekiq.rake
@@ -1,19 +1,19 @@
namespace :sidekiq do
desc "GITLAB | Stop sidekiq"
task :stop do
- run "bundle exec sidekiqctl stop #{pidfile}"
+ system "bundle exec sidekiqctl stop #{pidfile}"
end
desc "GITLAB | Start sidekiq"
task :start do
- run "nohup bundle exec sidekiq -q post_receive,mailer,system_hook,project_web_hook,gitlab_shell,common,default -e #{Rails.env} -P #{pidfile} >> #{Rails.root.join("log", "sidekiq.log")} 2>&1 &"
+ system "nohup bundle exec sidekiq -q post_receive,mailer,system_hook,project_web_hook,gitlab_shell,common,default -e #{Rails.env} -P #{pidfile} >> #{Rails.root.join("log", "sidekiq.log")} 2>&1 &"
end
-
+
desc "GITLAB | Start sidekiq with launchd on Mac OS X"
task :launchd do
- run "bundle exec sidekiq -q post_receive,mailer,system_hook,project_web_hook,gitlab_shell,common,default -e #{Rails.env} -P #{pidfile} >> #{Rails.root.join("log", "sidekiq.log")} 2>&1"
+ system "bundle exec sidekiq -q post_receive,mailer,system_hook,project_web_hook,gitlab_shell,common,default -e #{Rails.env} -P #{pidfile} >> #{Rails.root.join("log", "sidekiq.log")} 2>&1"
end
-
+
def pidfile
Rails.root.join("tmp", "pids", "sidekiq.pid")
end