From: Paul Eggleton Date: Wed, 29 Nov 2017 01:20:25 +0000 (+1300) Subject: devtool: modify: pick up commits from previously created source tree X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=14d9372e1dd715028f9ec181ffda89e43c7cb867;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git devtool: modify: pick up commits from previously created source tree If you use devtool modify, then devtool reset, keep the source tree and then devtool modify on the same recipe with the -n option to re-use the existing source tree, we should pick up the commit hashes properly from the source tree so that later on devtool finish has these to compare to the commits in the tree at that time. We also need to be careful the second time around that we only get the original commits rather than the current HEAD which may be the result of user changes (hence using "devtool-patched", the tag that was placed at the original HEAD). Signed-off-by: Paul Eggleton --- diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py index a6656e4e67e..ae48406bea9 100644 --- a/scripts/lib/devtool/standard.py +++ b/scripts/lib/devtool/standard.py @@ -750,13 +750,11 @@ def modify(args, config, basepath, workspace): initial_rev = None commits = [] check_commits = False + torev = 'HEAD' if not args.no_extract: ret = _extract_source(srctree, args.keep_temp, args.branch, False, config, basepath, workspace, args.fixed_setup, rd, tinfoil, no_overrides=args.no_overrides) initial_rev = ret.initial_rev logger.info('Source tree extracted to %s' % srctree) - # Get list of commits since this revision - (stdout, _) = bb.process.run('git rev-list --reverse %s..HEAD' % initial_rev, cwd=srctree) - commits = stdout.split() check_commits = True else: if os.path.exists(os.path.join(srctree, '.git')): @@ -767,6 +765,7 @@ def modify(args, config, basepath, workspace): stdout = '' if stdout: check_commits = True + torev = 'devtool-patched' for line in stdout.splitlines(): if line.startswith('*'): (stdout, _) = bb.process.run('git rev-parse devtool-base', cwd=srctree) @@ -776,6 +775,11 @@ def modify(args, config, basepath, workspace): (stdout, _) = bb.process.run('git rev-parse HEAD', cwd=srctree) initial_rev = stdout.rstrip() + if initial_rev: + # Get list of commits since this revision + (stdout, _) = bb.process.run('git rev-list --reverse %s..%s' % (initial_rev, torev), cwd=srctree) + commits = stdout.split() + branch_patches = {} if check_commits: # Check if there are override branches