[libbread-board-perl] 24/66: Set parent for containers created from parameterized containers
Jonas Smedegaard
js at alioth.debian.org
Sun Sep 29 21:23:34 UTC 2013
This is an automated email from the git hooks/post-receive script.
js pushed a commit to branch master
in repository libbread-board-perl.
commit 24ca90b6f1f155088a5032d820225fdbb2670ddd
Author: Florian Ragwitz <rafl at debian.org>
Date: Sun Jul 21 13:47:34 2013 -0700
Set parent for containers created from parameterized containers
---
lib/Bread/Board/Container/Parameterized.pm | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/lib/Bread/Board/Container/Parameterized.pm b/lib/Bread/Board/Container/Parameterized.pm
index d22496f..0bf2b93 100644
--- a/lib/Bread/Board/Container/Parameterized.pm
+++ b/lib/Bread/Board/Container/Parameterized.pm
@@ -74,6 +74,17 @@ sub create {
my $from_parameterized_meta = find_meta('Bread::Board::Container::FromParameterized');
$clone = $from_parameterized_meta->rebless_instance($clone);
+ if ($self->has_parent) {
+ my $cloned_parent = $self->parent->clone;
+
+ $cloned_parent->sub_containers({
+ %{ $cloned_parent->sub_containers },
+ $self->name => $clone,
+ });
+
+ $clone->parent($cloned_parent);
+ }
+
foreach my $key ( @given_names ) {
$clone->add_sub_container(
$params{ $key }->clone( name => $key )
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libbread-board-perl.git
More information about the Pkg-perl-cvs-commits
mailing list