summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Ziebell <sebastian.ziebell@asquera.de>2013-02-27 17:52:59 +0100
committerSebastian Ziebell <sebastian.ziebell@asquera.de>2013-02-27 17:52:59 +0100
commit3bb342b961f2a02098175e24855ab56fc1785c43 (patch)
tree158cd941d1f1ca2d2427893822f6303c1ad7cfa6
parent7499f65014257989510da50505fa7c0f5a4fae88 (diff)
parent33cd1ae9dce7d8a798ca312a27eb0b4872892f05 (diff)
downloadgitlab-ce-3bb342b961f2a02098175e24855ab56fc1785c43.tar.gz
Merge branch 'master' into fixes/api
-rw-r--r--README.md34
-rw-r--r--app/models/merge_request.rb9
-rw-r--r--app/observers/activity_observer.rb14
-rw-r--r--lib/api/projects.rb2
4 files changed, 31 insertions, 28 deletions
diff --git a/README.md b/README.md
index ee029f9bfcb..e910dc958cd 100644
--- a/README.md
+++ b/README.md
@@ -1,14 +1,21 @@
-# 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)
+# Welcome to GitLab! Self hosted Git management software
+
+
+## Badges:
+
+* master: travis-ci.org [![build status](https://secure.travis-ci.org/gitlabhq/gitlabhq.png)](https://travis-ci.org/gitlabhq/gitlabhq)a
+* 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)
GitLab is a free project and repository management application
-[![CI](http://ci.gitlab.org/projects/1/status?ref=master)](http://ci.gitlab.org/projects/1?ref=master)
## Application details
-* based on Ruby on Rails
+* powered by Ruby on Rails
+* its completely free and open source
* distributed under the MIT License
-* works with gitolite
## Requirements
@@ -16,27 +23,16 @@ GitLab is a free project and repository management application
* 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
-
-Twitter:
-
- * @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
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/lib/api/projects.rb b/lib/api/projects.rb
index a65d65840b0..abd115d31b0 100644
--- a/lib/api/projects.rb
+++ b/lib/api/projects.rb
@@ -336,7 +336,7 @@ module Gitlab
authorize! :download_code, user_project
page = params[:page] || 0
- per_page = params[:per_page].to_i || 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)