diff options
author | Chris Dohmen <chris.dohmen@sciencelogic.com> | 2022-06-27 13:35:05 -0400 |
---|---|---|
committer | Chris Dohmen <chris.dohmen@sciencelogic.com> | 2022-08-05 10:08:09 -0400 |
commit | 0aecbea81bcf8134bc76c17d4bc481a6f56e7bb2 (patch) | |
tree | 10b44fca5e946dddd4cda6a1ae11061fb0f3da5d /pbr/packaging.py | |
parent | 1eadf23b94846a0ebc8402e09190ed1de6dbffd0 (diff) | |
download | pbr-0aecbea81bcf8134bc76c17d4bc481a6f56e7bb2.tar.gz |
Fix symbol identification in multiline message
* Fix an issue where a multiline message with leading spaces would cause
invalid symbol identification.
* Add unit-tests around multiple symbols in a single line
Sem-Ver: bugfix
Change-Id: Id799c2fd368d9df38a5c01fc2071283aecef67c6
Diffstat (limited to 'pbr/packaging.py')
-rw-r--r-- | pbr/packaging.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/pbr/packaging.py b/pbr/packaging.py index 8e9c9ae..474d013 100644 --- a/pbr/packaging.py +++ b/pbr/packaging.py @@ -692,12 +692,14 @@ def _get_increment_kwargs(git_dir, tag): # git log output affecting out ability to have working sem ver headers. changelog = git._run_git_command(['log', '--pretty=%B', version_spec], git_dir) - header_len = len('sem-ver:') - commands = [line[header_len:].strip() for line in changelog.split('\n') - if line.lower().strip().startswith('sem-ver:')] symbols = set() - for command in commands: - symbols.update([symbol.strip() for symbol in command.split(',')]) + header = 'sem-ver:' + for line in changelog.split("\n"): + line = line.lower().strip() + if not line.lower().strip().startswith(header): + continue + new_symbols = line[len(header):].strip().split(",") + symbols.update([symbol.strip() for symbol in new_symbols]) def _handle_symbol(symbol, symbols, impact): if symbol in symbols: |