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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
b0693318
Commit
b0693318
authored
Feb 07, 2016
by
Rubén Dávila
Committed by
Robert Speicher
Feb 19, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Show list of branches plus some fixes.
parent
6b0e4783
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
9 deletions
+7
-9
app/models/repository.rb
app/models/repository.rb
+6
-8
app/views/projects/commit/_revert.html.haml
app/views/projects/commit/_revert.html.haml
+1
-1
No files found.
app/models/repository.rb
View file @
b0693318
...
@@ -628,19 +628,17 @@ class Repository
...
@@ -628,19 +628,17 @@ class Repository
target_sha
=
find_branch
(
target_branch
).
try
(
:target
)
target_sha
=
find_branch
(
target_branch
).
try
(
:target
)
# First make revert in temp branch
# First make revert in temp branch
rm_branch
(
target_branch
)
if
target_sha
rm_branch
(
user
,
target_branch
)
if
target_sha
success
=
revert_commit
(
user
,
commit
,
target_branch
,
base_branch
)
success
=
revert_commit
(
user
,
commit
,
target_branch
,
base_branch
)
# Make the revert happen in the target branch
# Make the revert happen in the target branch
if
success
&&
!
create_mr
source_sha
=
find_branch
(
target_branch
).
target
source_sha
=
find_branch
(
target_branch
).
target
target_sha
=
find_branch
(
base_branch
).
target
target_sha
=
find_branch
(
base_branch
).
target
has_changes
=
is_there_something_to_merge?
(
source_sha
,
target_sha
)
has_changes
=
is_there_something_to_merge?
(
source_sha
,
target_sha
)
if
has_changes
if
has_changes
&&
!
create_mr
success
=
revert_commit
(
user
,
commit
,
base_branch
,
base_branch
)
success
=
revert_commit
(
user
,
commit
,
base_branch
,
base_branch
)
end
end
end
has_changes
&&
success
has_changes
&&
success
end
end
...
...
app/views/projects/commit/_revert.html.haml
View file @
b0693318
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
.form-group.branch
.form-group.branch
=
label_tag
'target_branch'
,
'Target branch'
,
class:
'control-label'
=
label_tag
'target_branch'
,
'Target branch'
,
class:
'control-label'
.col-sm-10
.col-sm-10
=
text_field_tag
'target_branch'
,
nil
,
required:
true
,
class:
"form-control
js-target-branch"
=
select_tag
"target_branch"
,
grouped_options_refs
,
class:
"select2 select2-sm
js-target-branch"
-
if
can?
(
current_user
,
:push_code
,
@project
)
-
if
can?
(
current_user
,
:push_code
,
@project
)
.js-create-merge-request-container
.js-create-merge-request-container
.checkbox
.checkbox
...
...
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