--- trunk/lib/Frey/Class/Refactor/Modify.pm 2008/12/10 13:55:38 788 +++ trunk/lib/Frey/Class/Refactor/Modify.pm 2008/12/10 13:56:43 789 @@ -51,6 +51,9 @@ my $from_path = $self->from; $from_path =~ s{::}{/}g; + my @commit; + my $message; + foreach my $selected ( @{ $self->selected } ) { warn "# selected ", $self->dump( $selected ); my $path = $self->path->[$selected] || die "no $selected path in ", $self->dump( $self->path ); @@ -67,28 +70,49 @@ $content[ $line ] =~ s{\Q$from\E}{$to}s; $self->write_file( $content_path, @content ); - + push @commit, $content_path; + $message ||= ref($self) . " $from -> $to"; + $html .= qq|
  • $line $from -> $to | . $self->html_escape( $content[$line] ) . qq|
  • |; } $html .= qq||; - $html .= qq| -
    - Verify and commit changes - and execute following commands to rename classes in file system: -
    + my $notice = qq| + diff + test |; + my $shell; + + $shell .= qq|svk commit -m "$message" | . join(' ', @commit) . qq|\n| if @commit; + + @commit = (); + foreach my $old ( keys %$rename ) { my $to = $rename->{$old}; $to =~ s{::}{/}g; my $new = $old; $new =~ s{$from_path}{$to}; - $html .= qq|
    svk mv $old $new\n
    |; + $shell .= qq|svk mv $old $new\n|; + push @commit, $old; + push @commit, $new; } - $html; + $shell .= qq|svk commit -m "$message" | . join(' ', @commit) . qq|\n| if @commit; + + $notice .= qq| +
    all in one commit and rename: +
    $shell
    + | if $shell; + + $html .= qq| +
    + $notice +
    + | if $notice; + + return $html; } 1;