From nobody Sun Dec 22 06:26:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.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.129.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=1646645850; cv=none; d=zohomail.com; s=zohoarc; b=PSQEFobxCooySxR5tRKKQqVhNhca2v76vSIUspzygjt00OzIqQsWDDSnkk49Slrtz0idMClI6r+T4JORVlPiDlLDwc5p+yU5GacaOOnbJzKCdk/CqXTjx2KY9jJOm0TJLPvb5I2xlbP+NqO681+HRxc12mlFCAb51GoRjrXBCo4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1646645850; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=89PKzIA1tcVjoUTlWpcj3caGf5znCXoQDVZuHTEJcDw=; b=TKPWtB8myu+8CJtTD677QuVICgUKAZtKb5TGAWyRPQfqbCg9ORWWoCm88x8ghax3h8GDC/P/fN48XfIpZqEOi55uVHqZbu32qWSLqQ5rqqvYiuGEhwgvnF+ArRFY98X+Lqmgi5NxV2BEcZXKcoqdhXMnUCQh3qTtCT3BwUAU6uo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.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.129.124]) by mx.zohomail.com with SMTPS id 1646645850657214.9392380320537; Mon, 7 Mar 2022 01:37:30 -0800 (PST) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-385-vMtmmYucN3qlKGpGCMmTsQ-1; Mon, 07 Mar 2022 04:37:26 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 92BC6801597; Mon, 7 Mar 2022 09:37:26 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8ABB7C0809A; Mon, 7 Mar 2022 09:37:26 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id E71E31931BE9; Mon, 7 Mar 2022 09:37:25 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 661571931BDD for ; Mon, 7 Mar 2022 09:37:24 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 412811466C42; Mon, 7 Mar 2022 09:37:24 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast09.extmail.prod.ext.rdu2.redhat.com [10.11.55.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3D48C1466C41 for ; Mon, 7 Mar 2022 09:37:24 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 23B602A59552 for ; Mon, 7 Mar 2022 09:37:24 +0000 (UTC) Received: from mail-ed1-f53.google.com (mail-ed1-f53.google.com [209.85.208.53]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-633-jDItC2xbOvO7SjazoVSk_g-1; Mon, 07 Mar 2022 04:37:22 -0500 Received: by mail-ed1-f53.google.com with SMTP id h13so6839851ede.5 for ; Mon, 07 Mar 2022 01:37:22 -0800 (PST) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id g16-20020a170906521000b006d58773e992sm4524340ejm.188.2022.03.07.01.37.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Mar 2022 01:37:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1646645849; 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: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=89PKzIA1tcVjoUTlWpcj3caGf5znCXoQDVZuHTEJcDw=; b=hgTjirZrx38aNsxksSGWfYmSSgp0F+B4kpXKmaeCu3whiQfnBZyGRa1UmAW3Pdxs+EPZdf A6UQVYLV9CE0+WEV1kesfAzip1BD7HSMC4Z5suwRjIgg1iO8iA9sepJG2KAQzmJPWcrkPk dte1lBUrlu/RyQlbrGl25Tg7jHLHOE8= X-MC-Unique: vMtmmYucN3qlKGpGCMmTsQ-1 X-Original-To: patchew-devel@listman.corp.redhat.com X-MC-Unique: jDItC2xbOvO7SjazoVSk_g-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=epy9gUIO9eTSpPUC55lAlxlXYP8Z7+klCSXD4h2KVYU=; b=agbEGCu3wLgMn2zMc/A4zt2mSG3OAwRsTCiabMKHSRycFUgSMofLfdyALPcsJqzTxI wD2ocC/pFd+S4PkiogEVG1msWtZGbBU8L4sr3SSj9/MoRB2E0RCYrta675Gu0TCMe4HE tFQFBmrvaKX5/7XuInHaGAUu2++Fjwm+jbvz8f8BUgtsGLTRKEURhJRfIsrbiLJobBh5 8LS/KXndRapW/WtZ3RMtNNumOcb7gg7Lxl6IoWC2BxBomdl4u4++tkwCThhRrpKi9F41 DE91ebbjrO41vpBwAa41R97J4kbHRs7Qu95+Y8+XW8E/uV8TMAMx5nNJnru/35wxcq/G PnpQ== X-Gm-Message-State: AOAM5310Rv+m2T5CALMFYF+7aJjzD3OWX4vyK3joo5YjdnsJgJx7OTPR EoQRcXhMJ0zoO3eT2gxSS6ka36Q38J4= X-Google-Smtp-Source: ABdhPJwp/mwDwKmQO8QLRqSGUNYCrM/BGECDFlow2T4kc2fj4YTAimBSTa7kptJwmR+EV7haOl5C4w== X-Received: by 2002:a50:d4d2:0:b0:410:9fa2:60d6 with SMTP id e18-20020a50d4d2000000b004109fa260d6mr10404903edj.35.1646645841403; Mon, 07 Mar 2022 01:37:21 -0800 (PST) From: Paolo Bonzini To: patchew-devel@redhat.com Date: Mon, 7 Mar 2022 10:37:17 +0100 Message-Id: <20220307093719.544203-2-pbonzini@redhat.com> In-Reply-To: <20220307093719.544203-1-pbonzini@redhat.com> References: <20220307093719.544203-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.85 on 10.11.54.7 Subject: [Patchew-devel] [PATCH 1/3] test_import: actually test the project update command X-BeenThere: patchew-devel@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Patchew development and discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: patchew-devel-bounces@redhat.com Sender: "Patchew-devel" X-Scanned-By: MIMEDefang 2.85 on 10.11.54.8 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: 1646645852675100009 Content-Type: text/plain; charset="utf-8" Apply a patch and check that the message-id is reflected in the headers and matched in the database. Signed-off-by: Paolo Bonzini --- tests/patchewtest.py | 16 ++++++++-------- tests/test_import.py | 9 ++++++++- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/tests/patchewtest.py b/tests/patchewtest.py index ca1975a..4c30768 100644 --- a/tests/patchewtest.py +++ b/tests/patchewtest.py @@ -73,25 +73,25 @@ class PatchewTestCase(dj_test.LiveServerTestCase): user.save() return user =20 - def cli(self, argv): - return self.do_cli(False, argv) + def cli(self, argv, cwd=3DNone): + return self.do_cli(False, argv, cwd=3Dcwd) =20 - def cli_debug(self, argv): - return self.do_cli(True, argv) + def cli_debug(self, argv, cwd=3DNone): + return self.do_cli(True, argv, cwd=3Dcwd) =20 - def do_cli(self, debug, argv): + def do_cli(self, debug, argv, cwd=3DNone): """Run patchew-cli command and return (retcode, stdout, stderr)""" dbgopt =3D "-d" if debug else "-D" cmd =3D [PATCHEW_CLI, dbgopt, "-s", self.live_server_url] + argv - p =3D subprocess.Popen(cmd, stdout=3Dsubprocess.PIPE, stderr=3Dsub= process.PIPE) + p =3D subprocess.Popen(cmd, stdout=3Dsubprocess.PIPE, stderr=3Dsub= process.PIPE, cwd=3Dcwd) a, b =3D p.communicate() a =3D a.decode("utf-8") b =3D b.decode("utf-8") return p.returncode, a.strip(), b.strip() =20 - def check_cli(self, args, rc=3D0, stdout=3DNone, stderr=3DNone): + def check_cli(self, args, rc=3D0, stdout=3DNone, stderr=3DNone, cwd=3D= None): assert isinstance(args, list) - r, a, b =3D self.cli(args) + r, a, b =3D self.cli(args, cwd=3Dcwd) self.assertEqual( r, rc, diff --git a/tests/test_import.py b/tests/test_import.py index 1dbf16e..d6c57e4 100755 --- a/tests/test_import.py +++ b/tests/test_import.py @@ -134,7 +134,14 @@ class UnprivilegedImportTest(ImportTest): repo =3D self.create_git_repo() p.git =3D repo p.save() - self.check_cli(["project", "update"]) + + self.cli_import("0013-foo-patch.mbox.gz") + self.check_cli(["apply", "id:20160628014747.20971-1-famz@redhat.co= m"], cwd=3Drepo) + s =3D Message.objects.series_heads()[0] + self.assertEqual(s.is_merged, False) + self.check_cli(["project", "update"], cwd=3Drepo) + s =3D Message.objects.series_heads()[0] + self.assertEqual(s.is_merged, True) =20 =20 if __name__ =3D=3D "__main__": --=20 2.34.1 _______________________________________________ Patchew-devel mailing list Patchew-devel@redhat.com https://listman.redhat.com/mailman/listinfo/patchew-devel From nobody Sun Dec 22 06:26:11 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=1646645851; cv=none; d=zohomail.com; s=zohoarc; b=MdtuxGUsVT0QYayzjEBFTHU+Lr6NGAENPGq8aFeM0Hx6f7hGjjA8SYVJg3oSMLeNlgZs20HA18o/10ib1AJ9noko6jnqbuT/Amt+sJzQKzXp90yhuJLnctOxg3798lSp5fq3MpdPmmyC5nTujdS8guVUQ2PkLrldo4hle1gY9Jo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1646645851; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=oH20oScBqgZtQBL7Z8RHAg70RQJ4UGBFClxFWLSCuZo=; b=Wqy7ZQPEGu3/CxiXs0sbqInFBsOHfoYSF4DjEpkyHLy3cCqjQ+AL/JHky4xhwFGUliCYKWfPLIk+aFome9u0xQuM14rvlyT9Lf4emEXyJJBeX+PhguUAF6u3qCF+DnPFZMMUSWyxDQ4TtPP9DOwjXbhUAUZ8x1bHI3J+HHuXECs= 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 1646645851569499.59724903542826; Mon, 7 Mar 2022 01:37:31 -0800 (PST) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-616-xpcVTF5COzmoil9d0CV0IA-1; Mon, 07 Mar 2022 04:37:27 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 3D394185A7A4; Mon, 7 Mar 2022 09:37:27 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3439C1466C41; Mon, 7 Mar 2022 09:37:27 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id EF59E1931BE9; Mon, 7 Mar 2022 09:37:26 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 465511931BE9 for ; Mon, 7 Mar 2022 09:37:25 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 260D4400C849; Mon, 7 Mar 2022 09:37:25 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast04.extmail.prod.ext.rdu2.redhat.com [10.11.55.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 21FF040C1247 for ; Mon, 7 Mar 2022 09:37:25 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 09A891097AF2 for ; Mon, 7 Mar 2022 09:37:25 +0000 (UTC) Received: from mail-ej1-f42.google.com (mail-ej1-f42.google.com [209.85.218.42]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-368-W0QfWQ_4N1S-d3cnuskymg-1; Mon, 07 Mar 2022 04:37:23 -0500 Received: by mail-ej1-f42.google.com with SMTP id a8so30497413ejc.8 for ; Mon, 07 Mar 2022 01:37:23 -0800 (PST) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id g16-20020a170906521000b006d58773e992sm4524340ejm.188.2022.03.07.01.37.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Mar 2022 01:37:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1646645850; 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: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=oH20oScBqgZtQBL7Z8RHAg70RQJ4UGBFClxFWLSCuZo=; b=ZohJA04NnoCLJ92NivBimAyvSTZh/+6pWoPqki2kNaYaF/i5A5VZTrGZkq4vGPp0a89EK2 MV65zNsgz7RwXDjtm5PrduiVZFevqk+rT0v73oSFL3r6s6RKb8GxtscB4nH5hzDRhtOUoY OSUCSl91fzIBFeZnj0r018gtakqM9tE= X-MC-Unique: xpcVTF5COzmoil9d0CV0IA-1 X-Original-To: patchew-devel@listman.corp.redhat.com X-MC-Unique: W0QfWQ_4N1S-d3cnuskymg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=W9fRhSaLHOl4YOED+VctGbFMyUAm2xJL0hopPc7Jz9A=; b=E3wrKFg66Z2Mk4z31Uo2/ATgNtF9Qt8ui7gNECg1s/xCsT6GsG+CjVQflkIL8auUY+ GBXLusZWoTb82tGuGZCgUIcgchgrC+3eMJTOtuhqK0An37n/mam2iDVns8FDhsWN9DAG zCbxdBP9VWfz0EHzzBNrtkeDb9mFLRT3CqKk3/zbGPcK5l7/7gblrFHvDd7EQcXER/PN csJmpkKb7X6B9kDLKLwsvVkEU/svOtOGnhj7XCmTw8JHwKJe63ba2IrR4lVtjNl+kGIX 0K/Fcaavy33Op5xnHEhTtN945MSfwMwnbgUFbs6VE3BYWi9CUjAd9+6fmNxKt6yyaNGE 5rgQ== X-Gm-Message-State: AOAM532A+46QR2o3q041VXSbL2VBwHvrPB/uN+FS9vAp10uJz+EYjQLP 5cEwhQmFsAoXuSzGlBT7FoWDrOW9ujk= X-Google-Smtp-Source: ABdhPJxIjUUA1Wq3/umQcwRdFQHsnpu9QaGQ+TsNxWOywCRIPKINMq1/HkkW9gLkC3M6UsrNyT2AEw== X-Received: by 2002:a17:907:94c1:b0:6db:67:7214 with SMTP id dn1-20020a17090794c100b006db00677214mr7864082ejc.180.1646645842122; Mon, 07 Mar 2022 01:37:22 -0800 (PST) From: Paolo Bonzini To: patchew-devel@redhat.com Date: Mon, 7 Mar 2022 10:37:18 +0100 Message-Id: <20220307093719.544203-3-pbonzini@redhat.com> In-Reply-To: <20220307093719.544203-1-pbonzini@redhat.com> References: <20220307093719.544203-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.84 on 10.11.54.2 Subject: [Patchew-devel] [PATCH 2/3] patchew-cli: process headers for project update in Python X-BeenThere: patchew-devel@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Patchew development and discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: patchew-devel-bounces@redhat.com Sender: "Patchew-devel" X-Scanned-By: MIMEDefang 2.85 on 10.11.54.7 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: 1646646753114100017 Content-Type: text/plain; charset="utf-8" This will make it easier to match more cases. Signed-off-by: Paolo Bonzini --- patchew-cli | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/patchew-cli b/patchew-cli index b8ac054..d29b539 100755 --- a/patchew-cli +++ b/patchew-cli @@ -491,14 +491,16 @@ class ProjectCommand(SubCommand): logging.debug("old head: %s", old_head) logging.debug("new commits: \n%s" % "\n".join([" " + x for x in n= ew_commits])) output =3D subprocess.check_output( - """git show --format=3D%%b %s | - awk 'BEGIN{IGNORECASE=3D1} /^message-id:/{print}' - """ - % " ".join(new_commits), - shell=3DTrue, + ["git", "show", "--format=3D%b"] + new_commits, cwd=3Dclone, ).decode() - msgids =3D [x[len("message-id:") :].strip() for x in output.splitl= ines()] + msgid_trailer =3D 'Message-Id:'.casefold() + msgids =3D [] + for x in output.splitlines(): + words =3D x.split() + header =3D x.casefold() + if header.startswith(msgid_trailer): + msgids.append(x[11:].strip()) logging.debug("message ids: \n%s" % "\n".join([" " + x for x in m= sgids])) push_to =3D project["mirror"].get("pushurl") if push_to: --=20 2.34.1 _______________________________________________ Patchew-devel mailing list Patchew-devel@redhat.com https://listman.redhat.com/mailman/listinfo/patchew-devel From nobody Sun Dec 22 06:26:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.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.129.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=1646645854; cv=none; d=zohomail.com; s=zohoarc; b=IuTxe+ThaD9dtXagnEQsP8k2IMRdMRi9g9sY3dkINR/vp+NJI5c4zcbWKh5cHjQoQCgJKfZsBfrKhGiLuV9505FyYU2DFlom5s8zq2jYCUB50cgB/A3Vd3DzpsdOXjXIIuxpmUgCJ3C0Gu6pM1W5DnLFgzXVpxlFfK6tpRdRgts= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1646645854; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=2DHGmdkJNqaeyM+T2YRZnSrvVxBcfGk1Kefa/UCD9UQ=; b=VjoZU+cMZ/PhUDE7J5C5Qq+U/3SOZLT0sR5H7G7OA6TuV75l1dSpHDY4RqAye4wPrYCZEMtkYjapLJ4MPsRXabesZng/l3eo7KJbdH5EyeZD9ti05popZhmNDM16qBv2OYcttmHblEQ2QVb6lp/oLLuor8Q+cAU0LAjxifZpOHo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.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.129.124]) by mx.zohomail.com with SMTPS id 1646645854443942.9141419154579; Mon, 7 Mar 2022 01:37:34 -0800 (PST) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-315-A2c2a35uPSqHTtON7K-wZQ-1; Mon, 07 Mar 2022 04:37:30 -0500 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 311593811F20; Mon, 7 Mar 2022 09:37:30 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 294F9401E38; Mon, 7 Mar 2022 09:37:30 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 046241931BE9; Mon, 7 Mar 2022 09:37:30 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id B84B91931BDD for ; Mon, 7 Mar 2022 09:37:28 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 98E63401E40; Mon, 7 Mar 2022 09:37:28 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast03.extmail.prod.ext.rdu2.redhat.com [10.11.55.19]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 94F18401E38 for ; Mon, 7 Mar 2022 09:37:28 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7C5A0811E75 for ; Mon, 7 Mar 2022 09:37:28 +0000 (UTC) Received: from mail-ej1-f48.google.com (mail-ej1-f48.google.com [209.85.218.48]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-441-8VIrvgUvObihqRJV-iUwiQ-1; Mon, 07 Mar 2022 04:37:24 -0500 Received: by mail-ej1-f48.google.com with SMTP id yy13so21673310ejb.2 for ; Mon, 07 Mar 2022 01:37:23 -0800 (PST) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id g16-20020a170906521000b006d58773e992sm4524340ejm.188.2022.03.07.01.37.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Mar 2022 01:37:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1646645853; 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: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=2DHGmdkJNqaeyM+T2YRZnSrvVxBcfGk1Kefa/UCD9UQ=; b=CO9DLPzQ6bxFLmFmknKHFDlfjKKBW6McjlnK+vboAtlPPe6abTh+U7wtUA57CtsQMAEEkf Z2p4lZ8CBZUr1qvuaa61DhUrQU1mIufhb1Rh2L7mLyan6oSp+qmHFV3BS8RRjXdOMcP8vw fJTob5EFHNcTTgQj7CGptLKudPDdrt4= X-MC-Unique: A2c2a35uPSqHTtON7K-wZQ-1 X-Original-To: patchew-devel@listman.corp.redhat.com X-MC-Unique: 8VIrvgUvObihqRJV-iUwiQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=6GI+fS0MBu7rh6lPMUrOl/gNaPQ92aDFCvXc/L/HigA=; b=cUWFJce7BIwKAbXz90vocv+eNEfbTPzRsW3I5iNfbKLw7Sf5MlKcHvyDLsocM/kPnN h/PaHqyXV0rarEdw9xYKDvWRnYcq5FSwoUlKyZ8y7r6jKh3glVMy5i3hwNqF2CQDwcHD 5SdY6G+qLvhdpraB9rfOUcbosp9skauyGuCvNg4HeDJ1igUXsEBCCQVXhZIQsY88UVYt QUxmnkuDez9FQsfkdcfdC+c05sbV21Ar7n0iQNMDfVvvPB7CIuRz1PtsBgsLwBOoeP3D llU2S2AGAuDlR7ywZ17Ymr7Qdbw1TLpRoMX1dGyETiUDN6m5RbgjSW9FHjn3ktF4Bnyt nqYg== X-Gm-Message-State: AOAM531uUjwDitTYsHCwI6ciN483K9MHcbvDetodsztwFVLj3dcOLS7E R6H8dHgpspOuQgAyO4xef6YZCHfgz5w= X-Google-Smtp-Source: ABdhPJw4h0SlhCvsTdHV42iqZe0JApQFQLLuuzrvBtGjs0ovZHbayNghqSZJTZbm6hdYsX4XBYVGuA== X-Received: by 2002:a17:907:7e8f:b0:6da:6352:a7be with SMTP id qb15-20020a1709077e8f00b006da6352a7bemr8114728ejc.612.1646645842839; Mon, 07 Mar 2022 01:37:22 -0800 (PST) From: Paolo Bonzini To: patchew-devel@redhat.com Date: Mon, 7 Mar 2022 10:37:19 +0100 Message-Id: <20220307093719.544203-4-pbonzini@redhat.com> In-Reply-To: <20220307093719.544203-1-pbonzini@redhat.com> References: <20220307093719.544203-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 Subject: [Patchew-devel] [PATCH 3/3] patchew-cli: also match Link headers pointing to lore.kernel.org X-BeenThere: patchew-devel@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Patchew development and discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: patchew-devel-bounces@redhat.com Sender: "Patchew-devel" X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 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: 1646645854684100013 Content-Type: text/plain; charset="utf-8" These are a common alternative to the "Message-Id" header provided by "git = am -m", so use them in "patchew project update". Signed-off-by: Paolo Bonzini --- patchew-cli | 3 +++ tests/data/0037-foo-patch-for-git-am.mbox.gz | Bin 0 -> 359 bytes tests/test_import.py | 20 +++++++++++++++++++ 3 files changed, 23 insertions(+) create mode 100644 tests/data/0037-foo-patch-for-git-am.mbox.gz diff --git a/patchew-cli b/patchew-cli index d29b539..f269413 100755 --- a/patchew-cli +++ b/patchew-cli @@ -495,12 +495,15 @@ class ProjectCommand(SubCommand): cwd=3Dclone, ).decode() msgid_trailer =3D 'Message-Id:'.casefold() + lore_link_trailer =3D 'Link: https://lore.kernel.org/r/'.casefold() msgids =3D [] for x in output.splitlines(): words =3D x.split() header =3D x.casefold() if header.startswith(msgid_trailer): msgids.append(x[11:].strip()) + elif header.startswith(lore_link_trailer): + msgids.append('%s' % x[32:].rstrip()) logging.debug("message ids: \n%s" % "\n".join([" " + x for x in m= sgids])) push_to =3D project["mirror"].get("pushurl") if push_to: diff --git a/tests/data/0037-foo-patch-for-git-am.mbox.gz b/tests/data/0037= -foo-patch-for-git-am.mbox.gz new file mode 100644 index 0000000000000000000000000000000000000000..ace183aef67739ff82c497825c1= ab8f3c5cab069 GIT binary patch literal 359 zcmV-t0hs(jb}!9UgNI>#=3DyD(x$k5`n|Hl?c>$v`gVthQJZmU@SwUAPP{>Ogl|(7JdVSl zjim~p)*9ems(p&BwZk#>yiOZ(_hb}xa~IEeGn