[svk-commit] r2629 - in branches/bm: lib/SVK t/bm

nobody at bestpractical.com nobody at bestpractical.com
Thu Dec 13 02:27:01 EST 2007


Author: clsung
Date: Thu Dec 13 02:27:00 2007
New Revision: 2629

Modified:
   branches/bm/lib/SVK/Command/Branch.pm
   branches/bm/lib/SVK/Project.pm
   branches/bm/t/bm/basic.t

Log:
- br --list --local will display local branches

Modified: branches/bm/lib/SVK/Command/Branch.pm
==============================================================================
--- branches/bm/lib/SVK/Command/Branch.pm	(original)
+++ branches/bm/lib/SVK/Command/Branch.pm	Thu Dec 13 02:27:00 2007
@@ -124,7 +124,7 @@
 	return;
     }
 
-    my $branches = $proj->branches;
+    my $branches = $proj->branches ($self->{local});
 
     my $fmt = "%s\n"; # here to change layout
     printf $fmt, $_ for @{$branches};

Modified: branches/bm/lib/SVK/Project.pm
==============================================================================
--- branches/bm/lib/SVK/Project.pm	(original)
+++ branches/bm/lib/SVK/Project.pm	Thu Dec 13 02:27:00 2007
@@ -73,14 +73,14 @@
 use List::MoreUtils 'apply';
 
 sub branches {
-    my ( $self, $match ) = @_;
+    my ( $self, $local ) = @_;
 
     my $fs              = $self->depot->repos->fs;
     my $root            = $fs->revision_root( $fs->youngest_rev );
-    my $branch_location = $self->branch_location;
+    my $branch_location = $local ? $self->local_root : $self->branch_location;
 
     return [ apply {s{^\Q$branch_location\E/}{}}
-        @{ $self->_find_branches( $root, $self->branch_location ) } ];
+        @{ $self->_find_branches( $root, $branch_location ) } ];
 }
 
 sub _find_branches {

Modified: branches/bm/t/bm/basic.t
==============================================================================
--- branches/bm/t/bm/basic.t	(original)
+++ branches/bm/t/bm/basic.t	Thu Dec 13 02:27:00 2007
@@ -1,7 +1,7 @@
 #!/usr/bin/perl -w
 use strict;
 use SVK::Test;
-plan tests => 10;
+plan tests => 12;
 our $output;
 
 my ($xd, $svk) = build_test('test');
@@ -57,3 +57,10 @@
 $svk->branch('--switch-to', '//mirror/MyProject/branches/feature/foo'); # switch to foo
 is_output_like ($svk, 'info', [],
     qr'Depot Path: //mirror/MyProject/branches/feature/foo', 'Switch to feature/foo branch');
+
+is_output_like ($svk, 'branch', ['--create', 'feature/foobar', '--local'],
+    qr'Project branch created: feature/foobar \(in local\)');
+
+is_output($svk, 'br', ['-l', '--local', '//mirror/MyProject'],
+          ['feature/foobar']);
+


More information about the svk-commit mailing list