summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2015-03-04 13:20:37 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-03-20 11:03:11 +0000
commitc20e10543e268ebb43074a3f8d6e7ed991e54ec8 (patch)
tree09b2ae6f2c33dbbdc45bb30c106027900812fee6
parent0c83788b111a761f6f500b86780cc51aed255402 (diff)
downloadopenembedded-core-c20e10543e268ebb43074a3f8d6e7ed991e54ec8.tar.gz
openembedded-core-c20e10543e268ebb43074a3f8d6e7ed991e54ec8.tar.bz2
openembedded-core-c20e10543e268ebb43074a3f8d6e7ed991e54ec8.zip
devtool: modify: get correct initial revision from previously extracted source tree
If you point devtool modify to a source tree previously created by devtool modify or devtool extract, then we need to try to pick up the correct initial revision so that devtool update-recipe knows where to start looking for commits that match up with patches in the recipe. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
-rw-r--r--scripts/lib/devtool/standard.py15
1 files changed, 13 insertions, 2 deletions
diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py
index 32fb3b656b..f9369eeef0 100644
--- a/scripts/lib/devtool/standard.py
+++ b/scripts/lib/devtool/standard.py
@@ -326,8 +326,19 @@ def modify(args, config, basepath, workspace):
commits = stdout.split()
else:
if os.path.exists(os.path.join(args.srctree, '.git')):
- (stdout, _) = bb.process.run('git rev-parse HEAD', cwd=args.srctree)
- initial_rev = stdout.rstrip()
+ # Check if it's a tree previously extracted by us
+ try:
+ (stdout, _) = bb.process.run('git branch --contains devtool-base', cwd=args.srctree)
+ except bb.process.ExecutionError:
+ stdout = ''
+ for line in stdout.splitlines():
+ if line.startswith('*'):
+ (stdout, _) = bb.process.run('git rev-parse devtool-base', cwd=args.srctree)
+ initial_rev = stdout.rstrip()
+ if not initial_rev:
+ # Otherwise, just grab the head revision
+ (stdout, _) = bb.process.run('git rev-parse HEAD', cwd=args.srctree)
+ initial_rev = stdout.rstrip()
# Check that recipe isn't using a shared workdir
s = rd.getVar('S', True)