From: "Arthur Zamarin" <arthurzam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/pkgcore/pkgcheck:master commit in: src/pkgcheck/addons/, tests/checks/
Date: Mon, 9 Jan 2023 18:02:54 +0000 (UTC) [thread overview]
Message-ID: <1673287311.3c01e94cebda01041319903c8f5da382fcc96142.arthurzam@gentoo> (raw)
commit: 3c01e94cebda01041319903c8f5da382fcc96142
Author: Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
AuthorDate: Mon Jan 9 17:23:19 2023 +0000
Commit: Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
CommitDate: Mon Jan 9 18:01:51 2023 +0000
URL: https://gitweb.gentoo.org/proj/pkgcore/pkgcheck.git/commit/?id=3c01e94c
git checks: include revision for old name during rename op
Previously it was including only the version without a revision, which
was failing and crashing the git check. This fixes it by including the
revision using the "fullver" property.
Include a reproducer test which fails without this commit and passes
with it.
Reported-by: Sam James <sam <AT> gentoo.org>
Reported-by: David Seifert <soap <AT> gentoo.org>
Resolves: https://github.com/pkgcore/pkgcheck/issues/511
Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org>
src/pkgcheck/addons/git.py | 2 +-
tests/checks/test_git.py | 29 +++++++++++++++++++++++++++++
2 files changed, 30 insertions(+), 1 deletion(-)
diff --git a/src/pkgcheck/addons/git.py b/src/pkgcheck/addons/git.py
index 26c1d06d..9fd016ce 100644
--- a/src/pkgcheck/addons/git.py
+++ b/src/pkgcheck/addons/git.py
@@ -280,7 +280,7 @@ class _GitCommitPkg(cpv.VersionedCPV):
self.old.category,
self.old.package,
self.status,
- self.old.version,
+ self.old.fullver,
self.time,
self.commit,
)
diff --git a/tests/checks/test_git.py b/tests/checks/test_git.py
index 1cefd549..0294f0b3 100644
--- a/tests/checks/test_git.py
+++ b/tests/checks/test_git.py
@@ -621,6 +621,35 @@ class TestGitPkgCommitsCheck(ReportTestCase):
self.init_check()
self.assertNoReport(self.check, self.source)
+ def test_revision_move(self):
+ self.parent_git_repo.move(
+ "cat/pkg/pkg-0.ebuild",
+ "cat/pkg/pkg-0-r1.ebuild",
+ msg="cat/pkg: some random fixes",
+ )
+ self.parent_repo.create_ebuild("cat/newpkg-0-r1", keywords=["~amd64"])
+ self.parent_git_repo.add_all("cat/newpkg: new package, v0")
+
+ self.child_git_repo.run(["git", "pull", "origin", "main"])
+ self.child_git_repo.run(["git", "remote", "set-head", "origin", "main"])
+
+ # moving revision version won't crash check
+ self.child_git_repo.move(
+ "cat/pkg/pkg-0-r1.ebuild",
+ "cat/pkg/pkg-0-r2.ebuild",
+ msg="cat/pkg: some extra random fixes",
+ signoff=True,
+ )
+ self.child_git_repo.move(
+ "cat/newpkg/newpkg-0-r1.ebuild",
+ "cat/newpkg/newpkg-0-r2.ebuild",
+ msg="cat/newpkg: some random fixes",
+ signoff=True,
+ )
+
+ self.init_check()
+ self.assertNoReport(self.check, self.source)
+
class TestGitEclassCommitsCheck(ReportTestCase):
reply other threads:[~2023-01-09 18:02 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1673287311.3c01e94cebda01041319903c8f5da382fcc96142.arthurzam@gentoo \
--to=arthurzam@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox