404 motivation not found | t_ishidaのブログ

Archive for 3月 2011

よくあるtrunkをブランチに切るパターンを自動化。
さらに前に紹介したdot_aurc_copy.plもついでにキック。
ディスク勿体無いけど、switchは経験上危険なので問答無用でチェックアウト。

#!/usr/bin/perl -w
use File::Basename;

my $ROOT
   = '[svnのリポジトリのパス]';
my $LOCAL_ROOT
   = '[ローカルのパス]';
my $SVN
   = 'svn';
my $DOT_AURC_COPY
   =  dirname ( $0 ) . '/dot_aurc_copy.pl';

my $branch_name = shift ( @ARGV )
  or die 'ブランチ名が無い';

if ( `$SVN log $ROOT/branches/$branch_name 2>&1` =~ /not +found/ ){
  print 'creating branch ' . $branch_name . '.....' . "\n";
  print `$SVN cp -m 'make $branch_name' $ROOT/trunk $ROOT/branches/$branch_name`;
}

if ( !-d "$LOCAL_ROOT/branches/$branch_name" ) {
  print 'checking out branch ' . $branch_name . '.....' . "\n";
  print `$SVN co $ROOT/branches/$branch_name $LOCAL_ROOT/branches/$branch_name` ;
} else {
  print 'updating branch ' . $branch_name . '.....' . "\n";
  print `$SVN update $LOCAL_ROOT/branches/$branch_name`;
}

if (  !-f "$LOCAL_ROOT/branches/$branch_name/.aurc" ) {
  print 'making dot_aurc_copy ' . $branch_name . '.....' . "\n";
  print `perl $DOT_AURC_COPY branches/$branch_name`;
}
Share and Enjoy:
  • Digg
  • del.icio.us
  • Google Bookmarks
  • Tumblr
  • email
  • Facebook
  • FriendFeed

No tags

Find it!

Theme Design by devolux.org

Tag Cloud