From nobody Thu Dec 26 15:26:22 2024 Delivered-To: importer2@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=patchew-devel-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 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=1555481915; cv=none; d=zoho.com; s=zohoarc; b=KJZ3/CBPHN2WbWenMSytMQ54yBkjN6LaD1S2k0QRuxDtDFkyU/ekXYKrf3svxCv48hE/Az3K0ZdeqGlWseTeUfIJ2m5W2g47U1wWAFh0HCdOOQNi233mTCYNSjUQZiScR+Qsg4ShSDW6MdousMiFY8HpbgPMiA3Mfe8gYfjzpzo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1555481915; 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:ARC-Authentication-Results; bh=bfSDzLZe+VX2UubQKFPYcVGQJxWVhennry4l//x93XY=; b=LcGk+MDctR/HHrskCfxByNllWuEvB87PSxrOGrWYPtr7s/N6chl9W46oc4YEHPVXI9z52XCKk3MUIF5Xq9y4J6nJM3tOALdS8JVWM4xhUD4EVzxwbBppNqe07jkYku8cXjY+AL1EnF88TOO/R2+uJfBasdNn1rsxRYzzPwPxLzY= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=patchew-devel-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 15554819153371015.7351953380823; Tue, 16 Apr 2019 23:18:35 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 27FDF46233; Wed, 17 Apr 2019 06:18:34 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 183046013D; Wed, 17 Apr 2019 06:18:34 +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 084DB41F3D; Wed, 17 Apr 2019 06:18:34 +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 x3H6IWxu001820 for ; Wed, 17 Apr 2019 02:18:32 -0400 Received: by smtp.corp.redhat.com (Postfix) id BC7B219C6A; Wed, 17 Apr 2019 06:18:32 +0000 (UTC) Received: from mx1.redhat.com (ext-mx09.extmail.prod.ext.phx2.redhat.com [10.5.110.38]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B5C1D19C67 for ; Wed, 17 Apr 2019 06:18:29 +0000 (UTC) Received: from mail-wm1-f50.google.com (mail-wm1-f50.google.com [209.85.128.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2653810C6F for ; Wed, 17 Apr 2019 06:18:28 +0000 (UTC) Received: by mail-wm1-f50.google.com with SMTP id z11so1895011wmi.0 for ; Tue, 16 Apr 2019 23:18:28 -0700 (PDT) Received: from donizetti.lan ([2001:b07:6468:f312:ac27:aac4:c65c:6eb]) by smtp.gmail.com with ESMTPSA id k4sm81976689wro.33.2019.04.16.23.18.25 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 16 Apr 2019 23:18:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Abq4dIn8fh61w0o/MCPHqU9vaKLb7w/uCm2Hyse5ckE=; b=OFvZRZCGjiQKWK4nwQSrlOM8CY5O/0sKDqwo6NRcTae3EFmwlv8WY4lmBwF2hqedkA BpaxHapETkqBSfcjF41FcJz8UqU5d08IRTt/+F4MXmS4UKUNXdKz6p+vVTDHTsf3SXoJ QXdkEo1rZGWj+04RmUKHZp0uXRnTG5zb0ibZDribaxTJJt4jqGvYopZG8pwfuxGwgTy/ KnmfLLV6tYBQF+LJK7hA1Hdwrzftz52wjcJwmCDmDSrJqWyhgfl8Fpe95LjfercDz6vw U45j/SIVFviTeCCRLDgPCm1DFASCvae4qK231/UGNTOGxm9x/G0oIct/egOVhycjw+0E LUjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=Abq4dIn8fh61w0o/MCPHqU9vaKLb7w/uCm2Hyse5ckE=; b=uQ/Vmp7dXx3o+Z9ohzpIEGQyq9EhUWTPsRwOtTar5FPL4DC/et+nbP9R6PW7iHSdfk 1BJXCS+H5qBStN+V96UV7yKtTfoXHuqIoCkzbanhgRvRVLLUQ8eKFxixchbrWzC0KtwA mBRuHtf0+lGAugk9axgKoUxKgkL/cGNuaIP0eSMC0f9OSnq49olrzSVxK/hDmo/356cc 9Khu2tmsLxiOnH3kUl7qLvVO+CT1PaX4b87fhAOcAoSd6ZXfKsuMs9pZJpnDa+SeDbmu Jph17pfJVkkbQpjhgRuWyHra6hcJiXVi3nbLHpHvPS3pc6IIK2QywtiU0suhIklo8sHw KrMw== X-Gm-Message-State: APjAAAX87cPvo2tI8ErBxsX3tPi94Gm9zNJmnBPL3VJzr+GIuBd6P03T 4WHv74hRekAVzy3T1OJ5sCxHWYzq X-Google-Smtp-Source: APXvYqym6pW15WaxvVlZBWtwM+G8p0eGlOCIoLqLAlTYMY641bBawAkLJPcVDFtK7m5+2MG5grI5nA== X-Received: by 2002:a05:600c:2208:: with SMTP id z8mr29269740wml.89.1555481906127; Tue, 16 Apr 2019 23:18:26 -0700 (PDT) From: Paolo Bonzini To: patchew-devel@redhat.com Date: Wed, 17 Apr 2019 08:18:24 +0200 Message-Id: <20190417061825.2552-2-pbonzini@redhat.com> In-Reply-To: <20190417061825.2552-1-pbonzini@redhat.com> References: <20190417061825.2552-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Wed, 17 Apr 2019 06:18:28 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Wed, 17 Apr 2019 06:18:28 +0000 (UTC) for IP:'209.85.128.50' DOMAIN:'mail-wm1-f50.google.com' HELO:'mail-wm1-f50.google.com' FROM:'paolo.bonzini@gmail.com' RCPT:'' X-RedHat-Spam-Score: 0.24 (DKIM_SIGNED, DKIM_VALID, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE, SPF_PASS) 209.85.128.50 mail-wm1-f50.google.com 209.85.128.50 mail-wm1-f50.google.com X-RedHat-Possible-Forgery: Paolo Bonzini X-Scanned-By: MIMEDefang 2.78 on 10.5.110.38 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: patchew-devel@redhat.com Subject: [Patchew-devel] [PATCH 1/2] models: refine diffstat regexes 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: , Content-Transfer-Encoding: quoted-printable Sender: patchew-devel-bounces@redhat.com Errors-To: patchew-devel-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Wed, 17 Apr 2019 06:18:34 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Avoid false positives by making the regexes more strict, and add a new regex for binary diffs. Signed-off-by: Paolo Bonzini --- api/models.py | 5 +- tests/data/0008-complex-diffstat.mbox.gz | Bin 4961 -> 2575 bytes tests/test_model.py | 95 +++-------------------- 3 files changed, 16 insertions(+), 84 deletions(-) diff --git a/api/models.py b/api/models.py index f3e8211..4e28614 100644 --- a/api/models.py +++ b/api/models.py @@ -687,12 +687,15 @@ class Message(models.Model): cur =3D [] patterns =3D [ r"\S*\s*\|\s*[0-9]*( \+*-*)?$", + r"\S*\s*\|\s*Bin", r"\S* =3D> \S*\s*|\s*[0-9]* \+*-*$", r"[0-9]* files changed", r"1 file changed", r"(create|delete) mode [0-7]+", r"mode change [0-7]+", - r"rename ", + r"rename .*\([0-9]+%\)$", + r"copy .*\([0-9]+%\)$", + r"rewrite .*\([0-9]+%\)$", ] ret =3D [] for l in self.get_body().splitlines(): diff --git a/tests/data/0008-complex-diffstat.mbox.gz b/tests/data/0008-com= plex-diffstat.mbox.gz index ac3e72803579d37901735c7ba5e7614792685980..3b530246d1623450c1b28a2f9ae= 7f0cad9185fc3 100644 GIT binary patch literal 2575 zcmV+q3h?zGiwFQnOtxGC1HD&mbK*D>{v7`bRranbsYJ#v7{AOg7XoA^b(7s}$n5Ub zREm;q8MKQnuVp8&clY0~WenJ0aDx~q)nf<4oWhWL?th{Y+-a++PGBoF5FMdjH{d7uFWnGjFzZ#7ukMLvfcSwM2e6Z}9$vB-so;-xCx0(Tb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a^)Vk?BMs5;qi8hHEW<|%~ zCNfOvLT=3D_#xjaf@6^ADzDy$xKl-1;QRUHy@X2hL;BwD~W3=3DlLWU1izR0IjMoMGRlb zMKWzu+3v6+)|DM5vDk)%LBa*`T2VeE{yXcqEy~lSuO&t+Rq>z}^ncaXcx_L4J+$)-YlkeRXF*2MU>jV9aZP}xrZbp-`cwk-3xWIBI3vA7ZRe*zz(WXr{< zCisRk#nv>9ldW2{8HX0c3mhI}X3Q3IHYQzW} z4bn8aKEUHUYrD(!x8OoQ?ON}75DDCVi`8vV4D`rjKRWUd8ZP@#5eJD)TWBmoVsO9w zYE)SwCMa8^-6K${^9B=3Dx0WE!V1S&NyXm&MJD-ZlzCtpFl`=3D}Quh}<<`r8zvtU=3D;%Y zUCVoQT<=3D|vLvYnc)`=3DfQ+l|ELxJ~!tbZ4PITiHykleP#NH?gNu&8DlSEnudSyhgm$ zm}VTNiJyeflxnUfMnn05d7)ns(^UDCuHyEGtn9R!!D6u7h7A~W^nm%IM*nzqm-Ka{ zsBwA99%eeLB3A9y44GTSy|v^(MJ%z+iTshCW{6GPdo4ymD{tHVeb#QH3WHeEtwR#a z-4}cNG*9>SvacT5dseynM|1<_Hk-Xp=3Dh5ZJDnAgvpJ?-DW0jXOwZs42FrhuR)f`xC zx7Yj6Bl<7)oQE}DS!lLBT&^!$o~MHwl)Z1*efaPykZsiAq0#kmg6%~t=3DFp8t?rpt` zY|tnEyJ&GwZdeD_?r=3D!S@F2q{G_eEgU$#5wJ-~9UlRVbf4lL5t=3D(!=3DZ6?|^=3D;wm^k fcBpdlgXeI-vh9Ob(`q?=3Dr(^vO!;17^$2kB1d~k^J diff --git a/tests/test_model.py b/tests/test_model.py index 704c658..3256b4c 100755 --- a/tests/test_model.py +++ b/tests/test_model.py @@ -22,89 +22,18 @@ class ImportTest(PatchewTestCase): =20 def test_get_diff_stat(self): expected =3D """ -MAINTAINERS | 7 + -Makefile | 9 +- -Makefile.objs | 2 + -Makefile.target | 2 + -block/qapi.c | 4 +- -blockdev.c | 4 +- -configure | 36 ++ -crypto/tlssession.c | 28 +- -docs/qapi-code-gen.txt | 4 +- -hmp.c | 16 +- -include/qapi/qmp-input-visitor.h | 30 - -include/qapi/qmp/qdict.h | 1 + -include/qapi/qobject-input-visitor.h | 85 +++ -...p-output-visitor.h =3D> qobject-output-visitor.h} | 10 +- -include/qemu/acl.h | 66 --- -include/qemu/authz-pam.h | 98 ++++ -include/qemu/authz-simple.h | 115 ++++ -include/qemu/authz.h | 89 +++ -include/qemu/option.h | 4 + -include/qom/object_interfaces.h | 10 +- -monitor.c | 184 ++++-- -qapi-schema.json | 6 +- -qapi/Makefile.objs | 4 +- -qapi/opts-visitor.c | 19 +- -qapi/qapi-clone-visitor.c | 2 +- -qapi/qmp-input-visitor.c | 412 -------------- -qapi/qmp-output-visitor.c | 256 --------- -qapi/qobject-input-visitor.c | 624 +++++++++++++++++= ++++ -qapi/qobject-output-visitor.c | 254 +++++++++ -qapi/util.json | 47 ++ -qemu-img.c | 8 +- -qmp.c | 6 +- -qobject/qdict.c | 283 ++++++++++ -qom/object_interfaces.c | 47 +- -qom/qom-qobject.c | 8 +- -scripts/qapi-commands.py | 8 +- -scripts/qapi-event.py | 4 +- -tests/.gitignore | 7 +- -tests/Makefile.include | 25 +- -tests/check-qdict.c | 241 ++++++++ -tests/check-qnull.c | 8 +- -tests/check-qom-proplist.c | 314 ++++++++++- -tests/test-authz-simple.c | 172 ++++++ -tests/test-crypto-tlssession.c | 15 +- -tests/test-io-channel-tls.c | 16 +- -tests/test-qmp-commands.c | 4 +- -...-input-strict.c =3D> test-qobject-input-strict.c} | 4 +- -...nput-visitor.c =3D> test-qobject-input-visitor.c} | 154 ++++- -...put-visitor.c =3D> test-qobject-output-visitor.c} | 4 +- -tests/test-string-input-visitor.c | 2 +- -tests/test-string-output-visitor.c | 2 +- -tests/test-visitor-serialization.c | 8 +- -ui/vnc-auth-sasl.c | 2 +- -ui/vnc-auth-sasl.h | 4 +- -ui/vnc.c | 11 +- -util/Makefile.objs | 7 +- -util/acl.c | 179 ------ -util/authz-pam.c | 148 +++++ -util/authz-simple.c | 314 +++++++++++ -util/authz.c | 47 ++ -util/qemu-option.c | 27 +- -util/qemu-sockets.c | 4 +- -62 files changed, 3354 insertions(+), 1157 deletions(-) -delete mode 100644 include/qapi/qmp-input-visitor.h -create mode 100644 include/qapi/qobject-input-visitor.h -rename include/qapi/{qmp-output-visitor.h =3D> qobject-output-visitor.h} (= 66%) -delete mode 100644 include/qemu/acl.h -create mode 100644 include/qemu/authz-pam.h -create mode 100644 include/qemu/authz-simple.h -create mode 100644 include/qemu/authz.h -delete mode 100644 qapi/qmp-input-visitor.c -delete mode 100644 qapi/qmp-output-visitor.c -create mode 100644 qapi/qobject-input-visitor.c -create mode 100644 qapi/qobject-output-visitor.c -create mode 100644 qapi/util.json -create mode 100644 tests/test-authz-simple.c -rename tests/{test-qmp-input-strict.c =3D> test-qobject-input-strict.c} (9= 9%) -rename tests/{test-qmp-input-visitor.c =3D> test-qobject-input-visitor.c} = (86%) -rename tests/{test-qmp-output-visitor.c =3D> test-qobject-output-visitor.c= } (99%) -delete mode 100644 util/acl.c -create mode 100644 util/authz-pam.c -create mode 100644 util/authz-simple.c -create mode 100644 util/authz.c +hw/display/Kconfig | 5 +++++ +hw/display/Makefile.objs | 1 + +hw/{i2c =3D> display}/i2c-ddc.c | 2 +- +hw/display/sii9022.c | 2 +- +hw/display/sm501.c | 2 +- +hw/i2c/Kconfig | 5 ----- +hw/i2c/Makefile.objs | 1 - +include/hw/{i2c =3D> display}/i2c-ddc.h | 0 +include/hw/display/xlnx_dp.h | 2 +- +9 files changed, 10 insertions(+), 10 deletions(-) +rename hw/{i2c =3D> display}/i2c-ddc.c (99%) +rename include/hw/{i2c =3D> display}/i2c-ddc.h (100%) """ self.cli_import("0008-complex-diffstat.mbox.gz") msg =3D Message.objects.first() --=20 2.21.0 _______________________________________________ Patchew-devel mailing list Patchew-devel@redhat.com https://www.redhat.com/mailman/listinfo/patchew-devel From nobody Thu Dec 26 15:26:22 2024 Delivered-To: importer2@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=patchew-devel-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 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=1555481917; cv=none; d=zoho.com; s=zohoarc; b=YQCgRcuHlgKUUYIDxvYS8q5xPtjpNTW8H9fR6hNyAGKqwDGFrLppJUgZot5jbHXkLQKVlfF+MD8XzfwuiBS0W0t9rgoNfZJI3IVh7zrv8hyghVKA3kz8zzgRYH94jTKuR3TYfSXHKkglE1yydE5jTYQvz3I9WxhoiZGEXOLIGWc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1555481917; 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:ARC-Authentication-Results; bh=2FxgKVBBa+M6N3ORUqE5YYuYptYWlQYGG7kIQ6tBBeM=; b=mVB8stWt8ODVZJUyu2UygkeTzDPCh5cCRWBj0dGPz/OltKtZ1Oj/mgrMZDWAyGToWpeVMdMKR/8tZcRmpzwIfYPnLtGTujMmuhVn6CRORIRwz73gUnIPfU6gpNpqTZfmgUZLeD5xUPiO+YpwA3DKqdRnkS9ujc1qABVfSPBHFLQ= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=patchew-devel-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1555481917523249.49436020619203; Tue, 16 Apr 2019 23:18:37 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4FB6D307EA82; Wed, 17 Apr 2019 06:18:36 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 44B7C5D9D3; Wed, 17 Apr 2019 06:18:36 +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 3A08E41F3D; Wed, 17 Apr 2019 06:18:36 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x3H6IXBS001829 for ; Wed, 17 Apr 2019 02:18:33 -0400 Received: by smtp.corp.redhat.com (Postfix) id 09A7F608C6; Wed, 17 Apr 2019 06:18:33 +0000 (UTC) Received: from mx1.redhat.com (ext-mx11.extmail.prod.ext.phx2.redhat.com [10.5.110.40]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 01CE2608C1 for ; Wed, 17 Apr 2019 06:18:30 +0000 (UTC) Received: from mail-wr1-f47.google.com (mail-wr1-f47.google.com [209.85.221.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D09AC3084212 for ; Wed, 17 Apr 2019 06:18:28 +0000 (UTC) Received: by mail-wr1-f47.google.com with SMTP id k11so30277809wro.5 for ; Tue, 16 Apr 2019 23:18:28 -0700 (PDT) Received: from donizetti.lan ([2001:b07:6468:f312:ac27:aac4:c65c:6eb]) by smtp.gmail.com with ESMTPSA id k4sm81976689wro.33.2019.04.16.23.18.26 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 16 Apr 2019 23:18:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=c22LvM4YgV4sdMPZ2/968ygxBgzKFaiqOC+HAS9KeMA=; b=TQ4ypCs2RwBi3Wr8x6mVWdy5e5PyR6Zp+0tnKnaDHgux7RXEZr51zW9oRDI96nVzak pcasqRe1ul1YbpJQJidtyzXfaipZ7R26BQKtxDRMpNJcqWvJCxg6wDUYskxEBOHHg63m yMhLKV5FblJUK5SUmT4OZaPvwnirMd3bwXAV654CKBG8f5RIyxLitq8M3KABO0/IYK27 PW6eVCQ4Ww+yEDXGyfFdXuKSwBABzdnc+wIDVgkDn1WrnIHW9I6sX15E3ppCu4YSIpnE dDKPdD1sJ4NM2AIDaPK4FxSoO79VKGfw4+l/8OnPHJbGlEOZBC9C0eYxwoOIMRIFDuL7 OI9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=c22LvM4YgV4sdMPZ2/968ygxBgzKFaiqOC+HAS9KeMA=; b=Qym+sZY6eaVnqV0zWhn48nBi8cxwrXfh6X2ArPoiJsWzPr3mnBbl0h2hF0mO6GPbpN tdIxeWKJfuxSHHMG7U21CajM09/kTO3T9AHLYoQ7MKCrmVARd1fV3Q/6AR1pHxh/8vze pFu7G6jlOrqkxZ3dyi1jvMLTJF/8YpapiNyJ/zyMUxHVb1ruq/BcPyCvQTv0zIaaGUjQ F9gcPd0PG2kVLo0u1cT96Zq8csYzirhOwMek+6bLMz8w7imKcFLBBdfbmfDgnjUtnkQB 5T0QepQPU202TIBTRlzzqdgKBs1f43pgvXBCxImfkEhqSZiWPW+MGjuXvM9tbIe6TI+w 19+Q== X-Gm-Message-State: APjAAAVvsh/qTFJilsQF7r2LNMDHD4k3l+jRhK+Yfj/54qFmKc+/Svx+ m8ou0O6ln8jUuDzhIpIVCwf6cwdK X-Google-Smtp-Source: APXvYqxpJ+PCueosCM3S6GsQSuzARf+xD1zsWCI4Ikd0QK1i+b5HneflzxazjezxxI9bj9U7JgHKeg== X-Received: by 2002:a5d:494c:: with SMTP id r12mr20480809wrs.250.1555481907028; Tue, 16 Apr 2019 23:18:27 -0700 (PDT) From: Paolo Bonzini To: patchew-devel@redhat.com Date: Wed, 17 Apr 2019 08:18:25 +0200 Message-Id: <20190417061825.2552-3-pbonzini@redhat.com> In-Reply-To: <20190417061825.2552-1-pbonzini@redhat.com> References: <20190417061825.2552-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Wed, 17 Apr 2019 06:18:29 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Wed, 17 Apr 2019 06:18:29 +0000 (UTC) for IP:'209.85.221.47' DOMAIN:'mail-wr1-f47.google.com' HELO:'mail-wr1-f47.google.com' FROM:'paolo.bonzini@gmail.com' RCPT:'' X-RedHat-Spam-Score: 0.24 (DKIM_SIGNED, DKIM_VALID, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE, SPF_PASS) 209.85.221.47 mail-wr1-f47.google.com 209.85.221.47 mail-wr1-f47.google.com X-RedHat-Possible-Forgery: Paolo Bonzini X-Scanned-By: MIMEDefang 2.84 on 10.5.110.40 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: patchew-devel@redhat.com Subject: [Patchew-devel] [PATCH 2/2] models: stop diffstat extraction at "---" line 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: , Content-Transfer-Encoding: quoted-printable Sender: patchew-devel-bounces@redhat.com Errors-To: patchew-devel-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Wed, 17 Apr 2019 06:18:36 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Simplify the loop by using "for/else" and by assigning "ret =3D cur" after every cur.append (instead of doing that on the first non-matching line). Then it becomes simpler to add another loop break when a diffstat was found and a "---" line is found. Signed-off-by: Paolo Bonzini --- api/models.py | 12 ++++-------- tests/data/0029-diffstat-in-patch.gz | Bin 0 -> 13474 bytes tests/test_model.py | 13 +++++++++++++ 3 files changed, 17 insertions(+), 8 deletions(-) create mode 100644 tests/data/0029-diffstat-in-patch.gz diff --git a/api/models.py b/api/models.py index 4e28614..d2dafde 100644 --- a/api/models.py +++ b/api/models.py @@ -700,19 +700,15 @@ class Message(models.Model): ret =3D [] for l in self.get_body().splitlines(): line =3D l.strip() - match =3D False for p in patterns: if re.match(p, line): - match =3D True + cur.append(line) + ret =3D cur break - if match: - cur.append(line) else: - if cur: - ret =3D cur cur =3D [] - if cur: - ret =3D cur + if ret and re.match(r'--- \S', line): + break return "\n".join(ret) =20 def get_message_view_url(self): diff --git a/tests/data/0029-diffstat-in-patch.gz b/tests/data/0029-diffsta= t-in-patch.gz new file mode 100644 index 0000000000000000000000000000000000000000..3086e492536f850d1b263504aac= c700e5741b803 GIT binary patch literal 13474 zcmV;TG+oOdiwFRh!nRxj1J%4~pPJedH~Kn$3f&IJVbcu=3DDA72A^E~T$j*864B;bVF zpZzZEPSTxplHU71_r>jBI*qWZR#mMU{7#g6KJXULK_la{U)D^+a(Js?G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yXtVYPV9*}H$0 zcE390v(_&ell>SmnohnlrpM&HKx99lJM>Hpe!oic5gESg?md480^)1Q(lkcr{_xn* zFNpaA@4Z9m{Lx^1#%2!y5Xz!%e5h2vz@cx%-}1mqLi=3DNl#$OSG1jKHk4=3Dx*6G7Ry5 zU$8eU^u4NnD3iRH?F}(lIMXsr@1elo@VNSu$m{s~#>M*|dQ*FTn+cE<>VK=3DloxwBY zf&K`2ylnW|hIeAwfV_v7bYArs{CfWHP~{b|m&(4m9s3c#0f^xxY1xkTym)uG@XYQ_ zR{J{O_LlsIjQ1<*ZzDW%bNCa3A5-A%C%?ZB_vF*XKd0dDb>wH_KW5u^iC>08 zHgCy{D!cdhJ^q6D*=3DhIk<3VTdt_InR{Q-x6HSN~NAD*s7UK~kjuYo&c=3D@C{h9A7g+$1I)x5`aeha`tESH-=3D_|n>N}{JJ82mNlf3L9whQn_Le^ub5>ZcWFzApD)1t))cO#u8; zYKPw@_QZ?h{>lE&9+~(dG5<-2DDWgecHgW0Chh$>c2<>F&+q$>{`K2O)c=3DZor_^lm zzV-X^K7ohl2(ljp*|MD|2pGuQQAQt7?~Pc#)j#|3y?Lk4{l!S$i#WU{;_ao^Z#el^ Q?{)cq0G4j;9UEZ)0OoSojQ{`u literal 0 HcmV?d00001 diff --git a/tests/test_model.py b/tests/test_model.py index 3256b4c..333a7bc 100755 --- a/tests/test_model.py +++ b/tests/test_model.py @@ -19,6 +19,7 @@ class ImportTest(PatchewTestCase): self.create_superuser() self.cli_login() self.add_project("QEMU", "qemu-devel@nongnu.org") + self.add_project("Patchew", "patchew-devel@redhat.com") =20 def test_get_diff_stat(self): expected =3D """ @@ -40,6 +41,18 @@ rename include/hw/{i2c =3D> display}/i2c-ddc.h (100%) self.maxDiff =3D 100000 self.assertMultiLineEqual(expected.strip(), msg.get_diff_stat()) =20 + def test_diff_stat_in_patch(self): + expected =3D """ +api/models.py | 4 +- +tests/data/0008-complex-diffstat.mbox.gz | Bin 4961 -> 2575 bytes +tests/test_model.py | 95 +++-------------------- +3 files changed, 15 insertions(+), 84 deletions(-) +""" + self.cli_import("0029-diffstat-in-patch.gz") + msg =3D Message.objects.first() + self.maxDiff =3D 100000 + self.assertMultiLineEqual(expected.strip(), msg.get_diff_stat()) + def test_mode_change_diff_stat(self): expected =3D """ tests/qemu-iotests/096 | 0 --=20 2.21.0 _______________________________________________ Patchew-devel mailing list Patchew-devel@redhat.com https://www.redhat.com/mailman/listinfo/patchew-devel