summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2018-03-29 16:13:59 +1300
committerPaul Eggleton <paul.eggleton@linux.intel.com>2018-05-04 23:57:53 +1200
commit519236490dad3851e0047790b123902f30e343a8 (patch)
tree568b64b1767ea314869a772bb194fb54533fe36a
parent58c56883fd14692c25aee1e5e2c153fec3a85db0 (diff)
downloadopenembedded-core-contrib-519236490dad3851e0047790b123902f30e343a8.tar.gz
openembedded-core-contrib-519236490dad3851e0047790b123902f30e343a8.tar.bz2
openembedded-core-contrib-519236490dad3851e0047790b123902f30e343a8.zip
rrs_maintainer_history: avoid unnecessary checkouts
We don't actually need to check out the repository until we actually analyse a commit, so avoid doing so. Additionally, there's not much point in checking out master at the end, let the next script invocation do that if needed (if it needs to, it should since otherwise there's no guarantee what state the repository is in). Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
-rwxr-xr-xrrs/tools/rrs_maintainer_history.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/rrs/tools/rrs_maintainer_history.py b/rrs/tools/rrs_maintainer_history.py
index 72681be107..6585f5bf55 100755
--- a/rrs/tools/rrs_maintainer_history.py
+++ b/rrs/tools/rrs_maintainer_history.py
@@ -94,14 +94,14 @@ def maintainer_history(options, logger):
repodir = os.path.join(fetchdir, urldir)
layerdir = os.path.join(repodir, layerbranch.vcs_subdir)
- utils.runcmd("git checkout master -f", layerdir, logger=logger)
maintainers_full_path = os.path.join(layerdir, MAINTAINERS_INCLUDE_PATH)
if not os.path.exists(maintainers_full_path):
logger.debug('No maintainers.inc for %s, skipping' % layerbranch)
continue
- commits = utils.runcmd("git log --format='%H' --reverse --date=rfc " +
- os.path.join(layerbranch.vcs_subdir, MAINTAINERS_INCLUDE_PATH), repodir, logger=logger)
+ commits = utils.runcmd("git log --format='%%H' --reverse --date=rfc origin/master %s"
+ % os.path.join(layerbranch.vcs_subdir, MAINTAINERS_INCLUDE_PATH),
+ repodir, logger=logger)
try:
with transaction.atomic():
@@ -156,8 +156,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", repodir, logger=logger)
-
# set new recipes to no maintainer if don't have one
rms = RecipeMaintainerHistory.get_last()
for recipe in layerbranch.recipe_set.all():