--- trunk/svn-indexer.pl 2006/12/07 00:51:39 21 +++ trunk/svn-indexer.pl 2006/12/10 00:01:33 26 @@ -27,9 +27,11 @@ $rev_col->order_by({ column => 'revision', order => 'DES' }); my $last_rev = $rev_col->first; +my $branch_regex = Jifty->config->app('branch_regex'); + if ($last_rev) { $start_rev = $last_rev->revision; - warn "Index $repository rev $start_rev - $end_rev\n"; + warn "Index $repository rev $start_rev - $end_rev [branch regex: $branch_regex]\n"; } SVN::Log::retrieve({ @@ -55,7 +57,18 @@ my $action = $paths->{$path}->{action} || die "no action in ", dump($path); my $branch = '/'; - ($branch,$path) = ($1,$2) if ($path =~ m!^(/[^/]+)(/.+)$!); + ($branch,$path) = ($1,$2) if ($path =~ m/$branch_regex/); + + my $b = SVNBrowser::Model::Branch->new(current_user => $system_user); + $b->load_or_create( + path => $branch, + ); + + my $rb = SVNBrowser::Model::RevisionBranch->new(current_user => $system_user); + $rb->load_or_create( + revision => $r, + branch => $b, + ); my $a = SVNBrowser::Model::Action->new(current_user => $system_user); $a->load_or_create( @@ -64,6 +77,7 @@ branch => $branch, rel_path => $path, ); + print " $action | $branch | $path\n"; } }