aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2017-11-29 14:20:25 +1300
committerPaul Eggleton <paul.eggleton@linux.intel.com>2017-12-05 14:39:23 +1300
commit14d9372e1dd715028f9ec181ffda89e43c7cb867 (patch)
tree25c10f748ff417f0c7b0217e5d5a0925d3d2627a
parenta8eaa169c4dff9c6751c107b6ee88fd2267b165c (diff)
downloadopenembedded-core-contrib-14d9372e1dd715028f9ec181ffda89e43c7cb867.tar.gz
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 <paul.eggleton@linux.intel.com>
-rw-r--r--scripts/lib/devtool/standard.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py
index a6656e4e67..ae48406bea 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