Browse Source

fix shore bump to add the changelog file to the commit when using --tag

master
Niklas Rosenstein 6 months ago
parent
commit
0f7f99d58e
Signed by: NiklasRosenstein <rosensteinniklas@gmail.com> GPG Key ID: 06D269B33D25F6C6
2 changed files with 10 additions and 1 deletions
  1. +6
    -0
      .changelog/_unreleased.yml
  2. +4
    -1
      src/shore/__main__.py

+ 6
- 0
.changelog/_unreleased.yml View File

@@ -0,0 +1,6 @@
- component: cli
description: '`shore bump` now adds the changelog files to the commit when using
the `--tag` option.'
flags: []
issues: []
type: fix

+ 4
- 1
src/shore/__main__.py View File

@@ -561,12 +561,16 @@ def bump(**args):
logger.warning('bump requires an update in order to automatically tag')
args['update'] = True

changed_files = [x.filename for x in version_refs]

# Rename the unreleased changelog if it exists.
if changelog_manager.unreleased.exists():
changed_files.append(changed_files.unreleased.filename)
if args['dry']:
changelog = changelog_manager.version(new_version)
else:
changelog = changelog_manager.release(new_version)
changed_files.append(changelog.filename)
logger.info('release staged changelog (%s → %s)', changelog_manager.unreleased.filename,
changelog.filename)

@@ -587,7 +591,6 @@ def bump(**args):
logger.info('tagging %s', tag_name)

if not args['dry']:
changed_files = [x.filename for x in version_refs]
_git.add(changed_files)
_git.commit('({}) bump version to {}'.format(subject.name, new_version), allow_empty=True)
_git.tag(tag_name, force=args['force'])


Loading…
Cancel
Save