[Bps-public-commit] r10057 - in SVKUI/trunk/lib/SVKUI: Model
clsung at bestpractical.com
clsung at bestpractical.com
Mon Dec 24 02:21:12 EST 2007
Author: clsung
Date: Mon Dec 24 02:21:12 2007
New Revision: 10057
Modified:
SVKUI/trunk/lib/SVKUI/Model/Project.pm
SVKUI/trunk/lib/SVKUI/View.pm
Log:
- branch project involved
Modified: SVKUI/trunk/lib/SVKUI/Model/Project.pm
==============================================================================
--- SVKUI/trunk/lib/SVKUI/Model/Project.pm (original)
+++ SVKUI/trunk/lib/SVKUI/Model/Project.pm Mon Dec 24 02:21:12 2007
@@ -42,6 +42,21 @@
hints is 'mirrored repos path';
column
+ trunkpath => type is 'varchar',
+ label is _('Trunk path'),
+ hints is 'project trunk path';
+
+column
+ branchespath => type is 'varchar',
+ label is _('Branches path'),
+ hints is 'project branch(es) path';
+
+column
+ tagspath => type is 'varchar',
+ label is _('Tags path'),
+ hints is 'project tags path';
+
+column
synced => type is 'boolean',
label is _('Project is Synced?'),
default is 0,
@@ -131,9 +146,14 @@
grep { $prop{'svk:project:'.$proj.':'.$_} =~ m/^$uri_path/; }
('path-trunk', 'path-branches', 'path-tags');
}
- $path = '//mirror'.$projects{$matched_project ? $matched_project : $projs[0]};
+ $matched_project ||= $projs[0];
+ $path = $projects{$matched_project};
+ $self->_set(column => 'url', value => $repos_root.$path);
+ $self->_set(column => 'trunkpath', value => $prop{'svk:project:'.$matched_project.':path-trunk'});
+ $self->_set(column => 'branchespath', value => $prop{'svk:project:'.$matched_project.':path-branches'});
+ $self->_set(column => 'tagspath', value => $prop{'svk:project:'.$matched_project.':path-tags'});
+ $path = '//mirror'.$path;
warn $path . " is changed";
- $self->_set(column => 'url', value => $repos_root.$projects{$projs[0]});
}
return $path;
@@ -169,6 +189,12 @@
return 1;
}
$self->_set(column => 'repospath', value => $path);
+ SVKUI->_svkcmd('propset', '--direct', '-m', "- trunk path set",
+ 'svk:project:'.$self->name.':path-trunk', $self->trunkpath, '//');
+ SVKUI->_svkcmd('propset', '--direct', '-m', "- branches path set",
+ 'svk:project:'.$self->name.':path-branches', $self->branchespath, '//');
+ SVKUI->_svkcmd('propset', '--direct', '-m', "- tags path set",
+ 'svk:project:'.$self->name.':path-tags', $self->tagspath, '//');
warn 'svk mirror '.$path.' '.$self->url.' success!';
return 0;
}
@@ -275,5 +301,13 @@
return 1 unless defined($self->repospath);
}
+sub branches {
+ my ($self, $path) = @_;
+ $path ||= $self->repospath;
+ my $command = SVKUI::Model::Command->new();
+ $command->cmd('branch', '--list',$path);
+ return $command->output_raw;
+}
+
1;
Modified: SVKUI/trunk/lib/SVKUI/View.pm
==============================================================================
--- SVKUI/trunk/lib/SVKUI/View.pm (original)
+++ SVKUI/trunk/lib/SVKUI/View.pm Mon Dec 24 02:21:12 2007
@@ -149,7 +149,7 @@
if ($project->try_sync()) {
$message = 'sync failed';
} else {
- $message = 'success';
+ $message = Jifty->web->link( label => "success", url => '/project/'.$p_name );
};
warn "Canceling $sid";
Jifty->subs->cancel($sid) if $sid;
More information about the Bps-public-commit
mailing list