[Rt-commit] r5896 - in commitbit: . lib/CommitBit/Model
jesse at bestpractical.com
jesse at bestpractical.com
Sun Sep 10 20:09:44 EDT 2006
Author: jesse
Date: Sun Sep 10 20:09:44 2006
New Revision: 5896
Modified:
commitbit/ (props changed)
commitbit/lib/CommitBit/Dispatcher.pm
commitbit/lib/CommitBit/Model/Repository.pm
Log:
r27351 at pinglin: jesse | 2006-09-11 01:09:36 +0100
* Repository work
Modified: commitbit/lib/CommitBit/Dispatcher.pm
==============================================================================
--- commitbit/lib/CommitBit/Dispatcher.pm (original)
+++ commitbit/lib/CommitBit/Dispatcher.pm Sun Sep 10 20:09:44 2006
@@ -1,7 +1,22 @@
package CommitBit::Dispatcher;
use Jifty::Dispatcher -base;
-on qr'project/(.+?)(/.*)$' => run {
+on qr'repository/(.+?)(/.*|)$' => run {
+ my $name = $1;
+ my $path = $2;
+ warn "Name - $name - $path";
+ my $repository = CommitBit::Model::Repository->new();
+ $repository->load_by_cols( name => $name );
+ unless ($repository->id) {
+ redirect '/__jifty/error/repository/not_found';
+ }
+
+ set repository => $repository;
+
+ show( '/repository/' . $path || '/repository/index.html' );
+};
+
+on qr'project/(.+?)(/.*|)$' => run {
my $name = $1;
my $path = $2;
warn "Name - $name - $path";
Modified: commitbit/lib/CommitBit/Model/Repository.pm
==============================================================================
--- commitbit/lib/CommitBit/Model/Repository.pm (original)
+++ commitbit/lib/CommitBit/Model/Repository.pm Sun Sep 10 20:09:44 2006
@@ -28,12 +28,12 @@
# XXX: make sure svn/svnadmin is in path during compile time.
sub _svnadmin {
my $self = shift;
- system("svnadmin", @_);
+ $self->run_cmd("svnadmin", @_);
}
sub _svn {
my $self = shift;
- system("svn", @_);
+ $self->run_cmd("svn", @_);
}
sub create {
@@ -172,5 +172,11 @@
return $msg;
}
+sub run_cmd {
+ my $self = shift;
+ system(@_);
+
+}
+
1;
More information about the Rt-commit
mailing list