Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
limbra
limbra
Commits
301b277d
Commit
301b277d
authored
Apr 24, 2015
by
MEESSEN Christophe
Browse files
create select_identifier function
parent
9f989b28
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
17 deletions
+33
-17
build_version.py
build_version.py
+33
-17
No files found.
build_version.py
View file @
301b277d
...
...
@@ -165,38 +165,54 @@ def change_log():
git
(
"commit -m"
,
msg
)
def
close_feature
(
):
"""
Close the feature cycl
e.
def
select_identifier
(
branchType
):
"""
Select the identifier to clos
e.
Args:
branchType (str): one of "feature", "hotfix", "release" or "bugfix"
Return (str): the selected identifier or an empty string if none is selected
"""
print
"Close the feature cycle..."
identifiers
=
get_identifiers
(
"feature"
)
identifiers
=
get_identifiers
(
branchType
)
if
not
identifiers
:
print
"Couldn't find any
feature branche to close"
sys
.
exit
(
0
)
print
"Couldn't find any
%s branch"
%
branchType
return
""
if
len
(
identifiers
)
==
1
:
rep
=
raw_input
(
"Close
feature
'%s' [y/N]:"
%
identifiers
[
0
])
rep
=
raw_input
(
"Close
%s
'%s' [y/N]:"
%
[
branchType
,
identifiers
[
0
]
]
)
if
rep
==
'y'
:
identifier
=
identifiers
[
0
]
else
:
sys
.
exit
(
0
)
return
""
else
:
print
'
List of features in development:'
print
'
%s identifiers:'
%
branchType
print
' '
,
'
\n
'
.
join
(
identifiers
)
identifier
=
raw_input
(
"Select the
feature
identifier:"
)
if
not
identifier
:
sys
.
exit
(
0
)
identifier
=
raw_input
(
"Select the
%s
identifier:"
%
branchType
)
if
not
identifier
in
identifiers
:
return
""
branch
=
"feature-%s"
%
identifier
return
identifier
def
close_feature
():
"""Close the feature cycle.
"""
print
"Close the feature cycle..."
identifier
=
select_identifier
(
"feature"
)
if
not
identifier
:
sys
.
exit
(
0
)
branchName
=
"feature-%s"
%
identifier
git
(
"checkout develop"
)
git
(
"merge --no-ff"
,
branch
)
git
(
"merge --no-ff"
,
branch
Name
)
rep
=
raw_input
(
"Delete the locale branch %s [y/N]"
%
branch
)
rep
=
raw_input
(
"Delete the locale branch %s [y/N]"
%
branch
Name
)
if
rep
==
'y'
:
git
(
"branch -d"
,
branch
)
git
(
"branch -d"
,
branch
Name
)
def
close_hotfix
():
...
...
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