[svk-commit] r2596 - branches/bm/lib/SVK/Command

nobody at bestpractical.com nobody at bestpractical.com
Sat Nov 10 05:52:11 EST 2007


Author: clkao
Date: Sat Nov 10 05:52:06 2007
New Revision: 2596

Modified:
   branches/bm/lib/SVK/Command/Branch.pm

Log:
support asterisk br --merge source.

Modified: branches/bm/lib/SVK/Command/Branch.pm
==============================================================================
--- branches/bm/lib/SVK/Command/Branch.pm	(original)
+++ branches/bm/lib/SVK/Command/Branch.pm	Sat Nov 10 05:52:06 2007
@@ -299,6 +299,13 @@
 
 use constant narg => 1;
 
+sub expand_branch {
+    my ($self, $proj, $arg) = @_;
+    return $arg unless $arg =~ m/\*/;
+    my $match = SVK::XD::compile_apr_fnmatch($arg);
+    return grep { m/$match/ } @{ $proj->branches };
+}
+
 sub parse_arg {
     my ($self, @arg) = @_;
     return if $#arg < 1;
@@ -324,6 +331,8 @@
 	$source->path
     );
 
+    @srcs = map { $self->expand_branch($proj, $_) } @srcs;
+
     my $branch_path = '/'.$proj->depot->depotname.'/'.$proj->branch_location;
     my $dst_branch_path = $branch_path.'/'.$dst;
     $dst_branch_path =  '/'.$proj->depot->depotname.'/'.$proj->trunk


More information about the svk-commit mailing list