/usr/share/perl5/Prophet/Resolver/IdenticalChanges.pm is in libprophet-perl 0.750-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 | package Prophet::Resolver::IdenticalChanges;
use Any::Moose;
use Params::Validate qw(:all);
use Prophet::Change;
extends 'Prophet::Resolver';
=head1 METHODS
=head2 attempt_automatic_conflict_resolution
Given a L<Prophet::Conflict> which can not be cleanly applied to a
replica, it is sometimes possible to automatically determine a sane
resolution to the conflict.
=over
=item *
When the new-state of the conflicting change matches the
previous head of the replica.
=item *
When someone else has previously done the resolution and we
have a copy of that hanging around.
=back
In those cases, this routine will generate a L<Prophet::ChangeSet>
which resolves as many conflicts as possible.
It will then update the conclicting changes to mark which
L<Prophet::ConflictingChange>s and L<Prophet::ConflictingPropChanges>
have been automatically resolved.
=cut
sub run {
my $self = shift;
my ( $conflicting_change, $conflict, $resdb )
= validate_pos( @_, { isa => 'Prophet::ConflictingChange' }, { isa => 'Prophet::Conflict' }, 0 );
# for everything from the changeset that is the same as the old value of the target replica
# we can skip applying
return 0 if $conflicting_change->file_op_conflict;
my $resolution = Prophet::Change->new_from_conflict($conflicting_change);
for my $prop_change ( @{ $conflicting_change->prop_conflicts } ) {
next if ((!defined $prop_change->target_value || $prop_change->target_value eq '')
&& ( !defined $prop_change->source_new_value || $prop_change->source_new_value eq ''));
next if (defined $prop_change->target_value
and defined $prop_change->source_new_value
and ( $prop_change->target_value eq $prop_change->source_new_value));
return 0;
}
$conflict->autoresolved(1);
return $resolution;
}
__PACKAGE__->meta->make_immutable;
no Any::Moose;
1;
|