From nobody Mon Sep 16 19:06:01 2024 Delivered-To: importer@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; 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 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1542766220987119.2313496863037; Tue, 20 Nov 2018 18:10:20 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4B12A3082A2F; Wed, 21 Nov 2018 02:10:20 +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 3DB4B1969C; Wed, 21 Nov 2018 02:10:20 +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 30388181B9E1; Wed, 21 Nov 2018 02:10:20 +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 wAL2AIKf006186 for ; Tue, 20 Nov 2018 21:10:18 -0500 Received: by smtp.corp.redhat.com (Postfix) id 6C14A66082; Wed, 21 Nov 2018 02:10:18 +0000 (UTC) Received: from magic.redhat.com (ovpn-12-78.pek2.redhat.com [10.72.12.78]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4DBA766083; Wed, 21 Nov 2018 02:10:09 +0000 (UTC) From: Fam Zheng To: patchew-devel@redhat.com Date: Wed, 21 Nov 2018 10:08:43 +0800 Message-Id: <20181121020846.7875-14-famz@redhat.com> In-Reply-To: <20181121020846.7875-1-famz@redhat.com> References: <20181121020846.7875-1-famz@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: patchew-devel@redhat.com Cc: ymankad@redhat.com, armbru@redhat.com Subject: [Patchew-devel] [PATCH 13/16] git: Remove unused code for server side git 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: , MIME-Version: 1.0 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.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Wed, 21 Nov 2018 02:10:20 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: Fam Zheng --- mods/git.py | 42 ------------------------------------------ 1 file changed, 42 deletions(-) diff --git a/mods/git.py b/mods/git.py index 58e4bd2..a37de57 100644 --- a/mods/git.py +++ b/mods/git.py @@ -106,36 +106,6 @@ class GitModule(PatchewModule): return False return True =20 - def _update_cache_repo(self, project_name, repo, branch, logf=3DNone): - cache_repo =3D "/var/tmp/patchew-git-cache-%s" % project_name - if not self._is_repo(cache_repo): - # Clone upstream to local cache - subprocess.call(["rm", "-rf", cache_repo], - stdout=3Dsubprocess.PIPE, stderr=3Dsubprocess.= PIPE) - subprocess.check_output(["git", "init", "--bare", - cache_repo]) - remote_name =3D hashlib.sha1(repo).hexdigest() - subprocess.call(["git", "remote", "remove", remote_name], - cwd=3Dcache_repo, - stdout=3Dsubprocess.PIPE, - stderr=3Dsubprocess.PIPE) - subprocess.check_call(["git", "remote", "add", "-f", "--mirror=3Df= etch", - remote_name, repo], cwd=3Dcache_repo, - stdout=3Dlogf, stderr=3Dlogf) - return cache_repo - - def _get_project_repo_and_branch(self, project): - project_git =3D project.git - if not project_git: - raise Exception("Project git repo not set") - if len(project_git.split()) !=3D 2: - # Use master as the default branch - project_git +=3D " master" - upstream, branch =3D project_git.split()[0:2] - if not upstream or not branch: - raise Exception("Project git repo invalid: %s" % project_git) - return upstream, branch - def get_based_on(self, message, request, format): git_base =3D self.get_base(message) return git_base.data if git_base else None @@ -241,18 +211,6 @@ class GitModule(PatchewModule): r =3D base.git_result return r if r and r.data.get("repo") else None =20 - def _poll_project(self, po): - repo, branch =3D self._get_project_repo_and_branch(po) - cache_repo =3D self._update_cache_repo(po.name, repo, branch) - head =3D subprocess.check_output(["git", "rev-parse", branch], - cwd=3Dcache_repo).decode('utf-8').s= trip() - old_head =3D po.get_property("git.head") - if old_head !=3D head: - po.set_property("git.head", head) - po.set_property("git.repo", repo) - emit_event("ProjectGitUpdate", project=3Dpo.name) - return cache_repo - def www_view_git_reset(self, request, series): if not request.user.is_authenticated: raise PermissionDenied --=20 2.17.2 _______________________________________________ Patchew-devel mailing list Patchew-devel@redhat.com https://www.redhat.com/mailman/listinfo/patchew-devel