Commit 270bc4bd authored by Valery Sizov's avatar Valery Sizov

Merge remote-tracking branch 'origin/master' into ce_upstream

parents ed4b49b8 7c809985
......@@ -91,7 +91,7 @@ class Dispatcher
new TreeView()
when 'projects:find_file:show'
shortcut_handler = true
when 'projects:blob:show'
when 'projects:blob:show', 'projects:blame:show'
new LineHighlighter()
shortcut_handler = new ShortcutsNavigation()
when 'projects:labels:new', 'projects:labels:edit'
......
......@@ -146,6 +146,7 @@ class @MergeRequestTabs
success: (data) =>
document.querySelector("div#diffs").innerHTML = data.html
$('div#diffs .js-syntax-highlight').syntaxHighlight()
@expandViewContainer() if @diffViewType() is 'parallel'
@diffsLoaded = true
@scrollToElement("#diffs")
......@@ -177,3 +178,10 @@ class @MergeRequestTabs
options = $.extend({}, defaults, options)
$.ajax(options)
# Returns diff view type
diffViewType: ->
$('.inline-parallel-buttons a.active').data('view-type')
expandViewContainer: ->
$('.container-fluid').removeClass('container-limited')
......@@ -386,7 +386,6 @@ table {
}
.project-item-select-holder {
display: inline-block;
position: relative;
.project-item-select {
......
......@@ -77,6 +77,7 @@ header {
line-height: $header-height;
font-weight: normal;
color: #4c4e54;
overflow: hidden;
text-overflow: ellipsis;
vertical-align: top;
white-space: nowrap;
......
......@@ -44,8 +44,10 @@
white-space: nowrap;
i {
float: left;
margin-top: 3px;
margin-right: 5px;
visibility: hidden;
@extend .pull-left;
}
&:hover i {
......
......@@ -6,31 +6,28 @@
.status-box {
@include border-radius(3px);
display: block;
float: left;
padding: 0 $gl-btn-padding;
font-weight: normal;
margin-top: 5px;
margin-right: 10px;
color: #FFF;
font-size: $gl-font-size;
line-height: 25px;
&.status-box-closed {
background-color: $gl-danger;
color: #FFF;
}
&.status-box-merged {
background-color: $gl-primary;
color: #FFF;
}
&.status-box-open {
background-color: $green-light;
color: #FFF;
}
&.status-box-expired {
background: #cea61b;
color: #FFF;
}
}
......@@ -64,7 +64,6 @@
// This prevents the mess when resizing the sidebar
// of elements repositioning themselves..
width: $gutter_inner_width;
overflow-x: hidden;
// --
&:first-child {
......@@ -90,7 +89,6 @@
.gutter-toggle {
margin-left: 20px;
border-left: 1px solid $border-gray-light;
padding-left: 10px;
&:hover {
......@@ -157,11 +155,10 @@
.right-sidebar {
position: fixed;
top: 58px;
bottom: 0;
right: 0;
height: 100%;
transition-duration: .3s;
transition: width .3s;
background: $gray-light;
overflow: scroll;
padding: 10px 20px;
&.right-sidebar-expanded {
......@@ -170,6 +167,14 @@
hr {
display: none;
}
.sidebar-collapsed-icon {
display: none;
}
.gutter-toggle {
border-left: 1px solid $border-gray-light;
}
}
.subscribe-button {
......@@ -181,7 +186,6 @@
&.right-sidebar-collapsed {
width: $sidebar_collapsed_width;
padding-top: 0;
overflow-x: hidden;
hr {
margin: 0;
......@@ -192,21 +196,13 @@
}
.block {
border-bottom: none;
width: $sidebar_collapsed_width - 1px;
margin-left: -19px;
padding: 15px 0 0 0;
border-bottom: none;
overflow: hidden;
}
}
.btn {
background: $gray-normal;
border: 1px solid $border-gray-normal;
&:hover {
background: $gray-dark;
border: 1px solid $border-gray-dark;
}
}
&.right-sidebar-collapsed {
.issuable-count,
.issuable-nav,
.assignee > *,
......@@ -219,15 +215,13 @@
}
.gutter-toggle {
margin-left: -$gutter_inner_width + 4;
margin-left: -36px;
}
.sidebar-collapsed-icon {
display: block;
float: left;
width: 62px;
width: 100%;
text-align: center;
margin-left: -19px;
padding-bottom: 10px;
color: #999999;
......@@ -247,14 +241,15 @@
color: #999999;
}
}
}
}
&.right-sidebar-expanded {
.sidebar-collapsed-icon {
display: none;
.btn {
background: $gray-normal;
border: 1px solid $border-gray-normal;
&:hover {
background: $gray-dark;
border: 1px solid $border-gray-dark;
}
}
}
......@@ -263,4 +258,4 @@
small {
color: $gray-darkest;
}
}
\ No newline at end of file
}
......@@ -130,7 +130,7 @@ module CommitsHelper
if can_collaborate_with_project?
content_tag :span, 'data-toggle' => 'modal', 'data-target' => '#modal-revert-commit' do
link_to 'Revert', '#modal-revert-commit', 'data-toggle' => 'tooltip', title: tooltip, class: "btn btn-default btn-grouped btn-#{btn_class}"
link_to 'Revert', '#modal-revert-commit', 'data-toggle' => 'tooltip', 'data-container' => 'body', title: tooltip, class: "btn btn-default btn-grouped btn-#{btn_class}"
end
elsif can?(current_user, :fork_project, @project)
continue_params = {
......@@ -142,7 +142,7 @@ module CommitsHelper
namespace_key: current_user.namespace.id,
continue: continue_params)
link_to 'Revert', fork_path, class: 'btn btn-grouped btn-close', method: :post, 'data-toggle' => 'tooltip', title: tooltip
link_to 'Revert', fork_path, class: 'btn btn-grouped btn-close', method: :post, 'data-toggle' => 'tooltip', 'data-container' => 'body', title: tooltip
end
end
......
......@@ -137,7 +137,7 @@ module DiffHelper
# Always use HTML to handle case where JSON diff rendered this button
params_copy.delete(:format)
link_to url_for(params_copy), id: "#{name}-diff-btn", class: (selected ? 'btn active' : 'btn') do
link_to url_for(params_copy), id: "#{name}-diff-btn", class: (selected ? 'btn active' : 'btn'), data: { view_type: name } do
title
end
end
......
......@@ -23,6 +23,7 @@ module NavHelper
if current_path?('merge_requests#show') ||
current_path?('merge_requests#diffs') ||
current_path?('merge_requests#commits') ||
current_path?('merge_requests#builds') ||
current_path?('issues#show')
if cookies[:collapsed_gutter] == 'true'
"page-gutter right-sidebar-collapsed"
......
......@@ -232,7 +232,7 @@ class Commit
end
def reverts_commit?(commit)
description.include?(commit.revert_description)
description? && description.include?(commit.revert_description)
end
def merge_commit?
......
......@@ -24,10 +24,14 @@ module MergeRequests
merge_requests.each do |merge_request|
next unless merge_request.merge_when_build_succeeds?
next unless merge_request.mergeable?
if merge_request.ci_commit && merge_request.ci_commit.success? && merge_request.mergeable?
MergeWorker.perform_async(merge_request.id, merge_request.merge_user_id, merge_request.merge_params)
end
ci_commit = merge_request.ci_commit
next unless ci_commit
next unless ci_commit.sha == commit_status.sha
next unless ci_commit.success?
MergeWorker.perform_async(merge_request.id, merge_request.merge_user_id, merge_request.merge_params)
end
end
......@@ -51,6 +55,8 @@ module MergeRequests
# This is for ref-less builds
branches ||= @project.repository.branch_names_contains(commit_status.sha)
return [] if branches.blank?
merge_requests = @project.origin_merge_requests.opened.where(source_branch: branches).to_a
merge_requests += @project.fork_merge_requests.opened.where(source_branch: branches).to_a
......
......@@ -44,6 +44,7 @@
= favicon_link_tag 'touch-icon-ipad.png', rel: 'apple-touch-icon', sizes: '76x76'
= favicon_link_tag 'touch-icon-iphone-retina.png', rel: 'apple-touch-icon', sizes: '120x120'
= favicon_link_tag 'touch-icon-ipad-retina.png', rel: 'apple-touch-icon', sizes: '152x152'
%link{rel: 'mask-icon', href: image_path('logo.svg'), color: 'rgb(226, 67, 41)'}
-# Windows 8 pinned site tile
%meta{name: 'msapplication-TileImage', content: image_path('msapplication-tile.png')}
......
......@@ -3,7 +3,7 @@
%h3.page-title Blame view
#tree-holder.tree-holder
#blob-content-holder.tree-holder
.file-holder
.file-title
= blob_icon @blob.mode, @blob.name
......@@ -33,7 +33,9 @@
%td.line-numbers
- line_count = blame_group[:lines].count
- (current_line...(current_line + line_count)).each do |i|
%a.diff-line-num= i
%a.diff-line-num{href: "#L#{i}", id: "L#{i}", 'data-line-number' => i}
= icon("link")
= i
\
- current_line += line_count
%td.lines
......
......@@ -39,6 +39,9 @@
%span
= icon('star')
= project.star_count
%span.visibility-icon.has_tooltip{data: { container: 'body', placement: 'left' },
title: "#{visibility_level_label(project.visibility_level)} - #{project_visibility_level_description(project.visibility_level)}"}
= visibility_level_icon(project.visibility_level, fw: false)
- if show_last_commit_as_description
.project-description
= link_to_gfm project.commit.title, namespace_project_commit_path(project.namespace, project, project.commit),
......
......@@ -169,6 +169,7 @@ Settings.omniauth['auto_sign_in_with_provider'] = false if Settings.omniauth['au
Settings.omniauth['allow_single_sign_on'] = false if Settings.omniauth['allow_single_sign_on'].nil?
Settings.omniauth['block_auto_created_users'] = true if Settings.omniauth['block_auto_created_users'].nil?
Settings.omniauth['auto_link_ldap_user'] = false if Settings.omniauth['auto_link_ldap_user'].nil?
Settings.omniauth['auto_link_saml_user'] = false if Settings.omniauth['auto_link_saml_user'].nil?
Settings.omniauth['providers'] ||= []
Settings.omniauth['cas3'] ||= Settingslogic.new({})
......
......@@ -257,6 +257,8 @@ Example of response
## Get build artifacts
> [Introduced][ce-2893] in GitLab 8.5
Get build artifacts of a project
```
......@@ -279,6 +281,8 @@ Response:
| 200 | Serves the artifacts file |
| 404 | Build not found or no artifacts |
[ce-2893]: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/2893
## Cancel a build
Cancel a single build of a project
......
# Runners API
> [Introduced][ce-2640] in GitLab 8.5
[ce-2640]: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/2640
## List owned runners
Get a list of specific runners available to the user.
......
......@@ -124,7 +124,7 @@ In GitLab, Runners run the builds that you define in `.gitlab-ci.yml`.
A Runner can be a virtual machine, a VPS, a bare-metal machine, a docker
container or even a cluster of containers. GitLab and the Runners communicate
through an API, so the only needed requirement is that the machine on which the
Runner is configured to has Internet access.
Runner is configured to have Internet access.
A Runner can be specific to a certain project or serve multiple projects in
GitLab. If it serves all projects it's called a _Shared Runner_.
......
......@@ -67,8 +67,8 @@ You need at least 2GB of addressable memory (RAM + swap) to install and use GitL
With less memory GitLab will give strange errors during the reconfigure run and 500 errors during usage.
- 512MB RAM + 1.5GB of swap is the absolute minimum but we strongly **advise against** this amount of memory. See the unicorn worker section below for more advice.
- 1GB RAM + 1GB swap supports up to 100 users but it will be slow
- **2GB RAM** is the **recommended** memory size and supports up to 100 users
- 1GB RAM + 1GB swap supports up to 100 users but it will be very slow
- **2GB RAM** is the **recommended** memory size for all installations and supports up to 100 users
- 4GB RAM supports up to 1,000 users
- 8GB RAM supports up to 2,000 users
- 16GB RAM supports up to 4,000 users
......
......@@ -16,7 +16,7 @@ It offers a simple, transparent and effective way to work with git.
![Four stages (working copy, index, local repo, remote repo) and three steps between them](four_stages.png)
When converting to git you have to get used to the fact that there are three steps before a commit is shared with colleagues.
Most version control systems have only step, committing from the working copy to a shared server.
Most version control systems have only one step, committing from the working copy to a shared server.
In git you add files from the working copy to the staging area. After that you commit them to the local repo.
The third step is pushing to a shared remote repository.
After getting used to these three steps the branching model becomes the challenge.
......
......@@ -118,4 +118,38 @@ eos
it { expect(data[:modified]).to eq([".gitmodules"]) }
it { expect(data[:removed]).to eq([]) }
end
describe '#reverts_commit?' do
let(:another_commit) { double(:commit, revert_description: "This reverts commit #{commit.sha}") }
it { expect(commit.reverts_commit?(another_commit)).to be_falsy }
context 'commit has no description' do
before { allow(commit).to receive(:description?).and_return(false) }
it { expect(commit.reverts_commit?(another_commit)).to be_falsy }
end
context "another_commit's description does not revert commit" do
before { allow(commit).to receive(:description).and_return("Foo Bar") }
it { expect(commit.reverts_commit?(another_commit)).to be_falsy }
end
context "another_commit's description reverts commit" do
before { allow(commit).to receive(:description).and_return("Foo #{another_commit.revert_description} Bar") }
it { expect(commit.reverts_commit?(another_commit)).to be_truthy }
end
context "another_commit's description reverts merged merge request" do
before do
revert_description = "This reverts merge request !foo123"
allow(another_commit).to receive(:revert_description).and_return(revert_description)
allow(commit).to receive(:description).and_return("Foo #{another_commit.revert_description} Bar")
end
it { expect(commit.reverts_commit?(another_commit)).to be_truthy }
end
end
end
......@@ -66,9 +66,25 @@ describe MergeRequests::MergeWhenBuildSucceedsService do
end
end
context 'triggered by an old build' do
let(:old_build) { create(:ci_build, ref: mr_merge_if_green_enabled.source_branch, status: "success") }
let(:build) { create(:ci_build, ref: mr_merge_if_green_enabled.source_branch, status: "success") }
it "merges all merge requests with merge when build succeeds enabled" do
allow_any_instance_of(MergeRequest).to receive(:ci_commit).and_return(ci_commit)
allow(ci_commit).to receive(:success?).and_return(true)
allow(old_build).to receive(:sha).and_return('1234abcdef')
expect(MergeWorker).to_not receive(:perform_async)
service.trigger(old_build)
end
end
context 'commit status without ref' do
let(:commit_status) { create(:generic_commit_status, status: 'success') }
before { mr_merge_if_green_enabled }
it "doesn't merge a requests for status on other branch" do
allow(project.repository).to receive(:branch_names_contains).with(commit_status.sha).and_return([])
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment