[svk-commit] r2978 - in trunk: t/bm
nobody at bestpractical.com
nobody at bestpractical.com
Mon Jul 7 21:47:40 EDT 2008
Author: clsung
Date: Mon Jul 7 21:47:39 2008
New Revision: 2978
Modified:
trunk/lib/SVK/Command/Branch.pm
trunk/t/bm/checkout.t
Log:
- fix br --checkout <project> <copath>
Modified: trunk/lib/SVK/Command/Branch.pm
==============================================================================
--- trunk/lib/SVK/Command/Branch.pm (original)
+++ trunk/lib/SVK/Command/Branch.pm Mon Jul 7 21:47:39 2008
@@ -598,8 +598,15 @@
my $branch_name = shift(@arg);
my ($project_path, $checkout_path) = ('','');
+ my ($proj, $target, $msg);
if (@arg and is_depotpath($arg[$#arg])) {
$project_path = pop(@arg);
+ my $ppath = eval {$self->arg_depotpath($project_path) };
+ if ($@) {
+ push @arg, $project_path;
+ } else {
+ ($proj,$target, $msg) = $self->locate_project($project_path);
+ }
}
$checkout_path = pop(@arg);
$checkout_path = $branch_name unless $checkout_path;
@@ -614,7 +621,7 @@
}
}
- my ($proj,$target, $msg) = $self->locate_project($project_path);
+ ($proj,$target, $msg) = $self->locate_project($project_path);
if (!$proj) {
$logger->info(
Modified: trunk/t/bm/checkout.t
==============================================================================
--- trunk/t/bm/checkout.t (original)
+++ trunk/t/bm/checkout.t Mon Jul 7 21:47:39 2008
@@ -1,6 +1,6 @@
#!/usr/bin/perl -w
use strict;
-use Test::More tests => 7;
+use Test::More tests => 9;
use SVK::Test;
use File::Path;
@@ -50,3 +50,11 @@
is_output_like ($svk, 'info',[],
qr'Depot Path: //mirror/MyProject/trunk');
+
+is_output_like ($svk, 'branch', ['--checkout', 'feature/foo', '//mirror/MyProject', $corpath.'/D'],
+ qr'Syncing \S+ in \S+D to \d.+');
+
+chdir('../D');
+
+is_output_like ($svk, 'info',[],
+ qr'Depot Path: //mirror/MyProject/branches/feature/foo');
More information about the svk-commit
mailing list