Use repository.clone function to clone mozilla-central instead of re-implementing the code in the script

This commit is contained in:
Marco Castelluccio 2019-07-19 15:46:57 +02:00
Родитель 0e43fb69a2
Коммит 331aa50f1f
1 изменённых файлов: 2 добавлений и 18 удалений

Просмотреть файл

@ -5,9 +5,9 @@ import os
import subprocess
from logging import INFO, basicConfig, getLogger
import hglib
from microannotate import generator
from bugbug import repository
from bugbug.utils import get_secret, retry
basicConfig(level=INFO)
@ -22,23 +22,7 @@ class MicroannotateGenerator(object):
self.repo_dir = os.path.join(cache_root, "mozilla-central")
def generate(self):
shared_dir = self.repo_dir + "-shared"
cmd = hglib.util.cmdbuilder(
"robustcheckout",
"https://hg.mozilla.org/mozilla-central",
self.repo_dir,
purge=True,
sharebase=shared_dir,
networkattempts=7,
branch=b"tip",
)
cmd.insert(0, hglib.HGPATH)
proc = hglib.util.popen(cmd)
out, err = proc.communicate()
if proc.returncode:
raise hglib.error.CommandError(cmd, proc.returncode, out, err)
repository.clone(self.repo_dir)
logger.info("mozilla-central cloned")