51 |
my $from_path = $self->from; |
my $from_path = $self->from; |
52 |
$from_path =~ s{::}{/}g; |
$from_path =~ s{::}{/}g; |
53 |
|
|
54 |
|
my @commit; |
55 |
|
my $message; |
56 |
|
|
57 |
foreach my $selected ( @{ $self->selected } ) { |
foreach my $selected ( @{ $self->selected } ) { |
58 |
warn "# selected ", $self->dump( $selected ); |
warn "# selected ", $self->dump( $selected ); |
59 |
my $path = $self->path->[$selected] || die "no $selected path in ", $self->dump( $self->path ); |
my $path = $self->path->[$selected] || die "no $selected path in ", $self->dump( $self->path ); |
70 |
|
|
71 |
$content[ $line ] =~ s{\Q$from\E}{$to}s; |
$content[ $line ] =~ s{\Q$from\E}{$to}s; |
72 |
$self->write_file( $content_path, @content ); |
$self->write_file( $content_path, @content ); |
73 |
|
push @commit, $content_path; |
74 |
|
$message ||= ref($self) . " $from -> $to"; |
75 |
|
|
76 |
$html .= qq|<li>$line $from -> $to <tt>| . $self->html_escape( $content[$line] ) . qq|</tt></li>|; |
$html .= qq|<li>$line $from -> $to <tt>| . $self->html_escape( $content[$line] ) . qq|</tt></li>|; |
77 |
} |
} |
78 |
|
|
79 |
$html .= qq|</ul>|; |
$html .= qq|</ul>|; |
80 |
|
|
81 |
$html .= qq| |
my $notice = qq| |
82 |
<div class="frey-notice"> |
<a target="Frey::SVK" href="/Frey::SVK/as_markup">diff</a> |
83 |
<a target="Frey::SVK" href="/Frey::SVK/as_markup">Verify and commit changes</a> |
<a target="Frey::Test::Runner" href="/Frey::Test::Runner/as_markup">test</a> |
|
and execute following commands to rename classes in file system: |
|
|
</div> |
|
84 |
|; |
|; |
85 |
|
|
86 |
|
my $shell; |
87 |
|
|
88 |
|
$shell .= qq|svk commit -m "$message" | . join(' ', @commit) . qq|\n| if @commit; |
89 |
|
|
90 |
|
@commit = (); |
91 |
|
|
92 |
foreach my $old ( keys %$rename ) { |
foreach my $old ( keys %$rename ) { |
93 |
my $to = $rename->{$old}; |
my $to = $rename->{$old}; |
94 |
$to =~ s{::}{/}g; |
$to =~ s{::}{/}g; |
95 |
my $new = $old; |
my $new = $old; |
96 |
$new =~ s{$from_path}{$to}; |
$new =~ s{$from_path}{$to}; |
97 |
$html .= qq|<pre>svk mv $old $new\n</pre>|; |
$shell .= qq|svk mv $old $new\n|; |
98 |
|
push @commit, $old; |
99 |
|
push @commit, $new; |
100 |
} |
} |
101 |
|
|
102 |
$html; |
$shell .= qq|svk commit -m "$message" | . join(' ', @commit) . qq|\n| if @commit; |
103 |
|
|
104 |
|
$notice .= qq| |
105 |
|
<br>all in one commit and rename: |
106 |
|
<pre>$shell</pre> |
107 |
|
| if $shell; |
108 |
|
|
109 |
|
$html .= qq| |
110 |
|
<div class="frey-info"> |
111 |
|
$notice |
112 |
|
</div> |
113 |
|
| if $notice; |
114 |
|
|
115 |
|
return $html; |
116 |
} |
} |
117 |
|
|
118 |
1; |
1; |