--- trunk/lib/Frey/SVK.pm 2008/12/02 17:34:23 681 +++ trunk/lib/Frey/SVK.pm 2008/12/02 18:12:38 684 @@ -64,15 +64,15 @@ } } -sub status_as_markup { +sub commit_as_markup { my ($self) = @_; my $status = `svk status -q`; -# $status =~ s{^(\w+\s+)(\S+)$}{$1$2}gm; # FIXME - $status =~ s{^(\w+[\+\s]+)(\S+)$}{$1$2}gm; + $status =~ s{^(\w+[\+\s]+)(\S+)$}{$1$2}gm; # FIXME +# $status =~ s{^(\w+[\+\s]+)(\S+)$}{$1$2}gm; if ( $status ) { $self->add_css(qq| pre.l a { text-decoration: none; } - div.commit { + form.commit { background: #ffd; padding: 1em 1em; position: fixed; @@ -82,19 +82,17 @@ } | ); + $status = qq| -
-
- -
-
-
+
$status
+ +
+
|; - $self->add_status( $status ); - + $self->add_status( status => $status ); + warn "commit_as_markup ",length($status)," bytes"; } - warn "status_as_markup ",length($status)," bytes"; return $status; } @@ -102,6 +100,7 @@ my ($self) = @_; my $diff = `svk diff`; + $self->add_status( diff => $diff ); $diff = $self->html_escape( $diff ); $self->add_css( qq| @@ -136,12 +135,13 @@ die "Allready have ", $self->path_size($new) if -e $new; $cmd = "mv $old $new && svk revert $old"; } elsif ( $self->action ) { - $cmd = 'svk ' . $self->action . ' ' . $self->path; + $cmd = 'svk ' . $self->action; if ( $self->action eq 'commit' ) { - confess "need commit message" unless $self->commit_message; - my $msg = $self->commit_message; + my $msg = $self->commit_message || confess "need commit message"; $msg =~ s{"}{\\"}gs; $cmd .= qq{ -m "$msg"}; + } elsif ( my $path = $self->path ) { + $cmd .= " $path"; } else { confess "need path" unless $self->path; } @@ -161,8 +161,7 @@ $self->title( 'svk' . ( $self->action ? ' - ' . $self->action : '' ) ); # XXX without this we get wrong icon and title - $html .= $self->status_as_markup || 'No changes in files tracked by SVK'; - $html .= $self->diff_as_markup; + $html .= $self->commit_as_markup . $self->diff_as_markup; warn "as_markup ",length($html)," bytes";