Changeset 801 for dasscm/trunk
- Timestamp:
- Nov 10, 2009, 6:05:01 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
dasscm/trunk/dasscm
r800 r801 332 332 ( my $basename, my $dirname_prod ) = fileparse($filename_prod); 333 333 334 # normalize path. 334 # normalize path. 335 335 # not done for reverting, because in this case, the directory may not exist 336 336 # and the correct path should already be stored in the repository 337 337 if ( $command ne "revert" ) { 338 338 339 # uses chdir to determine real directory in a unique way 339 chdir $dirname_prod or fatalerror( "failed to access directory $dirname_prod: " . $! ); 340 chdir $dirname_prod 341 or fatalerror( "failed to access directory $dirname_prod: " . $! ); 340 342 $dirname_prod = normalize_path( cwd() ); 341 343 chdir $StartDirectory; … … 369 371 my $filename_prod, 370 372 my $filename_repo 371 ) 372 = get_filenames($filename); 373 ) = get_filenames($filename); 373 374 374 375 # TODO: are permissions also copied? … … 376 377 or error "failed to copy $filename_prod to repository: $!"; 377 378 } 378 379 379 380 380 # … … 501 501 my $rc_update; 502 502 if ($interactive) { 503 $rc_update = 504 run_interactive( 503 $rc_update = run_interactive( 505 504 "$SVN ls --no-auth-cache --username '$username' --password '$password' $DASSCM_SVN_REPOSITORY" 506 505 ); 507 506 } else { 508 ( $rc_update, my @result ) = 509 run_command( 507 ( $rc_update, my @result ) = run_command( 510 508 "$SVN ls --non-interactive --no-auth-cache --username '$username' --password '$password' $DASSCM_SVN_REPOSITORY" 511 509 ); 512 510 513 511 if ( $rc_update != 0 ) { … … 524 522 } 525 523 526 527 528 524 sub svn_update( ;$ ) 529 525 { … … 535 531 # use this flag to do only one update per run 536 532 if ( !$svnRepositoryIsUptodate ) { 537 ( my $rc_update, my @result ) = 538 run_command( 533 ( my $rc_update, my @result ) = run_command( 539 534 "$SVN update --non-interactive $svnCheckoutCredentials '$DASSCM_REPO/$update_path'" 540 535 ); 541 536 print @result; 542 537 if ( $rc_update != 0 ) { … … 551 546 return $update_ok; 552 547 } 553 554 555 548 556 549 sub svn_ls( ;@ ) … … 562 555 my $filename_prod, 563 556 my $filename_repo 564 ) 565 = get_filenames( $_[0] ); 557 ) = get_filenames( $_[0] ); 566 558 567 559 # svn ls -R is better, but much, much slower … … 595 587 } elsif ( -d $_ ) { 596 588 597 #if( $name."/" eq dirname_repo ) {598 589 # directories 599 590 push( @dirs, $name ); 600 601 #}602 591 } elsif ( -f $_ ) { 603 592 … … 644 633 # remove it 645 634 print "removing $_\n"; 635 646 636 # unlink doesn't work recursive, there "rm -rf" is used 647 637 #unlink($_); 648 system( "rm -rf $_");638 system("rm -rf $_"); 649 639 } 650 640 } … … 660 650 my $filename_prod, 661 651 my $filename_repo 662 ) 663 = get_filenames( $_[0] ); 652 ) = get_filenames( $_[0] ); 664 653 665 654 my @files = svn_ls($filename_prod); … … 837 826 # update complete repository 838 827 # and create permission file 839 my $retcode = 840 run_interactive( 828 my $retcode = run_interactive( 841 829 "cd $DASSCM_LOCAL_REPOSITORY_BASE; $SVN checkout $svnCheckoutCredentials $svnOptions $DASSCM_SVN_REPOSITORY; mkdir -p `dirname $DASSCM_PERMISSION_FILE`; touch $DASSCM_PERMISSION_FILE" 842 830 ); 843 831 } 844 832 … … 878 866 my $filename_prod, 879 867 my $filename_repo 880 ) 881 = get_filenames( $_[0] ); 868 ) = get_filenames( $_[0] ); 882 869 883 870 mkpath($dirname_repo); … … 966 953 # commit calls $EDITOR. 967 954 # use "interactive" here, to display output 968 my $retcode = 969 run_interactive( 955 my $retcode = run_interactive( 970 956 "$SVN commit $svnOptions --username '$DASSCM_USERNAME' $svnPasswordCredentials $DASSCM_REPO" 971 957 ); 972 958 973 959 # svn commit does not deliever an error return code, if commit is canceld, … … 990 976 my $filename_prod, 991 977 my $filename_repo 992 ) 993 = get_filenames( $_[0] ); 978 ) = get_filenames( $_[0] ); 994 979 995 980 # … … 1029 1014 # commit calls $EDITOR. 1030 1015 # use "interactive" here, to display output 1031 my $retcode = 1032 run_interactive( 1016 my $retcode = run_interactive( 1033 1017 "$SVN commit $svnOptions --username '$DASSCM_USERNAME' $svnPasswordCredentials $DASSCM_REPO" 1034 1018 ); 1035 1019 1036 1020 # svn commit does not deliever an error return code, if commit is canceld, … … 1038 1022 svn_revert(); 1039 1023 } 1040 1041 1042 1024 1043 1025 # … … 1055 1037 my $filename_prod, 1056 1038 my $filename_repo 1057 ) 1058 = get_filenames( $_[0] ); 1039 ) = get_filenames( $_[0] ); 1059 1040 1060 1041 # return code for the shell … … 1062 1043 my $return_code = $RETURN_OK; 1063 1044 1064 1065 1045 # cleanup repository 1066 ##cleanup();1046 cleanup(); 1067 1047 #svn_update(); 1068 1048 … … 1077 1057 if (%removedfiles) { 1078 1058 print "DELETED files and directories. Recreated from repository:\n"; 1079 my @removedPaths = ( sort { length $a > length $b } keys %removedfiles ); 1059 my @removedPaths = 1060 ( sort { length $a > length $b } keys %removedfiles ); 1080 1061 print join( "\n", @removedPaths ) . "\n\n"; 1081 1062 … … 1083 1064 # and also create directories 1084 1065 # paths are sorted, so that directories are created first 1085 for my $real_path ( @removedPaths) {1086 if ( -d $removedfiles{"$real_path"} ) {1066 for my $real_path (@removedPaths) { 1067 if ( -d $removedfiles{"$real_path"} ) { 1087 1068 mkpath("$real_path"); 1088 1069 } else { 1089 copy( $removedfiles{"$real_path"}, $real_path ) or error( "failed to copy " . $removedfiles{"$real_path"} . " to " . $real_path . ": " . $! ); 1070 copy( $removedfiles{"$real_path"}, $real_path ) 1071 or error( "failed to copy " 1072 . $removedfiles{"$real_path"} . " to " 1073 . $real_path . ": " 1074 . $! ); 1090 1075 } 1091 1076 } … … 1116 1101 return $return_code; 1117 1102 } 1118 1119 1120 1103 1121 1104 sub blame(@) … … 1130 1113 my $filename_prod, 1131 1114 my $filename_repo 1132 ) 1133 = get_filenames( $_[0] ); 1115 ) = get_filenames( $_[0] ); 1134 1116 1135 1117 my $retcode = run_interactive("$SVN blame $svnOptions $filename_repo"); … … 1147 1129 my $filename_prod, 1148 1130 my $filename_repo 1149 ) 1150 = get_filenames( $_[0] ); 1131 ) = get_filenames( $_[0] ); 1151 1132 1152 1133 #print "$basename,$dirname_prod,$dirname_repo\n"; … … 1171 1152 my $filename_prod, 1172 1153 my $filename_repo 1173 ) 1174 = get_filenames( $_[0] || "/" ); 1154 ) = get_filenames( $_[0] || "/" ); 1175 1155 1176 1156 # return code for the shell … … 1413 1393 commit(@ARGV); 1414 1394 } elsif (m/^revert$/i) { 1415 $command = "revert";1395 $command = "revert"; 1416 1396 $return_code = revert(@ARGV); 1417 1397 } elsif (m/^blame$/i) {
Note:
See TracChangeset
for help on using the changeset viewer.