update.py: create dependency/maintainer records when creating LayerBranch

If we're creating a LayerBranch record, it's helpful to copy the
maintainer and dependency records in from master as they're usually
going to be the same; if they're not the user can always change them
afterwards.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
This commit is contained in:
Paul Eggleton 2013-03-19 23:55:15 +00:00
parent 0a1215e59e
commit 3cc0b78935

View File

@ -334,6 +334,17 @@ def main():
if layerbranch_master:
layerbranch.vcs_subdir = layerbranch_master.vcs_subdir
layerbranch.save()
if layerbranch_master:
for maintainer in layerbranch_master.layermaintainer_set.all():
maintainer.pk = None
maintainer.id = None
maintainer.layerbranch = layerbranch
maintainer.save()
for dep in layerbranch_master.dependencies_set.all():
dep.pk = None
dep.id = None
dep.layerbranch = layerbranch
dep.save()
if layerbranch.vcs_subdir:
# Find latest commit in subdirectory