From nobody Fri Apr 19 06:11:30 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=patchew-devel-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=patchew-devel-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1645188387; cv=none; d=zohomail.com; s=zohoarc; b=lp0r7OaTMj3OOJ35+zGaOX7TEq+y7FRCB0ncsmfnGGbhuh5HMTs3L54HIOum0Ci1RDRiJTvIqhS5o2VGjHBav2/irvGWFm23m2ULjEB3fkmiZ7pDn7YeQAE8s2auQeeQW0UQqpbLoyMrqeK5oFTeaGHimTHLDiawaYSYaYS5qO0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1645188387; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=1v/uw55lyhL6HmyNPD7sV8qIRLa+2YgDCWhIKPsl7P8=; b=gV/H7DjDD5AJmJhLC/zvDPd+XVaLyKJce8Ytpz/IWW45VFCd1esA38KA/9FyK9rwPmFTw5So9ikyWrmiIjWr3zqYmMLTM+L5yChEyZvwtwCBnxdwyRl+KJUkgePYeKGx4acAkGASeVaGXkKJkd0COm0EgUa+DbF9akEe1/yBk9o= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=patchew-devel-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1645188387373769.8934151548398; Fri, 18 Feb 2022 04:46:27 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-48-TA7nPdOZMC-rdHTtBEjJyw-1; Fri, 18 Feb 2022 07:46:24 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 53CE72F4A; Fri, 18 Feb 2022 12:46:23 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4C30270D27; Fri, 18 Feb 2022 12:46:23 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 40EDA1809CAA; Fri, 18 Feb 2022 12:46:23 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 21ICkLAh003291 for ; Fri, 18 Feb 2022 07:46:22 -0500 Received: by smtp.corp.redhat.com (Postfix) id F23BB2BCFF; Fri, 18 Feb 2022 12:46:21 +0000 (UTC) Received: from avogadro.lan (unknown [10.39.192.241]) by smtp.corp.redhat.com (Postfix) with ESMTP id 684B12BCDC for ; Fri, 18 Feb 2022 12:46:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1645188387; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=1v/uw55lyhL6HmyNPD7sV8qIRLa+2YgDCWhIKPsl7P8=; b=SF6wUDE6rq8wrPmWKFdgxJoRP0xP6HFI/s6eT9mU/ej7mepul2Rzv2ZUVm4PQECSmONBDV mw9pU6nZZ0omBAcuBYWi2YvjX5/RXuaThyUY2AATeSKDHOnh4a4hIkcrMcBq+P+KmJK12D BUxzn2yvWevYJClmin6ke/nmr/u1XgM= X-MC-Unique: TA7nPdOZMC-rdHTtBEjJyw-1 From: Paolo Bonzini To: patchew-devel@redhat.com Date: Fri, 18 Feb 2022 13:46:16 +0100 Message-Id: <20220218124616.412849-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: patchew-devel@redhat.com Subject: [Patchew-devel] [PATCH] tags: do not query repeatedly the config of the tags module X-BeenThere: patchew-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Patchew development and discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: patchew-devel-bounces@redhat.com Errors-To: patchew-devel-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=patchew-devel-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1645188404923100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Paolo Bonzini --- mods/tags.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/mods/tags.py b/mods/tags.py index e2308b3..fdffb6d 100644 --- a/mods/tags.py +++ b/mods/tags.py @@ -150,26 +150,30 @@ series cover letter, patch mail body and their replie= s. old.save() series.topic.merge_with(old.topic) =20 - def parse_message_tags(self, series, m): + def parse_message_tags(self, series, m, tag_prefixes): r =3D [] for l in m.get_body().splitlines(): line =3D l.lower() - for p in self.get_tag_prefixes(): + for p in tag_prefixes: if line.startswith(p.lower()): if line.startswith("supersedes:"): self.process_supersedes(series, l) r.append(l) return r =20 - def look_for_tags(self, series, m): + def _look_for_tags(self, series, m, tag_prefixes): # Incorporate tags from non-patch replies - r =3D self.parse_message_tags(series, m) + r =3D self.parse_message_tags(series, m, tag_prefixes) for x in m.get_replies(): if x.is_patch: continue - r +=3D self.look_for_tags(series, x) + r +=3D self._look_for_tags(series, x, tag_prefixes) return r =20 + def look_for_tags(self, series, m): + tag_prefixes =3D self.get_tag_prefixes() + return self._look_for_tags(series, m, tag_prefixes) + def prepare_message_hook(self, request, message, detailed): if not message.is_series_head: return --=20 2.34.1 _______________________________________________ Patchew-devel mailing list Patchew-devel@redhat.com https://listman.redhat.com/mailman/listinfo/patchew-devel