[Bps-public-commit] r10063 - SVKUI/trunk/lib/SVKUI/Action

clsung at bestpractical.com clsung at bestpractical.com
Mon Dec 24 05:33:27 EST 2007


Author: clsung
Date: Mon Dec 24 05:33:24 2007
New Revision: 10063

Modified:
   SVKUI/trunk/lib/SVKUI/Action/CreateBranch.pm

Log:
- fix bug to detect if there's any branch exists

Modified: SVKUI/trunk/lib/SVKUI/Action/CreateBranch.pm
==============================================================================
--- SVKUI/trunk/lib/SVKUI/Action/CreateBranch.pm	(original)
+++ SVKUI/trunk/lib/SVKUI/Action/CreateBranch.pm	Mon Dec 24 05:33:24 2007
@@ -44,7 +44,7 @@
     my $project = SVKUI::Model::Project->new;
     $project->load_by_cols( name => $proj_name );
     my $projs = $project->branches();
-    if ($projs eq '' or !(grep {$branch} @{$projs}) ) {
+    if ( 0 == length($projs) or !(grep {$branch} @{$projs}) ) {
 	$project->create_branch($branch, $is_local, undef, undef);
     } else {
 	$self->result->field_error ( branch => 'Duplicat branches' );
@@ -77,7 +77,7 @@
     my $projs = $project->branches();
     $value =~ s/^ *//;
     $value =~ s/ *$//;
-    if ($projs eq '' or !(grep {$value} @{$projs}) ) {
+    if ( 0 == length($projs) or !(grep {$value} @{$projs}) ) {
     } else {
 	$self->canonicalization_note(
 	    url => _('Branch already exists')



More information about the Bps-public-commit mailing list