Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
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
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
edx
edx-platform
Commits
96122fc9
Commit
96122fc9
authored
May 06, 2014
by
David Baumgold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Warn and continue for missing merge commits
parent
ee33a12d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
4 deletions
+24
-4
scripts/release.py
+24
-4
No files found.
scripts/release.py
View file @
96122fc9
...
@@ -75,6 +75,13 @@ def parse_ticket_references(text):
...
@@ -75,6 +75,13 @@ def parse_ticket_references(text):
return
JIRA_RE
.
findall
(
text
)
return
JIRA_RE
.
findall
(
text
)
class
DoesNotExist
(
Exception
):
def
__init__
(
self
,
message
,
commit
,
branch
):
self
.
message
=
message
self
.
commit
=
commit
self
.
branch
=
branch
def
get_merge_commit
(
commit
,
branch
=
"master"
):
def
get_merge_commit
(
commit
,
branch
=
"master"
):
"""
"""
Given a commit that was merged into the given branch, return the merge commit
Given a commit that was merged into the given branch, return the merge commit
...
@@ -89,9 +96,11 @@ def get_merge_commit(commit, branch="master"):
...
@@ -89,9 +96,11 @@ def get_merge_commit(commit, branch="master"):
for
commit_hash
in
reversed
(
ancestry_paths
):
for
commit_hash
in
reversed
(
ancestry_paths
):
if
commit_hash
in
both
:
if
commit_hash
in
both
:
return
repo
.
commit
(
commit_hash
)
return
repo
.
commit
(
commit_hash
)
raise
ValueError
(
"No merge commit for {commit} in {branch}!"
.
format
(
# no merge commit!
msg
=
"No merge commit for {commit} in {branch}!"
.
format
(
commit
=
commit
,
branch
=
branch
,
commit
=
commit
,
branch
=
branch
,
))
)
raise
DoesNotExist
(
msg
,
commit
,
branch
)
def
get_pr_info
(
num
):
def
get_pr_info
(
num
):
...
@@ -140,8 +149,19 @@ def prs_by_email(start_ref, end_ref):
...
@@ -140,8 +149,19 @@ def prs_by_email(start_ref, end_ref):
for
pr_num
in
get_merged_prs
(
start_ref
,
end_ref
):
for
pr_num
in
get_merged_prs
(
start_ref
,
end_ref
):
ref
=
"refs/remotes/edx/pr/{num}"
.
format
(
num
=
pr_num
)
ref
=
"refs/remotes/edx/pr/{num}"
.
format
(
num
=
pr_num
)
branch
=
SymbolicReference
(
repo
,
ref
)
branch
=
SymbolicReference
(
repo
,
ref
)
merge
=
get_merge_commit
(
branch
.
commit
,
end_ref
)
try
:
unordered_data
[
merge
.
author
.
email
]
.
add
((
pr_num
,
merge
))
merge
=
get_merge_commit
(
branch
.
commit
,
end_ref
)
except
DoesNotExist
as
err
:
print
(
"Warning: could not find merge commit for {commit}. The pull "
"request containing this commit will not be included in the "
"table."
.
format
(
commit
=
err
.
commit
),
file
=
sys
.
stderr
,
)
else
:
unordered_data
[
merge
.
author
.
email
]
.
add
((
pr_num
,
merge
))
ordered_data
=
OrderedDict
()
ordered_data
=
OrderedDict
()
for
email
in
sorted
(
unordered_data
.
keys
()):
for
email
in
sorted
(
unordered_data
.
keys
()):
...
...
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