added revert
authorDobrica Pavlinusic <dpavlin@rot13.org>
Thu, 18 Feb 2010 10:30:56 +0000 (11:30 +0100)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Thu, 18 Feb 2010 10:30:56 +0000 (11:30 +0100)
server.pl

index a481086..a61e3db 100755 (executable)
--- a/server.pl
+++ b/server.pl
@@ -90,6 +90,9 @@ while (my $client = $server->accept()) {
        } elsif ( $command =~ m{(diff|status|log)} ) {
                my $opt = '--summary' if $command eq 'log';
                print $client `git $command $opt $ip`;
+       } elsif ( $command eq 'revert' ) {
+               print $client `git checkout -- $ip/$path`;
+               system 'rsync', '-avv', "$ip/$path", "root\@$ip:$path";
        } else {
                print $client "Unknown command: $command\n";
        }