Skip to content

Commit eda5364

Browse files
amoralejGerrit Code Review
authored andcommitted
Add options to specify user and mail in changelog entry
When modifying a spec file, rdopkg takes user name and mail from gitconfig. There are cases where we want to define other values, for using it in unattended mode inside scripts. Change-Id: I1415663ff4d14cec1cda8d9ad23ca117af45377d
1 parent ef1e5d2 commit eda5364

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

rdopkg/actions/distgit/__init__.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,10 @@
7979
Arg('commit_header_file', shortcut='-H', metavar='FILE',
8080
help="start commit message with FILE contents, "
8181
"- for stdin"),
82+
Arg('changelog_user', shortcut='-u', default=None,
83+
help="User to be used in new changelog entry"),
84+
Arg('changelog_email', shortcut='-e', default=None,
85+
help="email address to be used in new changelog entry"),
8286
],
8387
steps=[
8488
Action('get_package_env'),
@@ -123,6 +127,10 @@
123127
Arg('commit_header_file', shortcut='-H', metavar='FILE',
124128
help="start commit message with FILE contents, "
125129
"- for stdin"),
130+
Arg('changelog_user', shortcut='-u', default=None,
131+
help="User to be used in new changelog entry"),
132+
Arg('changelog_email', shortcut='-e', default=None,
133+
help="email address to be used in new changelog entry"),
126134
],
127135
steps=[
128136
Action('get_package_env'),

rdopkg/actions/distgit/actions.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -619,7 +619,8 @@ def get_upstream_patches(version, local_patches_branch,
619619
def update_spec(branch=None, changes=None,
620620
new_rpm_version=None, new_release=None,
621621
new_milestone=None, new_patches_base=None,
622-
no_bump=False):
622+
no_bump=False, changelog_user=None,
623+
changelog_email=None):
623624

624625
if no_bump:
625626
return
@@ -649,7 +650,9 @@ def update_spec(branch=None, changes=None,
649650
changed = spec.set_patches_base_version(new_patches_base)
650651
if not changed:
651652
log.info("Macro detected in patches_base - not touching that.")
652-
spec.new_changelog_entry(user=guess.user(), email=guess.email(),
653+
user = (changelog_user or guess.user())
654+
email = (changelog_email or guess.email())
655+
spec.new_changelog_entry(user=user, email=email,
653656
changes=changes)
654657
spec.save()
655658

0 commit comments

Comments
 (0)