From: Tara L Andrews Date: Wed, 14 Mar 2012 11:33:49 +0000 (+0100) Subject: replace collation relationships whenever we can X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=a2ed66b255a1b88374b5279faa18f0c390ca5dbb;p=scpubgit%2Fstemmatology.git replace collation relationships whenever we can --- diff --git a/lib/Text/Tradition/Collation/RelationshipStore.pm b/lib/Text/Tradition/Collation/RelationshipStore.pm index 0098563..f7d4f04 100644 --- a/lib/Text/Tradition/Collation/RelationshipStore.pm +++ b/lib/Text/Tradition/Collation/RelationshipStore.pm @@ -251,7 +251,6 @@ sub add_relationship { if( $relationship->colocated && $relationship->nonlocal && !$thispaironly ) { push( @vectors, $self->_find_applicable( $relationship ) ); } - $DB::single = 1 if grep { $_->[0] eq 'w494' || $_->[1] eq 'w494' } @vectors; # Now set the relationship(s). my @pairs_set; @@ -260,10 +259,11 @@ sub add_relationship { if( $rel && $rel ne $relationship ) { if( $rel->nonlocal ) { throw( "Found conflicting relationship at @$v" ); - } else { + } elsif( $rel->type ne 'collated' ) { + # Replace a collation relationship; leave any other sort in place. warn "Not overriding local relationship set at @$v"; + next; } - next; } $self->_set_relationship( $relationship, @$v ); push( @pairs_set, $v );