Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
G
git-repo
Project
Project
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
linux-tools
git-repo
Commits
8b3ee8e2
Commit
8b3ee8e2
authored
Apr 11, 2016
by
Ovchar Stanislav
Committed by
Matthias Putz
Jun 15, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extension: added force option to push command, thanks to headcrabmeat
parent
1257d230
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
push.py
subcmds/push.py
+10
-2
No files found.
subcmds/push.py
View file @
8b3ee8e2
...
@@ -84,6 +84,10 @@ in all projects listed in the manifest.
...
@@ -84,6 +84,10 @@ in all projects listed in the manifest.
type
=
'string'
,
action
=
'store'
,
dest
=
'dest_branch'
,
type
=
'string'
,
action
=
'store'
,
dest
=
'dest_branch'
,
metavar
=
'BRANCH'
,
metavar
=
'BRANCH'
,
help
=
'Push on this target branch.'
)
help
=
'Push on this target branch.'
)
p
.
add_option
(
'-f'
,
'--force'
,
dest
=
'force_push'
,
action
=
'store_true'
,
help
=
'Force push'
)
# Options relating to push hook. Note that verify and no-verify are NOT
# Options relating to push hook. Note that verify and no-verify are NOT
# opposites of each other, which is why they store to different locations.
# opposites of each other, which is why they store to different locations.
...
@@ -252,7 +256,7 @@ in all projects listed in the manifest.
...
@@ -252,7 +256,7 @@ in all projects listed in the manifest.
branch
.
uploaded
=
False
branch
.
uploaded
=
False
continue
continue
self
.
Push
(
branch
,
dest_branch
=
destination
)
self
.
Push
(
branch
,
dest_branch
=
destination
,
force
=
opt
.
force_push
)
branch
.
uploaded
=
True
branch
.
uploaded
=
True
except
UploadError
as
e
:
except
UploadError
as
e
:
branch
.
error
=
e
branch
.
error
=
e
...
@@ -287,7 +291,7 @@ in all projects listed in the manifest.
...
@@ -287,7 +291,7 @@ in all projects listed in the manifest.
sys
.
exit
(
1
)
sys
.
exit
(
1
)
def
Push
(
self
,
branch_base
,
branch
=
None
,
def
Push
(
self
,
branch_base
,
branch
=
None
,
dest_branch
=
None
):
dest_branch
=
None
,
force
=
False
):
"""Pushs the named branch.
"""Pushs the named branch.
"""
"""
project
=
branch_base
.
project
project
=
branch_base
.
project
...
@@ -313,6 +317,10 @@ in all projects listed in the manifest.
...
@@ -313,6 +317,10 @@ in all projects listed in the manifest.
remote
=
branch
.
remote
.
name
remote
=
branch
.
remote
.
name
cmd
=
[
'push'
]
cmd
=
[
'push'
]
if
force
:
cmd
.
append
(
'--force'
)
cmd
.
append
(
remote
)
cmd
.
append
(
remote
)
if
dest_branch
.
startswith
(
R_HEADS
):
if
dest_branch
.
startswith
(
R_HEADS
):
...
...
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