1package Prophet::Resolver::AlwaysTarget;
2{
3  $Prophet::Resolver::AlwaysTarget::VERSION = '0.751';
4}
5use Any::Moose;
6use Data::Dumper;
7extends 'Prophet::Resolver';
8
9sub run {
10    my $self               = shift;
11    my $conflicting_change = shift;
12    my $conflict           = shift;
13    my $resolution = Prophet::Change->new_from_conflict($conflicting_change);
14    my $file_op_conflict = $conflicting_change->file_op_conflict || '';
15    if ( $file_op_conflict eq 'update_missing_file' ) {
16        $resolution->change_type('delete');
17        return $resolution;
18    } elsif ( $file_op_conflict eq 'delete_missing_file' ) {
19        return $resolution;
20    } elsif ($file_op_conflict) {
21        die "Unknown file_op_conflict $file_op_conflict: "
22          . Dumper( $conflict, $conflicting_change );
23    }
24
25    for my $prop_change ( @{ $conflicting_change->prop_conflicts } ) {
26        $resolution->add_prop_change(
27            name => $prop_change->name,
28            old  => $prop_change->source_new_value,
29            new  => $prop_change->target_value
30        );
31    }
32    return $resolution;
33}
34
35__PACKAGE__->meta->make_immutable;
36no Any::Moose;
37
381;
39
40__END__
41
42=pod
43
44=head1 NAME
45
46Prophet::Resolver::AlwaysTarget
47
48=head1 VERSION
49
50version 0.751
51
52=head1 AUTHORS
53
54=over 4
55
56=item *
57
58Jesse Vincent <jesse@bestpractical.com>
59
60=item *
61
62Chia-Liang Kao <clkao@bestpractical.com>
63
64=item *
65
66Christine Spang <christine@spang.cc>
67
68=back
69
70=head1 COPYRIGHT AND LICENSE
71
72This software is Copyright (c) 2009 by Best Practical Solutions.
73
74This is free software, licensed under:
75
76  The MIT (X11) License
77
78=head1 BUGS AND LIMITATIONS
79
80You can make new bug reports, and view existing ones, through the
81web interface at L<https://rt.cpan.org/Public/Dist/Display.html?Name=Prophet>.
82
83=head1 CONTRIBUTORS
84
85=over 4
86
87=item *
88
89Alex Vandiver <alexmv@bestpractical.com>
90
91=item *
92
93Casey West <casey@geeknest.com>
94
95=item *
96
97Cyril Brulebois <kibi@debian.org>
98
99=item *
100
101Florian Ragwitz <rafl@debian.org>
102
103=item *
104
105Ioan Rogers <ioanr@cpan.org>
106
107=item *
108
109Jonas Smedegaard <dr@jones.dk>
110
111=item *
112
113Kevin Falcone <falcone@bestpractical.com>
114
115=item *
116
117Lance Wicks <lw@judocoach.com>
118
119=item *
120
121Nelson Elhage <nelhage@mit.edu>
122
123=item *
124
125Pedro Melo <melo@simplicidade.org>
126
127=item *
128
129Rob Hoelz <rob@hoelz.ro>
130
131=item *
132
133Ruslan Zakirov <ruz@bestpractical.com>
134
135=item *
136
137Shawn M Moore <sartak@bestpractical.com>
138
139=item *
140
141Simon Wistow <simon@thegestalt.org>
142
143=item *
144
145Stephane Alnet <stephane@shimaore.net>
146
147=item *
148
149Unknown user <nobody@localhost>
150
151=item *
152
153Yanick Champoux <yanick@babyl.dyndns.org>
154
155=item *
156
157franck cuny <franck@lumberjaph.net>
158
159=item *
160
161robertkrimen <robertkrimen@gmail.com>
162
163=item *
164
165sunnavy <sunnavy@bestpractical.com>
166
167=back
168
169=cut
170