Fix handling tag on excluded commits and even if there is no message for this version
This commit is contained in:
parent
f659811be5
commit
70381153b9
1 changed files with 23 additions and 20 deletions
43
gitdch
43
gitdch
|
@ -248,14 +248,18 @@ def clean_deb_version(version_name):
|
|||
|
||||
def add_version():
|
||||
""" Add version info """
|
||||
if messages:
|
||||
log.info('Add version %s:\n - %s', version, '\n - '.join(messages))
|
||||
versions.append({
|
||||
'name': version,
|
||||
'tag': tag,
|
||||
'commit': version_commit,
|
||||
'messages': messages,
|
||||
})
|
||||
global messages # pylint: disable=global-statement
|
||||
if not version_commit:
|
||||
return
|
||||
if not messages:
|
||||
messages = ['Release version {0}'.format(version)]
|
||||
log.info('Add version %s:\n - %s', version, '\n - '.join(messages))
|
||||
versions.append({
|
||||
'name': version,
|
||||
'tag': tag,
|
||||
'commit': version_commit,
|
||||
'messages': messages
|
||||
})
|
||||
|
||||
|
||||
tag = None
|
||||
|
@ -268,18 +272,7 @@ version = (
|
|||
)
|
||||
messages = []
|
||||
for commit in repo.iter_commits(rev=options.revision):
|
||||
if version_commit is None:
|
||||
version_commit = commit
|
||||
log.debug('Commit %s (%s)', commit, commit.summary)
|
||||
excluded = False
|
||||
for regex in options.exclude:
|
||||
if regex.search(commit.summary):
|
||||
excluded = True
|
||||
log.debug(
|
||||
'Exclude commit %s ("%s", match with "%s")',
|
||||
commit, commit.summary, regex.pattern)
|
||||
if excluded:
|
||||
continue
|
||||
if commit.binsha in tag_commits:
|
||||
new_tag = tag_commits[commit.binsha]
|
||||
log.debug('Reach new tag %s', new_tag)
|
||||
|
@ -291,7 +284,17 @@ for commit in repo.iter_commits(rev=options.revision):
|
|||
version_commit = commit
|
||||
messages = []
|
||||
log.debug('Iter commits for version %s', version)
|
||||
messages.append(commit.summary)
|
||||
if version_commit is None:
|
||||
version_commit = commit
|
||||
excluded = False
|
||||
for regex in options.exclude:
|
||||
if regex.search(commit.summary):
|
||||
excluded = True
|
||||
log.debug(
|
||||
'Exclude commit %s ("%s", match with "%s")',
|
||||
commit, commit.summary, regex.pattern)
|
||||
if not excluded:
|
||||
messages.append(commit.summary)
|
||||
add_version()
|
||||
log.info('%d versions found', len(versions))
|
||||
|
||||
|
|
Loading…
Reference in a new issue