[libbread-board-perl] 54/66: Base registering subcontainers on $is_inheriting, not has_parent

Jonas Smedegaard js at alioth.debian.org
Sun Sep 29 21:23:40 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 f420143eb12e4e99dc41c0c085d4478cffe51367
Author: Florian Ragwitz <rafl at debian.org>
Date:   Fri Aug 30 11:49:14 2013 -0400

    Base registering subcontainers on $is_inheriting, not has_parent
---
 lib/Bread/Board.pm |   16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/lib/Bread/Board.pm b/lib/Bread/Board.pm
index 1ddc697..df77161 100644
--- a/lib/Bread/Board.pm
+++ b/lib/Bread/Board.pm
@@ -58,6 +58,10 @@ sub container ($;$$) {
         # container( A::Bread::Board::Container->new, ... )
         # or someone using &container as a constructor
         $c = $name;
+
+        # if we're in the context of another container
+        # then we're a subcontainer of it
+        $CC->add_sub_container($c) if defined $CC;
     }
     else {
         my $is_inheriting = $name =~ s/^\+//;
@@ -81,17 +85,13 @@ sub container ($;$$) {
                 ? $CC->fetch($name)
                 : Bread::Board::Container->new({ name => $name });
         }
-    }
 
-    # if we already have a root
-    # container, then we are a
-    # subcontainer of it, unless
-    # we already have a parent
-    if (defined $CC && !$c->has_parent) {
-        $CC->add_sub_container($c);
+        # if we're in the context of another container
+        # then we're a subcontainer of it, unless we're inheriting,
+        # in which case we already got a parent
+        $CC->add_sub_container($c) if !$is_inheriting && defined $CC;
     }
 
-
     my $body = shift;
     # if we have more arguments
     # then they are likely a body

-- 
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