BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
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
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
9 deletions
+7
-9
repository.rb
app/models/repository.rb
+6
-8
_revert.html.haml
app/views/projects/commit/_revert.html.haml
+1
-1
No files found.
app/models/repository.rb
View file @
b0693318
...
...
@@ -628,18 +628,16 @@ class Repository
target_sha
=
find_branch
(
target_branch
).
try
(
:target
)
# 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
)
# Make the revert happen in the target branch
if
success
&&
!
create_mr
source_sha
=
find_branch
(
target_branch
).
target
target_sha
=
find_branch
(
base_branch
).
target
has_changes
=
is_there_something_to_merge?
(
source_sha
,
target_sha
)
source_sha
=
find_branch
(
target_branch
).
target
target_sha
=
find_branch
(
base_branch
).
target
has_changes
=
is_there_something_to_merge?
(
source_sha
,
target_sha
)
if
has_changes
success
=
revert_commit
(
user
,
commit
,
base_branch
,
base_branch
)
end
if
has_changes
&&
!
create_mr
success
=
revert_commit
(
user
,
commit
,
base_branch
,
base_branch
)
end
has_changes
&&
success
...
...
app/views/projects/commit/_revert.html.haml
View file @
b0693318
...
...
@@ -9,7 +9,7 @@
.form-group.branch
=
label_tag
'target_branch'
,
'Target branch'
,
class:
'control-label'
.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
)
.js-create-merge-request-container
.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