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
eded4bfa
Commit
eded4bfa
authored
Jan 05, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Raise exception and show message to user if repo missing satellite
parent
eaa8cd28
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
3 deletions
+16
-3
app/controllers/merge_requests_controller.rb
app/controllers/merge_requests_controller.rb
+2
-0
app/views/merge_requests/show/_mr_accept.html.haml
app/views/merge_requests/show/_mr_accept.html.haml
+5
-0
lib/gitlab/satellite/satellite.rb
lib/gitlab/satellite/satellite.rb
+9
-3
No files found.
app/controllers/merge_requests_controller.rb
View file @
eded4bfa
...
...
@@ -69,6 +69,8 @@ class MergeRequestsController < ProjectResourceController
@merge_request
.
check_if_can_be_merged
end
render
json:
{
state:
@merge_request
.
human_state
}
rescue
Gitlab
::
SatelliteNotExistError
render
json:
{
state: :no_satellite
}
end
def
automerge
...
...
app/views/merge_requests/show/_mr_accept.html.haml
View file @
eded4bfa
...
...
@@ -23,6 +23,11 @@
.clearfix
.automerge_widget.no_satellite
{
style:
"display:none"
}
.alert.alert-error
%span
%strong
This repository does not have satellite. Ask administrator to fix this issue
.automerge_widget.cannot_be_merged
{
style:
"display:none"
}
.alert.alert-info
%span
...
...
lib/gitlab/satellite/satellite.rb
View file @
eded4bfa
module
Gitlab
class
SatelliteNotExistError
<
StandardError
;
end
module
Satellite
class
Satellite
PARKING_BRANCH
=
"__parking_branch"
...
...
@@ -9,8 +11,12 @@ module Gitlab
@project
=
project
end
def
raise_no_satellite
raise
SatelliteNotExistError
.
new
(
"Satellite doesn't exist"
)
end
def
clear_and_update!
raise
"Satellite doesn't exist"
unless
exists?
raise
_no_satellite
unless
exists?
delete_heads!
clear_working_dir!
...
...
@@ -35,7 +41,7 @@ module Gitlab
# * Changes the current directory to the satellite's working dir
# * Yields
def
lock
raise
"Satellite doesn't exist"
unless
exists?
raise
_no_satellite
unless
exists?
File
.
open
(
lock_file
,
"w+"
)
do
|
f
|
f
.
flock
(
File
::
LOCK_EX
)
...
...
@@ -55,7 +61,7 @@ module Gitlab
end
def
repo
raise
"Satellite doesn't exist"
unless
exists?
raise
_no_satellite
unless
exists?
@repo
||=
Grit
::
Repo
.
new
(
path
)
end
...
...
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