From 377c9e859fee0eea489cd67d92303e5f893c0827 Mon Sep 17 00:00:00 2001 From: Louis Abel Date: Tue, 27 Jun 2023 18:57:38 -0700 Subject: [PATCH] hotfix: rearrange calls in importer --- importer/operation.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/importer/operation.py b/importer/operation.py index edf6037..c2a2b44 100644 --- a/importer/operation.py +++ b/importer/operation.py @@ -211,21 +211,21 @@ class SrpmImport(Import): branch=branch ) + # pylint: disable=line-too-long + import_tag = generic.safe_encoding(f'imports/{branch}/{self.rpm_name}-{self.rpm_version}-{self.rpm_release}') + commit_msg = f'import {self.rpm_name}-{self.rpm_version}-{self.rpm_release}' + # Raise an error if the tag already exists. Force the importer to tag + # manually. + if import_tag in repo_tags: + shutil.rmtree(git_repo_path) + raise err.GitCommitError(f'Git tag already exists: {import_tag}') + self.unpack_srpm(self.srpm_path, git_repo_path) sources = self.get_dict_of_lookaside_files(git_repo_path) self.generate_metadata(git_repo_path, self.rpm_name, sources) self.generate_filesum(git_repo_path, self.rpm_name, self.srpm_hash) self.import_lookaside(git_repo_path, self.rpm_name, branch, sources) gitutil.add_all(repo) - # pylint: disable=line-too-long - import_tag = generic.safe_encoding(f'imports/{branch}/{self.rpm_name}-{self.rpm_version}-{self.rpm_release}') - commit_msg = f'import {self.rpm_name}-{self.rpm_version}-{self.rpm_release}' - - # Raise an error if the tag already exists. Force the importer to tag - # manually. - if import_tag in repo_tags: - shutil.rmtree(git_repo_path) - raise err.GitCommitError(f'Git tag already exists: {import_tag}') verify = repo.is_dirty() if verify: