Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
bob
bob.devtools
Commits
1fd283d8
Commit
1fd283d8
authored
Jan 08, 2019
by
André Anjos
💬
Browse files
[changelog] Always use the package path with namespace from now on
parent
f6cc9dc0
Changes
1
Hide whitespace changes
Inline
Side-by-side
bob/devtools/changelog.py
View file @
1fd283d8
...
...
@@ -10,8 +10,6 @@ logger = logging.getLogger(__name__)
import
pytz
import
dateutil.parser
from
.release
import
ensure_correct_package
def
parse_date
(
d
):
'''Parses any date supported by :py:func:`dateutil.parser.parse`'''
...
...
@@ -228,7 +226,7 @@ def write_tags_with_commits(f, gitpkg, since, mode):
# get merge requests since the release data
mrs
=
list
(
reversed
(
gitpkg
.
mergerequests
.
list
(
state
=
'merged'
,
updated_after
=
since
,
order_by
=
'updated_at'
,
all
=
True
)))
f
.
write
(
'* %s
\n
'
%
(
gitpkg
.
name
,))
f
.
write
(
'* %s
\n
'
%
(
gitpkg
.
attributes
[
'path_with_namespace'
]
,))
# go through tags and writes each with its message and corresponding
# commits
...
...
@@ -236,14 +234,15 @@ def write_tags_with_commits(f, gitpkg, since, mode):
for
tag
in
tags
:
# write tag name and its text
_write_one_tag
(
f
,
gitpkg
.
name
,
tag
)
_write_one_tag
(
f
,
gitpkg
.
attributes
[
'path_with_namespace'
]
,
tag
)
end_date
=
parse_date
(
tag
.
commit
[
'committed_date'
])
if
mode
==
'commits'
:
# write commits from the previous tag up to this one
commits4tag
=
[
k
for
k
in
commits
\
if
(
start_date
<
parse_date
(
k
.
committed_date
)
<=
end_date
)]
_write_commits_range
(
f
,
gitpkg
.
name
,
commits4tag
)
_write_commits_range
(
f
,
gitpkg
.
attributes
[
'path_with_namespace'
],
commits4tag
)
elif
mode
==
'mrs'
:
# write merge requests from the previous tag up to this one
...
...
@@ -251,7 +250,8 @@ def write_tags_with_commits(f, gitpkg, since, mode):
# June 2018
mrs4tag
=
[
k
for
k
in
mrs
\
if
(
start_date
<
parse_date
(
k
.
updated_at
)
<=
end_date
)]
_write_mergerequests_range
(
f
,
gitpkg
.
name
,
mrs4tag
)
_write_mergerequests_range
(
f
,
gitpkg
.
attributes
[
'path_with_namespace'
],
mrs4tag
)
start_date
=
end_date
...
...
@@ -266,13 +266,15 @@ def write_tags_with_commits(f, gitpkg, since, mode):
# June 2018
leftover_mrs
=
[
k
for
k
in
mrs
\
if
parse_date
(
k
.
updated_at
)
>
start_date
]
_write_mergerequests_range
(
f
,
gitpkg
.
name
,
leftover_mrs
)
_write_mergerequests_range
(
f
,
gitpkg
.
attributes
[
'path_with_namespace'
],
leftover_mrs
)
else
:
# write leftover commits that were not tagged yet
leftover_commits
=
[
k
for
k
in
commits
\
if
parse_date
(
k
.
committed_date
)
>
start_date
]
_write_commits_range
(
f
,
gitpkg
.
name
,
leftover_commits
)
_write_commits_range
(
f
,
gitpkg
.
attributes
[
'path_with_namespace'
],
leftover_commits
)
def
write_tags
(
f
,
gitpkg
,
since
):
...
...
@@ -293,4 +295,4 @@ def write_tags(f, gitpkg, since):
f
.
write
(
'* %s
\n
'
)
for
tag
in
tags
:
_write_one_tag
(
gitpkg
.
name
,
tag
)
_write_one_tag
(
gitpkg
.
attributes
[
'path_with_namespace'
]
,
tag
)
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