fix build failure

(https://travis-ci.org/gitlabhq/gitlabhq/builds/3593153)
Show only ≤16 lines of code in a discussion (fix issue #2860).
Migrations for convertion merge_status added
Database schema updated
State machine added for merge_status field
class.self methods moved to scopes
human_merge_status replaced by human_merge_status_name
Distorted lines in `diff`

Distorted lines in `diff` when viewing files `windows-style-line-separator: \r\n`
Fix issue edit button showup
Merge pull request #2889 from kennytm/master

Show only ≤16 lines of codes in a discussion in a MR (issue #2860).
Merge branch 'state-machine-stage-2' of https://github.com/Undev/gitlabhq into Undev-state-machine-stage-2

Conflicts:
	app/models/merge_request.rb
Fix automerge detection client-side since #3056
Merge branch 'Undev-state-machine-stage-2'
email validation added
remove unused code related to gitolite
remove tests for unexisting methods
update grape to 0.3.1 for ruby 2.0 support.

add grape-entity, that is split from grape 0.3.0.
remove usage of deprecated error_format, that is removed in grape 0.2.3.
specs for Gitlab::Popen
specs for api/internal
Fix TestHookContext