equal
deleted
inserted
replaced
1483 |
1483 |
1484 # replace immediately |
1484 # replace immediately |
1485 # |
1485 # |
1486 if ( $cur_valcount == 1 ) { |
1486 if ( $cur_valcount == 1 ) { |
1487 $e->replace( $attr => $val ); |
1487 $e->replace( $attr => $val ); |
|
1488 $seen_attr{ $attr }++; |
1488 } |
1489 } |
1489 else { |
1490 else { |
1490 |
1491 |
1491 # retain attributes that allow multiples, so updating |
1492 # retain attributes that allow multiples, so updating |
1492 # one attribute doesn't inadvertently remove others with |
1493 # one attribute doesn't inadvertently remove others with |
1507 |
1508 |
1508 # deletion within the same hunk |
1509 # deletion within the same hunk |
1509 # |
1510 # |
1510 foreach ( $diff->Items(1) ) { |
1511 foreach ( $diff->Items(1) ) { |
1511 my ( $attr, $val ) = $parse->( $_ ) or next; |
1512 my ( $attr, $val ) = $parse->( $_ ) or next; |
1512 my $cur_vals = $e->get_value( $attr, asref => 1 ) || []; |
|
1513 my $cur_valcount = scalar @$cur_vals; |
|
1514 |
|
1515 next if $cur_valcount == 1; |
|
1516 next if $seen_attr{ $attr }; |
1513 next if $seen_attr{ $attr }; |
1517 $self->debug("DELETE: $_"); |
1514 $self->debug("DELETE: $_"); |
1518 $e->delete( $attr => [ $val ] ); |
1515 $e->delete( $attr => [ $val ] ); |
1519 } |
1516 } |
1520 } |
1517 } |