[svk-commit] r2897 - trunk/lib/SVK/Command
nobody at bestpractical.com
nobody at bestpractical.com
Wed May 21 01:57:05 EDT 2008
Author: clsung
Date: Wed May 21 01:57:05 2008
New Revision: 2897
Modified:
trunk/lib/SVK/Command/Branch.pm
Log:
- detect path gracefully
Modified: trunk/lib/SVK/Command/Branch.pm
==============================================================================
--- trunk/lib/SVK/Command/Branch.pm (original)
+++ trunk/lib/SVK/Command/Branch.pm Wed May 21 01:57:05 2008
@@ -293,6 +293,7 @@
use base qw( SVK::Command::Move SVK::Command::Smerge SVK::Command::Delete SVK::Command::Branch::create );
use SVK::I18N;
use SVK::Util qw( is_uri );
+use SVK::Logger;
use Path::Class;
sub lock { $_[0]->lock_coroot ($_[1]); };
@@ -335,11 +336,15 @@
$self->{parent} = 1;
for my $src_path (@src_paths) {
- my $src_branch_path = $src_path;
- $src_branch_path = $branch_path.'/'.$src_path.'/'
- unless $src_path =~ m#^$depot_root/#;
- $src_branch_path = $depot_root.$target->source->path
- unless ($src_path);
+ $src_path = $target->path unless $src_path;
+ $src_path = $target->_to_pclass("$src_path");
+ if ($target->_to_pclass("/local")->subsumes($src_path)) {
+ $self->{local}++;
+ } else {
+ $self->{local} = 0;
+ }
+ my $src_name = $self->dst_name($proj,$src_path);
+ my $src_branch_path = $self->dst_path($proj, $src_name);
my $src = $self->arg_co_maybe($src_branch_path);
if ( !$dst->same_source($src) ) {
@@ -349,6 +354,10 @@
$self->{rev} = $which_rev_we_branch;
$src = $self->arg_uri_maybe($depot_root.'/'.$which_depotpath);
$self->{message} = "- Create branch $src_branch_path to $dst_branch_path";
+# if ($self->{check_only}) {
+# $logger->info(
+# loc ("We will copy branch %1 to %2"), $
+# }
local *handle_direct_item = sub {
my $self = shift;
$self->SVK::Command::Copy::handle_direct_item(@_);
More information about the svk-commit
mailing list