mirror of
git://git.yoctoproject.org/layerindex-web.git
synced 2025-07-19 03:49:10 +02:00
rrs/tools: avoid unnecessary checkouts
We don't need to create branches here, and we don't need to actually check anything out unless we're going to parse, so we can save a bit of time by not doing so. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
This commit is contained in:
parent
6f34b7fce7
commit
8370c10306
|
@ -107,8 +107,7 @@ def maintainer_history(options, logger):
|
|||
sha1=commit)
|
||||
rms.save()
|
||||
|
||||
branchname = 'maintainer' + commit
|
||||
utils.runcmd("git checkout %s -b %s -f" % (commit, branchname),
|
||||
utils.runcmd("git checkout %s -f" % commit,
|
||||
pokypath, logger=logger)
|
||||
|
||||
lines = [line.strip() for line in open(maintainers_full_path)]
|
||||
|
@ -145,9 +144,6 @@ def maintainer_history(options, logger):
|
|||
logger.debug("%s: Not found maintainer in commit %s set to 'No maintainer'." % \
|
||||
(recipe.pn, rms.sha1))
|
||||
|
||||
utils.runcmd("git checkout master -f", pokypath, logger=logger)
|
||||
utils.runcmd("git branch -D %s" % (branchname), pokypath, logger=logger)
|
||||
|
||||
# set new recipes to no maintainer if don't have one
|
||||
m = Maintainer.objects.get(id = 0) # No Maintainer
|
||||
rms = RecipeMaintainerHistory.get_last()
|
||||
|
|
|
@ -34,7 +34,6 @@ fetchdir = settings.LAYER_FETCH_DIR
|
|||
if not fetchdir:
|
||||
logger.error("Please set LAYER_FETCH_DIR in settings.py")
|
||||
sys.exit(1)
|
||||
branch_name_tmp = "recipe_upgrades"
|
||||
|
||||
# setup bitbake
|
||||
bitbakepath = os.path.join(fetchdir, 'bitbake')
|
||||
|
@ -151,7 +150,7 @@ def do_initial(layerbranch, ct, logger, dry_run):
|
|||
repodir = os.path.join(fetchdir, urldir)
|
||||
layerdir = os.path.join(repodir, str(layerbranch.vcs_subdir))
|
||||
|
||||
utils.runcmd("git checkout %s -b %s -f" % (ct, branch_name_tmp),
|
||||
utils.runcmd("git checkout %s" % ct,
|
||||
repodir, logger=logger)
|
||||
utils.runcmd("git clean -dfx", repodir, logger=logger)
|
||||
|
||||
|
@ -171,8 +170,6 @@ def do_initial(layerbranch, ct, logger, dry_run):
|
|||
except DryRunRollbackException:
|
||||
pass
|
||||
|
||||
utils.runcmd("git checkout master -f", repodir, logger=logger)
|
||||
utils.runcmd("git branch -D %s" % (branch_name_tmp), repodir, logger=logger)
|
||||
tinfoil.shutdown()
|
||||
|
||||
def do_loop(layerbranch, ct, logger, dry_run):
|
||||
|
@ -181,14 +178,12 @@ def do_loop(layerbranch, ct, logger, dry_run):
|
|||
repodir = os.path.join(fetchdir, urldir)
|
||||
layerdir = os.path.join(repodir, str(layerbranch.vcs_subdir))
|
||||
|
||||
utils.runcmd("git checkout %s -b %s -f" % (ct, branch_name_tmp),
|
||||
utils.runcmd("git checkout %s" % ct,
|
||||
repodir, logger=logger)
|
||||
utils.runcmd("git clean -dfx", repodir, logger=logger)
|
||||
|
||||
fns = _get_recipes_filenames(ct, repodir, layerdir, logger)
|
||||
if not fns:
|
||||
utils.runcmd("git checkout master -f", repodir, logger=logger)
|
||||
utils.runcmd("git branch -D %s" % (branch_name_tmp), repodir, logger=logger)
|
||||
return
|
||||
|
||||
(tinfoil, d, recipes) = load_recipes(layerbranch, bitbakepath,
|
||||
|
@ -209,8 +204,6 @@ def do_loop(layerbranch, ct, logger, dry_run):
|
|||
except DryRunRollbackException:
|
||||
pass
|
||||
|
||||
utils.runcmd("git checkout master -f", repodir, logger=logger)
|
||||
utils.runcmd("git branch -D %s" % (branch_name_tmp), repodir, logger=logger)
|
||||
tinfoil.shutdown()
|
||||
|
||||
|
||||
|
@ -237,14 +230,6 @@ def upgrade_history(options, logger):
|
|||
repodir = os.path.join(fetchdir, urldir)
|
||||
layerdir = os.path.join(repodir, layerbranch.vcs_subdir)
|
||||
|
||||
## try to delete temp_branch if exists
|
||||
try:
|
||||
utils.runcmd("git checkout origin/master -f", repodir)
|
||||
utils.runcmd("git branch -D %s" % (branch_name_tmp), repodir,
|
||||
logger=logger)
|
||||
except:
|
||||
pass
|
||||
|
||||
commits = utils.runcmd("git log --since='" + since +
|
||||
"' --format='%H' --reverse", repodir,
|
||||
logger=logger)
|
||||
|
@ -262,6 +247,9 @@ def upgrade_history(options, logger):
|
|||
logger.debug("Analysing commit %s ..." % ct)
|
||||
do_loop(layerbranch, ct, logger, options.dry_run)
|
||||
|
||||
if commit_list:
|
||||
utils.runcmd("git clean -dfx", repodir, logger=logger)
|
||||
|
||||
if __name__=="__main__":
|
||||
parser = optparse.OptionParser(usage = """%prog [options]""")
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user