summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/combo-layer22
1 files changed, 16 insertions, 6 deletions
diff --git a/scripts/combo-layer b/scripts/combo-layer
index 37d1f4712d..851003d855 100755
--- a/scripts/combo-layer
+++ b/scripts/combo-layer
@@ -26,6 +26,7 @@ import logging
26import subprocess 26import subprocess
27import ConfigParser 27import ConfigParser
28import re 28import re
29from collections import OrderedDict
29 30
30__version__ = "0.2.1" 31__version__ = "0.2.1"
31 32
@@ -347,7 +348,13 @@ def action_update(conf, args):
347 generate the patch list 348 generate the patch list
348 apply the generated patches 349 apply the generated patches
349 """ 350 """
350 repos = get_repos(conf, args[1:]) 351 components = [arg.split(':')[0] for arg in args[1:]]
352 revisions = []
353 for arg in args[1:]:
354 revision= arg.split(':', 1)[1] if ':' in arg else None
355 revisions.append(revision)
356 # Map commitishes to repos
357 repos = OrderedDict(zip(get_repos(conf, components), revisions))
351 358
352 # make sure combo repo is clean 359 # make sure combo repo is clean
353 check_repo_clean(os.getcwd()) 360 check_repo_clean(os.getcwd())
@@ -361,9 +368,9 @@ def action_update(conf, args):
361 if conf.nopull: 368 if conf.nopull:
362 logger.info("Skipping pull (-n)") 369 logger.info("Skipping pull (-n)")
363 else: 370 else:
364 action_pull(conf, args) 371 action_pull(conf, ['arg0'] + components)
365 372
366 for name in repos: 373 for name, revision in repos.iteritems():
367 repo = conf.repos[name] 374 repo = conf.repos[name]
368 ldir = repo['local_repo_dir'] 375 ldir = repo['local_repo_dir']
369 dest_dir = repo['dest_dir'] 376 dest_dir = repo['dest_dir']
@@ -372,18 +379,21 @@ def action_update(conf, args):
372 379
373 # Step 2: generate the patch list and store to patch dir 380 # Step 2: generate the patch list and store to patch dir
374 logger.info("Generating patches from %s..." % name) 381 logger.info("Generating patches from %s..." % name)
382 top_revision = revision or branch
383 if not check_rev_branch(name, ldir, top_revision, branch):
384 sys.exit(1)
375 if dest_dir != ".": 385 if dest_dir != ".":
376 prefix = "--src-prefix=a/%s/ --dst-prefix=b/%s/" % (dest_dir, dest_dir) 386 prefix = "--src-prefix=a/%s/ --dst-prefix=b/%s/" % (dest_dir, dest_dir)
377 else: 387 else:
378 prefix = "" 388 prefix = ""
379 if repo['last_revision'] == "": 389 if repo['last_revision'] == "":
380 logger.info("Warning: last_revision of component %s is not set, starting from the first commit" % name) 390 logger.info("Warning: last_revision of component %s is not set, starting from the first commit" % name)
381 patch_cmd_range = "--root %s" % branch 391 patch_cmd_range = "--root %s" % top_revision
382 rev_cmd_range = branch 392 rev_cmd_range = top_revision
383 else: 393 else:
384 if not check_rev_branch(name, ldir, repo['last_revision'], branch): 394 if not check_rev_branch(name, ldir, repo['last_revision'], branch):
385 sys.exit(1) 395 sys.exit(1)
386 patch_cmd_range = "%s..%s" % (repo['last_revision'], branch) 396 patch_cmd_range = "%s..%s" % (repo['last_revision'], top_revision)
387 rev_cmd_range = patch_cmd_range 397 rev_cmd_range = patch_cmd_range
388 398
389 file_filter = repo.get('file_filter',"") 399 file_filter = repo.get('file_filter',"")