[oe-commits] Paul Eggleton : devtool: modify: get correct initial revision from previously extracted source tree

git at git.openembedded.org git at git.openembedded.org
Fri Mar 20 11:28:33 UTC 2015


Module: openembedded-core.git
Branch: master
Commit: c20e10543e268ebb43074a3f8d6e7ed991e54ec8
URL:    http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=c20e10543e268ebb43074a3f8d6e7ed991e54ec8

Author: Paul Eggleton <paul.eggleton at linux.intel.com>
Date:   Wed Mar  4 13:20:37 2015 +0000

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 at linux.intel.com>
Signed-off-by: Ross Burton <ross.burton at intel.com>

---

 scripts/lib/devtool/standard.py | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py
index 32fb3b6..f9369ee 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)



More information about the Openembedded-commits mailing list