Subversion Repositories DevTools

Rev

Rev 2053 | Rev 2354 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2053 Rev 2071
Line 923... Line 923...
923
    SubCommandHelp( $opt_help, "Delete Branch") if ($opt_help);
923
    SubCommandHelp( $opt_help, "Delete Branch") if ($opt_help);
924
 
924
 
925
    #
925
    #
926
    #   Sanity Tests
926
    #   Sanity Tests
927
    #
927
    #
928
    Message ("Delete Workspace Branch" );
928
    Message ("Delete Workspace Branchs" );
929
    Error ("Too many arguments: @ARGV") if ( $#ARGV >= 0 );
-
 
930
 
929
 
931
    #
930
    #
932
    #   Do all the hard work
931
    #   Do all the hard work
933
    #
932
    #
934
    $opt_path = '.' unless ( defined $opt_path );
933
    $opt_path = '.' unless ( defined $opt_path );
935
    my $uref = NewSessionByWS($opt_path, 0, 1);
934
    my $uref = NewSessionByWS($opt_path, 0, 1);
936
    my $ws_root = $uref->SvnLocateWsRoot(1);
935
    my $ws_root = $uref->SvnLocateWsRoot(1);
937
    my $ws_url = $uref->FullWs();
936
    my $ws_url = $uref->FullWs();
938
 
937
 
939
    #
938
    #
940
    #   Must be a branch
939
    #   What we do depends what aruments the user provided
941
    #
940
    #
-
 
941
    unless ( @ARGV )
-
 
942
    {
-
 
943
        #
-
 
944
        #   If no branch was specified - then display the workspace branch
-
 
945
        #
942
    Error ("Workspace is not based on a branch")
946
        Error ('The workspace is not based on a branch')
943
        unless ( $ws_url =~ m ~/branches/~ );
947
            unless ( $ws_url =~ m ~/branches/(.*)~ );
-
 
948
        Message('The workspace is based on the branch: '. $1);
-
 
949
    }
-
 
950
    else
944
 
951
    {
-
 
952
        #
-
 
953
        #   Delete all specified branches
-
 
954
        #
-
 
955
        foreach my $branch ( @ARGV )
-
 
956
        {
945
    Message ("Deleting: " . $uref->{WSURL} );
957
            Message ("Deleting: " . $branch );
-
 
958
            my $target = join( '/', $uref->FullPath(), 'branches', $branch);
946
    $uref->SvnDelete (
959
            if ( $uref->SvnDelete (
947
                      'target'    => $ws_url,
960
                              'target'    => $target,
948
                      'comment'   => [$uref->Path().": Delete Branch",'Deleted by user command: jats svn delete-branch'],
961
                              'comment'   => [$uref->Path().": Delete Branch",'Deleted by user command: jats svn delete-branch'],
-
 
962
                              'noerror'   => 1,
949
                      );
963
                              )
-
 
964
               )
-
 
965
            {
-
 
966
                Warning ("Branch deletion failed: $branch");
-
 
967
            }
-
 
968
        }
-
 
969
    }
950
    $opr_done = 1;
970
    $opr_done = 1;
951
}
971
}
952
 
972
 
953
#-------------------------------------------------------------------------------
973
#-------------------------------------------------------------------------------
954
# Function        : CreateBranch
974
# Function        : CreateBranch
Line 1257... Line 1277...
1257
=item B<-man>
1277
=item B<-man>
1258
 
1278
 
1259
This is the same as '-help=3'.
1279
This is the same as '-help=3'.
1260
The complete help is produced in a man page format.
1280
The complete help is produced in a man page format.
1261
 
1281
 
1262
=item B<--verbose[=n]>
1282
=item B<-verbose[=n]>
1263
 
1283
 
1264
This option will increase the level of verbosity of the commands.
1284
This option will increase the level of verbosity of the commands.
1265
 
1285
 
1266
If an argument is provided, then it will be used to set the level, otherwise the
1286
If an argument is provided, then it will be used to set the level, otherwise the
1267
existing level will be incremented. This option may be specified multiple times.
1287
existing level will be incremented. This option may be specified multiple times.
Line 1703... Line 1723...
1703
 
1723
 
1704
Delete the Workspace Branch
1724
Delete the Workspace Branch
1705
 
1725
 
1706
=head2 SYNOPSIS
1726
=head2 SYNOPSIS
1707
 
1727
 
1708
jats svn delete-branch [options]
1728
jats svn delete-branch [options] [branch-list]
1709
 
1729
 
1710
 Options:
1730
 Options:
1711
    -help[=n]              - Help message, [n=1,2,3]
1731
    -help[=n]              - Help message, [n=1,2,3]
1712
    -man                   - Full documentation [-help=3]
1732
    -man                   - Full documentation [-help=3]
1713
    -verbose[=n]           - Verbose command operation
1733
    -verbose[=n]           - Verbose command operation
1714
    -path=path             - Target workspace
1734
    -path=path             - Target workspace
1715
 
1735
 
1716
=head2 ARGUMENTS
1736
=head2 ARGUMENTS
1717
 
1737
 
-
 
1738
The command may take zero ro more arguments. If provided the arguments will be
1718
The command takes no arguments.
1739
branch names to be deleted.
1719
 
1740
 
1720
=head2 OPTIONS
1741
=head2 OPTIONS
1721
 
1742
 
1722
=over
1743
=over
1723
 
1744
 
Line 1728... Line 1749...
1728
 
1749
 
1729
=back
1750
=back
1730
 
1751
 
1731
=head2 DESCRIPTION
1752
=head2 DESCRIPTION
1732
 
1753
 
1733
This command will delete the branch associated with the workspace in the
1754
This command can display the branch associated with the workspace or it can
1734
specified path. It is intended to simplify the deletion of Private or
1755
delete one or more branches. It is intended to simplify the deletion of Private
1735
Development branches.
1756
or Development branches.
-
 
1757
 
-
 
1758
=over 4
-
 
1759
 
-
 
1760
=item 1 Arguments are provided
-
 
1761
 
-
 
1762
The command will delete all the named branches. If a named branch does not exist
-
 
1763
then the command will issue a warning message.
-
 
1764
 
-
 
1765
=item 2 No arguments provided
-
 
1766
 
-
 
1767
The command will display the branch associated with the workspace
1736
 
1768
 
1737
If the workspace is not linked to a 'branch' then the command will fail.
1769
If the workspace is not linked to a 'branch' then the command will fail.
1738
 
1770
 
-
 
1771
=back
-
 
1772
 
1739
=head1 Import directory to a Package
1773
=head1 Import directory to a Package
1740
 
1774
 
1741
=head2 NAME
1775
=head2 NAME
1742
 
1776
 
1743
Import directory to a Package
1777
Import directory to a Package