diff --git a/distgit_bugzilla_sync/script.py b/distgit_bugzilla_sync/script.py index d21289d..0a9bab0 100644 --- a/distgit_bugzilla_sync/script.py +++ b/distgit_bugzilla_sync/script.py @@ -213,24 +213,28 @@ class BugzillaProxy: return self.userCache[username]['bugzilla_email'].lower() def add_edit_component(self, package, collection, owner, description=None, - qacontact=None, cclist=None): + qacontact=None, cclist=None, output_user=False): '''Add or update a component to have the values specified. ''' # Turn the cclist into something usable by bugzilla initialCCList = [] + initialCCList_username = [] for watcher in cclist: bz_email = self._get_bugzilla_email(watcher) if bz_email: initialCCList.append(bz_email) + initialCCList_username.append(watcher) else: print(f"** {watcher} has no bugzilla_email or mailing_list set " f"({collection}/{package}) **") # Add owner to the cclist so comaintainers taking over a bug don't # have to do this manually + owner_name = owner owner = self._get_bugzilla_email(owner) if owner not in initialCCList: initialCCList.append(owner) + initialCCList_username.append(owner_name) # Lookup product try: @@ -278,11 +282,14 @@ class BugzillaProxy: data['component'] = package if self.config["verbose"]: - print('[EDITCOMP] %s/%s' % (data["product"], data["component"])) + print(f'[EDITCOMP] {data["product"]}/{data["component"]}') for key in ["initialowner", "description", "initialqacontact", "initialcclist"]: if data.get(key): - print(f" {key} changed from {product[pkgKey][key]} " - f"to {data.get(key)}") + if output_user and key == "initialcclist": + print(f" {key} changed from to `{initialCCList_username}`") + else: + print(f" {key} changed from `{product[pkgKey][key]} " + f"to `{data.get(key)}`") # FIXME: initialowner has been made mandatory for some # reason. Asking dkl why.