Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
4a2b7cef
Commit
4a2b7cef
authored
Aug 10, 2015
by
Douwe Maan
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into check-out-branch-button
parents
b716e45d
151d9fb3
Changes
43
Hide whitespace changes
Inline
Side-by-side
Showing
43 changed files
with
320 additions
and
115 deletions
+320
-115
CHANGELOG
CHANGELOG
+3
-0
Gemfile.lock
Gemfile.lock
+2
-2
app/assets/javascripts/dropzone_input.js.coffee
app/assets/javascripts/dropzone_input.js.coffee
+8
-1
app/assets/stylesheets/generic/markdown_area.scss
app/assets/stylesheets/generic/markdown_area.scss
+9
-0
app/assets/stylesheets/pages/merge_requests.scss
app/assets/stylesheets/pages/merge_requests.scss
+4
-0
app/services/post_commit_service.rb
app/services/post_commit_service.rb
+65
-2
app/views/events/_event.html.haml
app/views/events/_event.html.haml
+1
-1
app/views/profiles/show.html.haml
app/views/profiles/show.html.haml
+2
-2
app/views/projects/merge_requests/show/_how_to_merge.html.haml
...iews/projects/merge_requests/show/_how_to_merge.html.haml
+29
-26
app/views/projects/merge_requests/widget/_closed.html.haml
app/views/projects/merge_requests/widget/_closed.html.haml
+4
-1
app/views/projects/merge_requests/widget/_heading.html.haml
app/views/projects/merge_requests/widget/_heading.html.haml
+5
-5
app/views/projects/merge_requests/widget/_locked.html.haml
app/views/projects/merge_requests/widget/_locked.html.haml
+3
-2
app/views/projects/merge_requests/widget/_merged.html.haml
app/views/projects/merge_requests/widget/_merged.html.haml
+16
-8
app/views/projects/merge_requests/widget/_open.html.haml
app/views/projects/merge_requests/widget/_open.html.haml
+1
-1
app/views/projects/merge_requests/widget/open/_accept.html.haml
...ews/projects/merge_requests/widget/open/_accept.html.haml
+3
-3
app/views/projects/merge_requests/widget/open/_archived.html.haml
...s/projects/merge_requests/widget/open/_archived.html.haml
+3
-1
app/views/projects/merge_requests/widget/open/_check.html.haml
...iews/projects/merge_requests/widget/open/_check.html.haml
+2
-2
app/views/projects/merge_requests/widget/open/_conflicts.html.haml
.../projects/merge_requests/widget/open/_conflicts.html.haml
+8
-9
app/views/projects/merge_requests/widget/open/_missing_branch.html.haml
...ects/merge_requests/widget/open/_missing_branch.html.haml
+16
-16
app/views/projects/merge_requests/widget/open/_not_allowed.html.haml
...rojects/merge_requests/widget/open/_not_allowed.html.haml
+4
-2
app/views/projects/merge_requests/widget/open/_nothing.html.haml
...ws/projects/merge_requests/widget/open/_nothing.html.haml
+7
-7
app/views/projects/merge_requests/widget/open/_reload.html.haml
...ews/projects/merge_requests/widget/open/_reload.html.haml
+6
-1
app/views/projects/merge_requests/widget/open/_wip.html.haml
app/views/projects/merge_requests/widget/open/_wip.html.haml
+4
-12
app/views/shared/issuable/_form.html.haml
app/views/shared/issuable/_form.html.haml
+2
-2
app/workers/post_receive.rb
app/workers/post_receive.rb
+1
-1
config/initializers/1_settings.rb
config/initializers/1_settings.rb
+10
-0
features/profile/profile.feature
features/profile/profile.feature
+2
-0
features/steps/profile/profile.rb
features/steps/profile/profile.rb
+4
-0
lib/gitlab/markdown/commit_range_reference_filter.rb
lib/gitlab/markdown/commit_range_reference_filter.rb
+2
-1
lib/gitlab/markdown/commit_reference_filter.rb
lib/gitlab/markdown/commit_reference_filter.rb
+2
-1
lib/gitlab/markdown/issue_reference_filter.rb
lib/gitlab/markdown/issue_reference_filter.rb
+2
-1
lib/gitlab/markdown/label_reference_filter.rb
lib/gitlab/markdown/label_reference_filter.rb
+2
-1
lib/gitlab/markdown/merge_request_reference_filter.rb
lib/gitlab/markdown/merge_request_reference_filter.rb
+2
-1
lib/gitlab/markdown/reference_filter.rb
lib/gitlab/markdown/reference_filter.rb
+16
-0
lib/gitlab/markdown/snippet_reference_filter.rb
lib/gitlab/markdown/snippet_reference_filter.rb
+2
-1
lib/gitlab/markdown/user_reference_filter.rb
lib/gitlab/markdown/user_reference_filter.rb
+4
-2
spec/lib/gitlab/markdown/commit_range_reference_filter_spec.rb
...lib/gitlab/markdown/commit_range_reference_filter_spec.rb
+8
-0
spec/lib/gitlab/markdown/commit_reference_filter_spec.rb
spec/lib/gitlab/markdown/commit_reference_filter_spec.rb
+8
-0
spec/lib/gitlab/markdown/issue_reference_filter_spec.rb
spec/lib/gitlab/markdown/issue_reference_filter_spec.rb
+8
-0
spec/lib/gitlab/markdown/label_reference_filter_spec.rb
spec/lib/gitlab/markdown/label_reference_filter_spec.rb
+8
-0
spec/lib/gitlab/markdown/merge_request_reference_filter_spec.rb
...ib/gitlab/markdown/merge_request_reference_filter_spec.rb
+8
-0
spec/lib/gitlab/markdown/snippet_reference_filter_spec.rb
spec/lib/gitlab/markdown/snippet_reference_filter_spec.rb
+8
-0
spec/lib/gitlab/markdown/user_reference_filter_spec.rb
spec/lib/gitlab/markdown/user_reference_filter_spec.rb
+16
-0
No files found.
CHANGELOG
View file @
4a2b7cef
...
...
@@ -38,12 +38,15 @@ v 7.14.0 (unreleased)
- Tweak project page buttons.
- Disabled autocapitalize and autocorrect on login field (Daryl Chan)
- Mention group and project name in creation, update and deletion notices (Achilleas Pipinellis)
- Update gravatar link on profile page to link to configured gravatar host (Ben Bodenmiller)
- Remove redis-store TTL monkey patch
- Add support for CI skipped status
- Fetch code from forks to refs/merge-requests/:id/head when merge request created
- Remove satellites
- Remove comments and email addresses when publicly exposing ssh keys (Zeger-Jan van de Weg)
- Add "Check out branch" button to the MR page.
- Improve MR merge widget text and UI consistency.
- Improve text in MR "How To Merge" modal.
- Cache all events
v 7.13.3
...
...
Gemfile.lock
View file @
4a2b7cef
...
...
@@ -154,7 +154,7 @@ GEM
doorkeeper (2.1.3)
railties (>= 3.2)
dotenv (0.9.0)
dropzonejs-rails (0.
4.14
)
dropzonejs-rails (0.
7.1
)
rails (> 3.1)
email_spec (1.6.0)
launchy (~> 2.1)
...
...
@@ -373,7 +373,7 @@ GEM
mini_portile (0.6.2)
minitest (5.3.5)
mousetrap-rails (1.4.6)
multi_json (1.11.
1
)
multi_json (1.11.
2
)
multi_xml (0.5.5)
multipart-post (1.2.0)
mysql2 (0.3.16)
...
...
app/assets/javascripts/dropzone_input.js.coffee
View file @
4a2b7cef
...
...
@@ -8,6 +8,7 @@ class @DropzoneInput
divAlert
=
"<div class=
\"
"
+
alertClass
+
"
\"
></div>"
iconPaperclip
=
"<i class=
\"
fa fa-paperclip div-dropzone-icon
\"
></i>"
iconSpinner
=
"<i class=
\"
fa fa-spinner fa-spin div-dropzone-icon
\"
></i>"
uploadProgress
=
$
(
"<div class=
\"
div-dropzone-progress
\"
></div>"
)
btnAlert
=
"<button type=
\"
button
\"
"
+
alertAttr
+
">×</button>"
project_uploads_path
=
window
.
project_uploads_path
or
null
markdown_preview_path
=
window
.
markdown_preview_path
or
null
...
...
@@ -28,6 +29,7 @@ class @DropzoneInput
form_dropzone
.
find
(
".div-dropzone-hover"
).
append
iconPaperclip
form_dropzone
.
append
divSpinner
form_dropzone
.
find
(
".div-dropzone-spinner"
).
append
iconSpinner
form_dropzone
.
find
(
".div-dropzone-spinner"
).
append
uploadProgress
form_dropzone
.
find
(
".div-dropzone-spinner"
).
css
"opacity"
:
0
"display"
:
"none"
...
...
@@ -112,13 +114,18 @@ class @DropzoneInput
$
(
".div-dropzone-alert"
).
append
btnAlert
+
errorMessage
return
totaluploadprogress
:
(
totalUploadProgress
)
->
uploadProgress
.
text
Math
.
round
(
totalUploadProgress
)
+
"%"
return
sending
:
->
form_dropzone
.
find
(
".div-dropzone-spinner"
).
css
"opacity"
:
0.7
"display"
:
"inherit"
return
complete
:
->
queuecomplete
:
->
uploadProgress
.
text
""
$
(
".dz-preview"
).
remove
()
$
(
".markdown-area"
).
trigger
"input"
$
(
".div-dropzone-spinner"
).
css
...
...
app/assets/stylesheets/generic/markdown_area.scss
View file @
4a2b7cef
...
...
@@ -40,6 +40,15 @@
font-size
:
inherit
;
}
.div-dropzone-progress
{
position
:
absolute
;
top
:
7px
;
left
:
-40px
;
width
:
35px
;
font-size
:
13px
;
text-align
:
right
;
}
.dz-preview
{
display
:
none
;
}
...
...
app/assets/stylesheets/pages/merge_requests.scss
View file @
4a2b7cef
...
...
@@ -183,6 +183,10 @@
width
:
250px
!
important
;
}
#modal_merge_info
.modal-dialog
{
width
:
600px
;
}
.mr-source-target
{
line-height
:
31px
;
}
app/services/post_commit_service.rb
View file @
4a2b7cef
class
PostCommitService
<
BaseService
include
Gitlab
::
Popen
attr_reader
:changes
,
:repo_path
def
execute
(
sha
,
branch
)
commit
=
repository
.
commit
(
sha
)
full_ref
=
'refs/heads/'
+
branch
full_ref
=
Gitlab
::
Git
::
BRANCH_REF_PREFIX
+
branch
old_sha
=
commit
.
parent_id
||
Gitlab
::
Git
::
BLANK_SHA
GitPushService
.
new
.
execute
(
project
,
current_user
,
old_sha
,
sha
,
full_ref
)
@changes
=
"
#{
old_sha
}
#{
sha
}
#{
full_ref
}
"
@repo_path
=
repository
.
path_to_repo
post_receive
end
private
def
post_receive
hook
=
hook_file
(
'post-receive'
,
repo_path
)
return
true
if
hook
.
nil?
call_receive_hook
(
hook
)
end
def
call_receive_hook
(
hook
)
# function will return true if succesful
exit_status
=
false
vars
=
{
'GL_ID'
=>
Gitlab
::
ShellEnv
.
gl_id
(
current_user
),
'PWD'
=>
repo_path
}
options
=
{
chdir:
repo_path
}
# we combine both stdout and stderr as we don't know what stream
# will be used by the custom hook
Open3
.
popen2e
(
vars
,
hook
,
options
)
do
|
stdin
,
stdout_stderr
,
wait_thr
|
exit_status
=
true
stdin
.
sync
=
true
# in git, pre- and post- receive hooks may just exit without
# reading stdin. We catch the exception to avoid a broken pipe
# warning
begin
# inject all the changes as stdin to the hook
changes
.
lines
do
|
line
|
stdin
.
puts
line
end
rescue
Errno
::
EPIPE
end
# need to close stdin before reading stdout
stdin
.
close
# only output stdut_stderr if scripts doesn't return 0
unless
wait_thr
.
value
==
0
exit_status
=
false
end
end
exit_status
end
def
hook_file
(
hook_type
,
repo_path
)
hook_path
=
File
.
join
(
repo_path
.
strip
,
'hooks'
)
hook_file
=
"
#{
hook_path
}
/
#{
hook_type
}
"
hook_file
if
File
.
exist?
(
hook_file
)
end
end
app/views/events/_event.html.haml
View file @
4a2b7cef
...
...
@@ -3,7 +3,7 @@
.event-item-timestamp
#{
time_ago_with_tooltip
(
event
.
created_at
)
}
=
cache
event
,
"v1"
do
=
cache
[
event
,
"v1"
]
do
=
image_tag
avatar_icon
(
event
.
author_email
,
24
),
class:
"avatar s24"
,
alt
:''
-
if
event
.
created_project?
=
render
"events/event/created_project"
,
event:
event
...
...
app/views/profiles/show.html.haml
View file @
4a2b7cef
...
...
@@ -82,12 +82,12 @@
You can change your avatar here
-
if
Gitlab
.
config
.
gravatar
.
enabled
%br
or remove the current avatar to revert to
#{
link_to
"gravatar.com"
,
"http://gravatar.com"
}
or remove the current avatar to revert to
#{
link_to
Gitlab
.
config
.
gravatar
.
host
,
"http://"
+
Gitlab
.
config
.
gravatar
.
host
}
-
else
You can upload an avatar here
-
if
Gitlab
.
config
.
gravatar
.
enabled
%br
or change it at
#{
link_to
"gravatar.com"
,
"http://gravatar.com"
}
or change it at
#{
link_to
Gitlab
.
config
.
gravatar
.
host
,
"http://"
+
Gitlab
.
config
.
gravatar
.
host
}
%hr
%a
.choose-btn.btn.btn-sm.js-choose-user-avatar-button
%i
.fa.fa-paperclip
...
...
app/views/projects/merge_requests/show/_how_to_merge.html.haml
View file @
4a2b7cef
...
...
@@ -3,42 +3,45 @@
.modal-content
.modal-header
%a
.close
{
href:
"#"
,
"data-dismiss"
=>
"modal"
}
×
%h3
How to merge
%h3
Check out, review and merge locally
.modal-body
-
if
@merge_request
.
for_fork?
-
source_remote
=
@merge_request
.
source_project
.
namespace
.
nil?
?
"source"
:
@merge_request
.
source_project
.
namespace
.
path
-
target_remote
=
@merge_request
.
target_project
.
namespace
.
nil?
?
"target"
:
@merge_request
.
target_project
.
namespace
.
path
%p
%strong
Step 1.
Fetch the code and create a new branch pointing to it
%pre
.dark
%p
%strong
Step 1.
Fetch and check out the branch for this merge request
%pre
.dark
-
if
@merge_request
.
for_fork?
:preserve
git fetch
#{
@merge_request
.
source_project
.
http_url_to_repo
}
#{
@merge_request
.
source_branch
}
git checkout -b
#{
@merge_request
.
source_project_path
}
-
#{
@merge_request
.
source_branch
}
FETCH_HEAD
%p
%strong
Step 2.
Merge the branch and push the changes to GitLab
%pre
.dark
:preserve
git checkout
#{
@merge_request
.
target_branch
}
git merge --no-ff
#{
@merge_request
.
source_project_path
}
-
#{
@merge_request
.
source_branch
}
git push origin
#{
@merge_request
.
target_branch
}
-
else
%p
%strong
Step 1.
Update the repo and checkout the branch we are going to merge
%pre
.dark
-
else
:preserve
git fetch origin
git checkout -b
#{
@merge_request
.
source_branch
}
origin/
#{
@merge_request
.
source_branch
}
%p
%strong
Step 2.
Merge the branch and push the changes to GitLab
%pre
.dark
%p
%strong
Step 2.
Review the changes locally
%p
%strong
Step 3.
Merge the branch and fix any conflicts that come up
%pre
.dark
-
if
@merge_request
.
for_fork?
:preserve
git checkout
#{
@merge_request
.
target_branch
}
git merge --no-ff
#{
@merge_request
.
source_project_path
}
-
#{
@merge_request
.
source_branch
}
-
else
:preserve
git checkout
#{
@merge_request
.
target_branch
}
git merge --no-ff
#{
@merge_request
.
source_branch
}
git push origin
#{
@merge_request
.
target_branch
}
%p
%strong
Step 4.
Push the result of the merge to GitLab
%pre
.dark
:preserve
git push origin
#{
@merge_request
.
target_branch
}
-
unless
@merge_request
.
can_be_merged_by?
(
current_user
)
%p
Note that pushing to GitLab requires write access to this repository.
:javascript
$
(
function
(){
...
...
app/views/projects/merge_requests/widget/_closed.html.haml
View file @
4a2b7cef
...
...
@@ -6,4 +6,7 @@
-
if
@merge_request
.
closed_event
by
#{
link_to_member
(
@project
,
@merge_request
.
closed_event
.
author
,
avatar:
true
)
}
#{
time_ago_with_tooltip
(
@merge_request
.
closed_event
.
created_at
)
}
%p
Changes were not merged into target branch
%p
=
succeed
'.'
do
The changes were not merged into
%span
.label-branch
=
@merge_request
.
target_branch
app/views/projects/merge_requests/widget/_heading.html.haml
View file @
4a2b7cef
...
...
@@ -3,26 +3,26 @@
-
[
:success
,
:skipped
,
:canceled
,
:failed
,
:running
,
:pending
].
each
do
|
status
|
.ci_widget
{
class:
"ci-#{status}"
,
style:
"display:none"
}
-
if
status
==
:success
-
status
=
"passed"
=
icon
(
"check-circle"
)
-
else
=
icon
(
"circle"
)
%span
CI build
#{
status
}
for
#{
@merge_request
.
last_commit_short_sha
}
.
%span
.ci-coverage
=
link_to
"View build
page
"
,
ci_build_details_path
(
@merge_request
),
:"data-no-turbolink"
=>
"data-no-turbolink"
=
link_to
"View build
details
"
,
ci_build_details_path
(
@merge_request
),
:"data-no-turbolink"
=>
"data-no-turbolink"
.ci_widget
=
icon
(
"spinner spin"
)
Checking
for CI status for
#{
@merge_request
.
last_commit_short_sha
}
Checking
CI status for
#{
@merge_request
.
last_commit_short_sha
}
…
.ci_widget.ci-not_found
{
style:
"display:none"
}
=
icon
(
"times-circle"
)
%span
Can not find commit in the CI server
for
#{
@merge_request
.
last_commit_short_sha
}
.
Could not find CI status for
#{
@merge_request
.
last_commit_short_sha
}
.
.ci_widget.ci-error
{
style:
"display:none"
}
=
icon
(
"times-circle"
)
%span
Can
not connect to the CI server. Please check your settings and try again.
Could
not connect to the CI server. Please check your settings and try again.
:coffeescript
$ ->
...
...
app/views/projects/merge_requests/widget/_locked.html.haml
View file @
4a2b7cef
...
...
@@ -2,7 +2,8 @@
=
render
'projects/merge_requests/widget/heading'
.mr-widget-body
%h4
Merge in progress...
=
icon
(
"spinner spin"
)
Merge in progress
…
%p
Merging is in progress. While merging this reques
t is locked and cannot be closed.
This merge request is in the process of being merged, during which time i
t is locked and cannot be closed.
app/views/projects/merge_requests/widget/_merged.html.haml
View file @
4a2b7cef
...
...
@@ -7,23 +7,31 @@
by
#{
link_to_member
(
@project
,
@merge_request
.
merge_event
.
author
,
avatar:
true
)
}
#{
time_ago_with_tooltip
(
@merge_request
.
merge_event
.
created_at
)
}
%div
-
if
@source_branch
.
blank?
Source branch has been removed
-
if
!
@merge_request
.
source_branch_exists?
=
succeed
'.'
do
The changes were merged into
%span
.label-branch
=
@merge_request
.
target_branch
The source branch has been removed.
-
elsif
can_remove_branch?
(
@merge_request
.
source_project
,
@merge_request
.
source_branch
)
&&
@merge_request
.
merged?
-
elsif
can_remove_branch?
(
@merge_request
.
source_project
,
@merge_request
.
source_branch
)
.remove_source_branch_widget
%p
Changes merged into
#{
@merge_request
.
target_branch
}
. You can remove source branch now
%p
=
succeed
'.'
do
The changes were merged into
%span
.label-branch
=
@merge_request
.
target_branch
You can remove the source branch now.
=
link_to
namespace_project_branch_path
(
@merge_request
.
source_project
.
namespace
,
@merge_request
.
source_project
,
@source_branch
),
remote:
true
,
method: :delete
,
class:
"btn btn-primary btn-sm remove_source_branch"
do
%i
.fa.fa-times
Remove Source Branch
.remove_source_branch_widget.failed.hide
Failed to remove source branch '
#{
@merge_request
.
source_branch
}
'
%p
Failed to remove source branch '
#{
@merge_request
.
source_branch
}
'.
.remove_source_branch_in_progress.hide
%
i
.fa.fa-spinner.fa-spin
Removing source branch '
#{
@merge_request
.
source_branch
}
'. Please wait. Page will be automatically reloaded.
%
p
=
icon
(
'spinner spin'
)
Removing source branch '
#{
@merge_request
.
source_branch
}
'. Please wait. This page will be automatically reload.
:coffeescript
$('.remove_source_branch').on 'click', ->
...
...
app/views/projects/merge_requests/widget/_open.html.haml
View file @
4a2b7cef
...
...
@@ -22,6 +22,6 @@
.mr-widget-footer
%span
%i
.fa.fa-check
Accepting this merge request will close
#{
@closes_issues
.
size
==
1
?
'issue'
:
'issues'
}
Accepting this merge request will close
#{
"issue"
.
pluralize
(
@closes_issues
.
size
)
}
=
succeed
'.'
do
!=
gfm
(
issues_sentence
(
@closes_issues
))
app/views/projects/merge_requests/widget/open/_accept.html.haml
View file @
4a2b7cef
...
...
@@ -8,10 +8,10 @@
.accept-control.checkbox
=
label_tag
:should_remove_source_branch
,
class:
"remove_source_checkbox"
do
=
check_box_tag
:should_remove_source_branch
Remove source
-
branch
Remove source
branch
.accept-control
=
link_to
"#"
,
class:
"modify-merge-commit-link js-toggle-button"
,
title:
"Modify merge commit message"
do
%i
.fa.fa-edit
=
link_to
"#"
,
class:
"modify-merge-commit-link js-toggle-button"
do
=
icon
(
'edit'
)
Modify commit message
.js-toggle-content.hide.prepend-top-20
=
render
'shared/commit_message_container'
,
params:
params
,
...
...
app/views/projects/merge_requests/widget/open/_archived.html.haml
View file @
4a2b7cef
%h4
Project is archived
%p
%strong
Archived projects do not provide commit access
.
This merge request cannot be merged because archived projects cannot be written to
.
app/views/projects/merge_requests/widget/open/_check.html.haml
View file @
4a2b7cef
%strong
%i
.fa.fa-spinner.fa-spin
Checking a
utomatic merge…
=
icon
(
"spinner spin"
)
Checking a
bility to merge automatically
…
:coffeescript
$ ->
...
...
app/views/projects/merge_requests/widget/open/_conflicts.html.haml
View file @
4a2b7cef
%h4
This merge request contains merge conflicts that must be resolved.
=
icon
(
"exclamation-triangle"
)
This merge request contains merge conflicts
-
if
@merge_request
.
can_be_merged_by?
(
current_user
)
%p
You can merge it manually using the
%strong
=
link_to
"command line"
,
"#modal_merge_info"
,
class:
"how_to_merge_link vlink"
,
title:
"How To Merge"
,
"data-toggle"
=>
"modal"
-
else
%p
Only those with write access to this repository can merge merge requests.
%p
Please resolve these conflicts or
-
if
@merge_request
.
can_be_merged_by?
(
current_user
)
#{
link_to
"merge this request manually"
,
"#modal_merge_info"
,
class:
"how_to_merge_link vlink"
,
"data-toggle"
=>
"modal"
}
.
-
else
ask someone with write access to this repository to merge this request manually.
app/views/projects/merge_requests/widget/open/_missing_branch.html.haml
View file @
4a2b7cef
%h4
Can't be merged
%p
This merge request can not be accepted becaus
e branch
-
unless
@merge_request
.
source_branch_exists?
%span
.label.label-inverse
=
@merge_request
.
source_branch
does not exist in
%span
.label.label-info
=
@merge_request
.
source_project_path
%br
%strong
Please close this merge request and open a new merge request to change source branches.
-
else
%span
.label.label-inverse
=
@merge_request
.
target_
branch
does not exist in
%span
.label.label-info
=
@merge_request
.
target_project_path
%br
%strong
Please close this merge request or change to another
target branch.
-
unless
@merge_request
.
source_branch_exists?
%h4
=
icon
(
"exclamation-triangle"
)
Sourc
e branch
%span
.label-branch
=
source_branch_with_namespace
(
@merge_request
)
does not exist
%p
Please restore the source branch or close this merge request and open a new merge request with a different source branch.
-
else
%h4
=
icon
(
"exclamation-triangle"
)
Target
branch
%span
.label-branch
=
@merge_request
.
target_branch
does not exist
%p
Please restore the target branch or use a different
target branch.
app/views/projects/merge_requests/widget/open/_not_allowed.html.haml
View file @
4a2b7cef
%strong
This request can be merged automatically.
Only those with write access to this repository can merge merge requests.
%h4
Ready to be merged automatically
%p
Ask someone with write access to this repository to merge this request.
app/views/projects/merge_requests/widget/open/_nothing.html.haml
View file @
4a2b7cef
%h4
Nothing to merge
%p
%h4
=
icon
(
"exclamation-triangle"
)
Nothing to merge from
%span
.label-branch
#{
@merge_request
.
source_branch
}
to
%span
.label-branch
#{
@merge_request
.
target_branch
}
%br
Try to use different branches or push new code
.
%span
.label-branch
=
source_branch_with_namespace
(
@merge_request
)
in
to
%span
.label-branch
=
@merge_request
.
target_branch
%p
Please push new commits to the source branch or use a different target branch
.
app/views/projects/merge_requests/widget/open/_reload.html.haml
View file @
4a2b7cef
This merge request cannot be merged. Try to reload the page.
%h4
=
icon
(
"exclamation-triangle"
)
This merge request failed to be merged automatically
%p
Please reload the page to find out the reason.
app/views/projects/merge_requests/widget/open/_wip.html.haml
View file @
4a2b7cef
-
if
@merge_request
.
can_be_merged_by?
(
current_user
)
%h4
This merge request cannot be accepted because it is marked as Work In Progress.
%h4
This merge request is currently a Work In Progress
%p
%button
.btn.disabled
{
:type
=>
'button'
}
%i
.fa.fa-warning
Accept Merge Request
When the merge request is ready, remove the "WIP" prefix from the title to allow it to be accepted.
-
else
%strong
This merge request is marked as Work In Progress.
Only those with write access to this repository can merge merge requests.
%p
When this merge request is ready, remove the "WIP" prefix from the title to allow it to be merged.
app/views/shared/issuable/_form.html.haml
View file @
4a2b7cef
...
...
@@ -16,10 +16,10 @@
%p
.help-block
-
if
issuable
.
work_in_progress?
Remove the
<code>
WIP
</code>
prefix from the title to allow this
<strong>
Work In Progress
</strong>
merge request to be
accept
ed when it's ready.
<strong>
Work In Progress
</strong>
merge request to be
merg
ed when it's ready.
-
else
Start the title with
<code>
[WIP]
</code>
or
<code>
WIP:
</code>
to prevent a
<strong>
Work In Progress
</strong>
merge request from being
accept
ed before it's ready.
<strong>
Work In Progress
</strong>
merge request from being
merg
ed before it's ready.
.form-group.issuable-description
=
f
.
label
:description
,
'Description'
,
class:
'control-label'
.col-sm-10
...
...
app/workers/post_receive.rb
View file @
4a2b7cef
...
...
@@ -45,7 +45,7 @@ class PostReceive
def
utf8_encode_changes
(
changes
)
changes
=
changes
.
dup
changes
.
force_encoding
(
"UTF-8"
)
return
changes
if
changes
.
valid_encoding?
...
...
config/initializers/1_settings.rb
View file @
4a2b7cef
...
...
@@ -8,6 +8,15 @@ class Settings < Settingslogic
def
gitlab_on_standard_port?
gitlab
.
port
.
to_i
==
(
gitlab
.
https
?
443
:
80
)
end
# get host without www, thanks to http://stackoverflow.com/a/6674363/1233435
def
get_host_without_www
(
url
)
url
=
URI
.
encode
(
url
)
uri
=
URI
.
parse
(
url
)
uri
=
URI
.
parse
(
"http://
#{
url
}
"
)
if
uri
.
scheme
.
nil?
host
=
uri
.
host
.
downcase
host
.
start_with?
(
'www.'
)
?
host
[
4
..-
1
]
:
host
end
private
...
...
@@ -147,6 +156,7 @@ Settings['gravatar'] ||= Settingslogic.new({})
Settings
.
gravatar
[
'enabled'
]
=
true
if
Settings
.
gravatar
[
'enabled'
].
nil?
Settings
.
gravatar
[
'plain_url'
]
||=
'http://www.gravatar.com/avatar/%{hash}?s=%{size}&d=identicon'
Settings
.
gravatar
[
'ssl_url'
]
||=
'https://secure.gravatar.com/avatar/%{hash}?s=%{size}&d=identicon'
Settings
.
gravatar
[
'host'
]
=
Settings
.
get_host_without_www
(
Settings
.
gravatar
[
'plain_url'
])
#
# GitLab Shell
...
...
features/profile/profile.feature
View file @
4a2b7cef
...
...
@@ -35,6 +35,7 @@ Feature: Profile
Then
I change my avatar
And
I should see new avatar
And
I should see the
"Remove avatar"
button
And
I should see the gravatar host link
Scenario
:
I
remove my avatar
Given
I visit profile page
...
...
@@ -42,6 +43,7 @@ Feature: Profile
When
I remove my avatar
Then
I should see my gravatar
And
I should not see the
"Remove avatar"
button
And
I should see the gravatar host link
Scenario
:
My password is expired
Given
my password is expired
...
...
features/steps/profile/profile.rb
View file @
4a2b7cef
...
...
@@ -59,6 +59,10 @@ class Spinach::Features::Profile < Spinach::FeatureSteps
step
'I should not see the "Remove avatar" button'
do
expect
(
page
).
not_to
have_link
(
"Remove avatar"
)
end
step
'I should see the gravatar host link'
do
expect
(
page
).
to
have_link
(
"gravatar.com"
)
end
step
'I try change my password w/o old one'
do
page
.
within
'.update-password'
do
...
...
lib/gitlab/markdown/commit_range_reference_filter.rb
View file @
4a2b7cef
...
...
@@ -57,10 +57,11 @@ module Gitlab
title
=
range
.
reference_title
klass
=
reference_class
(
:commit_range
)
data
=
data_attribute
(
project
.
id
)
project_ref
+=
'@'
if
project_ref
%(<a href="#{url}"
%(<a href="#{url}"
#{data}
title="#{title}"
class="#{klass}">#{project_ref}#{range}</a>)
else
...
...
lib/gitlab/markdown/commit_reference_filter.rb
View file @
4a2b7cef
...
...
@@ -47,10 +47,11 @@ module Gitlab
title
=
escape_once
(
commit
.
link_title
)
klass
=
reference_class
(
:commit
)
data
=
data_attribute
(
project
.
id
)
project_ref
+=
'@'
if
project_ref
%(<a href="#{url}"
%(<a href="#{url}"
#{data}
title="#{title}"
class="#{klass}">#{project_ref}#{commit.short_id}</a>)
else
...
...
lib/gitlab/markdown/issue_reference_filter.rb
View file @
4a2b7cef
...
...
@@ -49,8 +49,9 @@ module Gitlab
title
=
escape_once
(
"Issue:
#{
issue
.
title
}
"
)
klass
=
reference_class
(
:issue
)
data
=
data_attribute
(
project
.
id
)
%(<a href="#{url}"
%(<a href="#{url}"
#{data}
title="#{title}"
class="#{klass}">#{match}</a>)
else
...
...
lib/gitlab/markdown/label_reference_filter.rb
View file @
4a2b7cef
...
...
@@ -43,8 +43,9 @@ module Gitlab
url
=
url_for_label
(
project
,
label
)
klass
=
reference_class
(
:label
)
data
=
data_attribute
(
project
.
id
)
%(<a href="#{url}"
%(<a href="#{url}"
#{data}
class="#{klass}">#{render_colored_label(label)}</a>)
else
match
...
...
lib/gitlab/markdown/merge_request_reference_filter.rb
View file @
4a2b7cef
...
...
@@ -47,10 +47,11 @@ module Gitlab
title
=
escape_once
(
"Merge Request:
#{
merge_request
.
title
}
"
)
klass
=
reference_class
(
:merge_request
)
data
=
data_attribute
(
project
.
id
)
url
=
url_for_merge_request
(
merge_request
,
project
)
%(<a href="#{url}"
%(<a href="#{url}"
#{data}
title="#{title}"
class="#{klass}">#{match}</a>)
else
...
...
lib/gitlab/markdown/reference_filter.rb
View file @
4a2b7cef
...
...
@@ -21,6 +21,22 @@ module Gitlab
result
[
:references
]
=
Hash
.
new
{
|
hash
,
type
|
hash
[
type
]
=
[]
}
end
# Returns a data attribute String to attach to a reference link
#
# id - Object ID
# type - Object type (default: :project)
#
# Examples:
#
# data_attribute(1) # => "data-project-id=\"1\""
# data_attribute(2, :user) # => "data-user-id=\"2\""
# data_attribute(3, :group) # => "data-group-id=\"3\""
#
# Returns a String
def
data_attribute
(
id
,
type
=
:project
)
%Q(data-
#{
type
}
-id="
#{
id
}
")
end
def
escape_once
(
html
)
ERB
::
Util
.
html_escape_once
(
html
)
end
...
...
lib/gitlab/markdown/snippet_reference_filter.rb
View file @
4a2b7cef
...
...
@@ -47,10 +47,11 @@ module Gitlab
title
=
escape_once
(
"Snippet:
#{
snippet
.
title
}
"
)
klass
=
reference_class
(
:snippet
)
data
=
data_attribute
(
project
.
id
)
url
=
url_for_snippet
(
snippet
,
project
)
%(<a href="#{url}"
%(<a href="#{url}"
#{data}
title="#{title}"
class="#{klass}">#{match}</a>)
else
...
...
lib/gitlab/markdown/user_reference_filter.rb
View file @
4a2b7cef
...
...
@@ -83,18 +83,20 @@ module Gitlab
push_result
(
:user
,
*
namespace
.
users
)
url
=
urls
.
group_url
(
group
,
only_path:
context
[
:only_path
])
data
=
data_attribute
(
namespace
.
id
,
:group
)
text
=
Group
.
reference_prefix
+
group
%(<a href="#{url}" class="#{link_class}">#{text}</a>)
%(<a href="#{url}"
#{data}
class="#{link_class}">#{text}</a>)
end
def
link_to_user
(
user
,
namespace
)
push_result
(
:user
,
namespace
.
owner
)
url
=
urls
.
user_url
(
user
,
only_path:
context
[
:only_path
])
data
=
data_attribute
(
namespace
.
owner_id
,
:user
)
text
=
User
.
reference_prefix
+
user
%(<a href="#{url}" class="#{link_class}">#{text}</a>)
%(<a href="#{url}"
#{data}
class="#{link_class}">#{text}</a>)
end
def
user_can_reference_group?
(
group
)
...
...
spec/lib/gitlab/markdown/commit_range_reference_filter_spec.rb
View file @
4a2b7cef
...
...
@@ -80,6 +80,14 @@ module Gitlab::Markdown
expect
(
doc
.
css
(
'a'
).
first
.
attr
(
'class'
)).
to
include
'custom'
end
it
'includes a data-project-id attribute'
do
doc
=
filter
(
"See
#{
reference
}
"
)
link
=
doc
.
css
(
'a'
).
first
expect
(
link
).
to
have_attribute
(
'data-project-id'
)
expect
(
link
.
attr
(
'data-project-id'
)).
to
eq
project
.
id
.
to_s
end
it
'supports an :only_path option'
do
doc
=
filter
(
"See
#{
reference
}
"
,
only_path:
true
)
link
=
doc
.
css
(
'a'
).
first
.
attr
(
'href'
)
...
...
spec/lib/gitlab/markdown/commit_reference_filter_spec.rb
View file @
4a2b7cef
...
...
@@ -76,6 +76,14 @@ module Gitlab::Markdown
expect
(
doc
.
css
(
'a'
).
first
.
attr
(
'class'
)).
to
include
'custom'
end
it
'includes a data-project-id attribute'
do
doc
=
filter
(
"See
#{
reference
}
"
)
link
=
doc
.
css
(
'a'
).
first
expect
(
link
).
to
have_attribute
(
'data-project-id'
)
expect
(
link
.
attr
(
'data-project-id'
)).
to
eq
project
.
id
.
to_s
end
it
'supports an :only_path context'
do
doc
=
filter
(
"See
#{
reference
}
"
,
only_path:
true
)
link
=
doc
.
css
(
'a'
).
first
.
attr
(
'href'
)
...
...
spec/lib/gitlab/markdown/issue_reference_filter_spec.rb
View file @
4a2b7cef
...
...
@@ -73,6 +73,14 @@ module Gitlab::Markdown
expect
(
doc
.
css
(
'a'
).
first
.
attr
(
'class'
)).
to
include
'custom'
end
it
'includes a data-project-id attribute'
do
doc
=
filter
(
"Issue
#{
reference
}
"
)
link
=
doc
.
css
(
'a'
).
first
expect
(
link
).
to
have_attribute
(
'data-project-id'
)
expect
(
link
.
attr
(
'data-project-id'
)).
to
eq
project
.
id
.
to_s
end
it
'supports an :only_path context'
do
doc
=
filter
(
"Issue
#{
reference
}
"
,
only_path:
true
)
link
=
doc
.
css
(
'a'
).
first
.
attr
(
'href'
)
...
...
spec/lib/gitlab/markdown/label_reference_filter_spec.rb
View file @
4a2b7cef
...
...
@@ -30,6 +30,14 @@ module Gitlab::Markdown
expect
(
doc
.
css
(
'a'
).
first
.
attr
(
'class'
)).
to
include
'custom'
end
it
'includes a data-project-id attribute'
do
doc
=
filter
(
"Label
#{
reference
}
"
)
link
=
doc
.
css
(
'a'
).
first
expect
(
link
).
to
have_attribute
(
'data-project-id'
)
expect
(
link
.
attr
(
'data-project-id'
)).
to
eq
project
.
id
.
to_s
end
it
'supports an :only_path context'
do
doc
=
filter
(
"Label
#{
reference
}
"
,
only_path:
true
)
link
=
doc
.
css
(
'a'
).
first
.
attr
(
'href'
)
...
...
spec/lib/gitlab/markdown/merge_request_reference_filter_spec.rb
View file @
4a2b7cef
...
...
@@ -61,6 +61,14 @@ module Gitlab::Markdown
expect
(
doc
.
css
(
'a'
).
first
.
attr
(
'class'
)).
to
include
'custom'
end
it
'includes a data-project-id attribute'
do
doc
=
filter
(
"Merge
#{
reference
}
"
)
link
=
doc
.
css
(
'a'
).
first
expect
(
link
).
to
have_attribute
(
'data-project-id'
)
expect
(
link
.
attr
(
'data-project-id'
)).
to
eq
project
.
id
.
to_s
end
it
'supports an :only_path context'
do
doc
=
filter
(
"Merge
#{
reference
}
"
,
only_path:
true
)
link
=
doc
.
css
(
'a'
).
first
.
attr
(
'href'
)
...
...
spec/lib/gitlab/markdown/snippet_reference_filter_spec.rb
View file @
4a2b7cef
...
...
@@ -60,6 +60,14 @@ module Gitlab::Markdown
expect
(
doc
.
css
(
'a'
).
first
.
attr
(
'class'
)).
to
include
'custom'
end
it
'includes a data-project-id attribute'
do
doc
=
filter
(
"Snippet
#{
reference
}
"
)
link
=
doc
.
css
(
'a'
).
first
expect
(
link
).
to
have_attribute
(
'data-project-id'
)
expect
(
link
.
attr
(
'data-project-id'
)).
to
eq
project
.
id
.
to_s
end
it
'supports an :only_path context'
do
doc
=
filter
(
"Snippet
#{
reference
}
"
,
only_path:
true
)
link
=
doc
.
css
(
'a'
).
first
.
attr
(
'href'
)
...
...
spec/lib/gitlab/markdown/user_reference_filter_spec.rb
View file @
4a2b7cef
...
...
@@ -64,6 +64,14 @@ module Gitlab::Markdown
expect
(
doc
.
css
(
'a'
).
length
).
to
eq
1
end
it
'includes a data-user-id attribute'
do
doc
=
filter
(
"Hey
#{
reference
}
"
)
link
=
doc
.
css
(
'a'
).
first
expect
(
link
).
to
have_attribute
(
'data-user-id'
)
expect
(
link
.
attr
(
'data-user-id'
)).
to
eq
user
.
namespace
.
owner_id
.
to_s
end
it
'adds to the results hash'
do
result
=
pipeline_result
(
"Hey
#{
reference
}
"
)
expect
(
result
[
:references
][
:user
]).
to
eq
[
user
]
...
...
@@ -85,6 +93,14 @@ module Gitlab::Markdown
expect
(
doc
.
css
(
'a'
).
first
.
attr
(
'href'
)).
to
eq
urls
.
group_url
(
group
)
end
it
'includes a data-group-id attribute'
do
doc
=
filter
(
"Hey
#{
reference
}
"
,
current_user:
user
)
link
=
doc
.
css
(
'a'
).
first
expect
(
link
).
to
have_attribute
(
'data-group-id'
)
expect
(
link
.
attr
(
'data-group-id'
)).
to
eq
group
.
id
.
to_s
end
it
'adds to the results hash'
do
result
=
pipeline_result
(
"Hey
#{
reference
}
"
,
current_user:
user
)
expect
(
result
[
:references
][
:user
]).
to
eq
group
.
users
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment