diff options
author | Paul Eggleton <paul.eggleton@linux.intel.com> | 2018-03-26 14:53:29 +1300 |
---|---|---|
committer | Paul Eggleton <paul.eggleton@linux.intel.com> | 2018-05-04 23:57:53 +1200 |
commit | 2afa51b1080660bcb975e83d20cd2f045975ea4c (patch) | |
tree | 44d3a8ae82dd6a7c97358a817324f4388aa6c2c0 | |
parent | 000ebf4d59f6a71b8fefa9a1ec7c73240fb24714 (diff) | |
download | openembedded-core-contrib-2afa51b1080660bcb975e83d20cd2f045975ea4c.tar.gz |
rrs_upgrade_history: only look at commits that actually change recipes
Since we're now executing a separate script per commit, we should try
not to do that unless the commit actually touches recipe files in order
to avoid wasting time.
(Whilst it's possible that a change to a bbclass might alter what's in
the recipe, we can ignore that since we are only concerned with actual
upgrades which would always require some sort of change to the recipe or
an include file, so we can safely skip commits that don't do that.)
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
-rwxr-xr-x | rrs/tools/rrs_upgrade_history.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/rrs/tools/rrs_upgrade_history.py b/rrs/tools/rrs_upgrade_history.py index 2dbb07ba23..1c37bea338 100755 --- a/rrs/tools/rrs_upgrade_history.py +++ b/rrs/tools/rrs_upgrade_history.py @@ -23,6 +23,8 @@ from common import common_setup, get_logger common_setup() from layerindex import utils +import git + utils.setup_django() import settings @@ -110,6 +112,9 @@ def upgrade_history(options, logger): since = options.since since_option = '--since="%s" origin/master' % since + repo = git.Repo(repodir) + assert repo.bare == False + commits = utils.runcmd("git log %s --format='%%H %%ct' --reverse" % since_option, repodir, logger=logger) @@ -136,6 +141,25 @@ def upgrade_history(options, logger): if item: ct, ctepoch = item.split() ctdate = datetime.fromtimestamp(int(ctepoch)) + commitobj = repo.commit(ct) + touches_recipe = False + for parent in commitobj.parents: + diff = parent.diff(commitobj) + for diffitem in diff: + if diffitem.a_path.endswith(('.bb', '.inc')) or diffitem.b_path.endswith(('.bb', '.inc')): + # We need to look at this commit + touches_recipe = True + break + if touches_recipe: + break + if not touches_recipe: + # No recipes changed in this commit + # NOTE: Whilst it's possible that a change to a class might alter what's + # in the recipe, we can ignore that since we are only concerned with actual + # upgrades which would always require some sort of change to the recipe + # or an include file, so we can safely skip commits that don't do that + logger.debug("Skipping commit %s" % ct) + continue logger.debug("Analysing commit %s ..." % ct) run_internal(maintplanbranch, ct, ctdate, options, logger, bitbake_map) if not options.dry_run: |