Subversion Repositories DevTools

Rev

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

Rev 1356 Rev 2048
Line 20... Line 20...
20
use warnings;
20
use warnings;
21
use JatsError;
21
use JatsError;
22
use JatsSvn qw(:All);
22
use JatsSvn qw(:All);
23
use JatsLocateFiles;
23
use JatsLocateFiles;
24
use JatsProperties;
24
use JatsProperties;
25
 
-
 
26
 
-
 
27
use Pod::Usage;                                 # required for help support
25
use Pod::Usage;                                 # required for help support
28
use Getopt::Long qw(:config require_order);     # Stop on non-option
26
use Getopt::Long qw(:config require_order);     # Stop on non-option
29
use Cwd;
27
use Cwd;
30
use File::Path;
28
use File::Path;
31
use File::Copy;
29
use File::Copy;
Line 88... Line 86...
88
#   Process command
86
#   Process command
89
#   First command line argument is a subversion command
87
#   First command line argument is a subversion command
90
#
88
#
91
my $cmd = shift @ARGV || "help";
89
my $cmd = shift @ARGV || "help";
92
CreatePackage()                        if ( $cmd =~ m/^create/ );
90
CreatePackage()                        if ( $cmd =~ m/^create/ );
-
 
91
CreateBranch()                         if ( $cmd =~ m/^branch/ );
-
 
92
SwitchBranch()                         if ( $cmd =~ m/^switch/ );
93
DeleteBranch()                         if ( $cmd =~ m/^delete-branch/ );
93
DeleteBranch()                         if ( $cmd =~ m/^delete-branch/ );
94
DeletePackage()                        if ( $cmd =~ m/^delete-package/ );
94
DeletePackage()                        if ( $cmd =~ m/^delete-package/ );
95
ImportPackage()                        if ( $cmd =~ m/^import/ );
95
ImportPackage()                        if ( $cmd =~ m/^import/ );
96
SvnRepoCmd($cmd, @ARGV)                if ( $cmd eq 'ls' );
96
SvnRepoCmd($cmd, @ARGV)                if ( $cmd eq 'ls' );
97
TestSvn()                              if ($cmd eq 'test');
97
TestSvn()                              if ($cmd eq 'test');
Line 105... Line 105...
105
#-------------------------------------------------------------------------------
105
#-------------------------------------------------------------------------------
106
# Function        : ShowPaths
106
# Function        : ShowPaths
107
#
107
#
108
# Description     : Show PATHS
108
# Description     : Show PATHS
109
#
109
#
110
# Inputs          : 
110
# Inputs          :
111
#
111
#
112
# Returns         : 
112
# Returns         :
113
#
113
#
114
sub ShowPaths
114
sub ShowPaths
115
{
115
{
116
    #
116
    #
117
    #   Parse more options
117
    #   Parse more options
Line 205... Line 205...
205
        $uref->CalcRmReference($uref->FullWs());
205
        $uref->CalcRmReference($uref->FullWs());
206
    }
206
    }
207
 
207
 
208
    Message ("Tag is  : " . $uref->RmRef() );
208
    Message ("Tag is  : " . $uref->RmRef() );
209
    Message ("Vcs Tag : " . $uref->SvnTag  );
209
    Message ("Vcs Tag : " . $uref->SvnTag  );
210
    
210
 
211
    $opr_done = 1;
211
    $opr_done = 1;
212
}
212
}
213
#-------------------------------------------------------------------------------
213
#-------------------------------------------------------------------------------
214
# Function        : ShowUrl
214
# Function        : ShowUrl
215
#
215
#
Line 303... Line 303...
303
    SubCommandHelp( $opt_help, "Test Subversion") if ($opt_help || $#ARGV >= 0);
303
    SubCommandHelp( $opt_help, "Test Subversion") if ($opt_help || $#ARGV >= 0);
304
 
304
 
305
    SvnUserCmd( '--version');
305
    SvnUserCmd( '--version');
306
    $opr_done = 1;
306
    $opr_done = 1;
307
}
307
}
308
 
-
 
309
 
-
 
310
#-------------------------------------------------------------------------------
308
#-------------------------------------------------------------------------------
311
# Function        : SvnRepoCmd
309
# Function        : SvnRepoCmd
312
#
310
#
313
# Description     : Execute a SVN command, where the first argument
311
# Description     : Execute a SVN command, where the first argument
314
#                   is a repository specifier
312
#                   is a repository specifier
315
#
313
#
316
# Inputs          : $cmd
314
# Inputs          : $cmd
317
#                   $repo_url
315
#                   $repo_url
318
#                   @opts
316
#                   @opts
319
#
317
#
320
# Returns         : 
318
# Returns         :
321
#
319
#
322
sub SvnRepoCmd
320
sub SvnRepoCmd
323
{
321
{
324
    my ( $cmd, $repo_url, @opts ) = @_;
322
    my ( $cmd, $repo_url, @opts ) = @_;
325
    my $uref = NewSessionByUrl ( $repo_url );
323
    my $uref = NewSessionByUrl ( $repo_url );
326
 
324
 
327
    SvnUserCmd( $cmd,
325
    SvnUserCmd( $cmd,
328
            $uref->Full,
326
            $uref->Full,
329
            @opts,
327
            @opts,
330
            { 'credentials' => 1 });
328
            { 'credentials' => 1 });
331
            
329
 
332
    $opr_done = 1;
330
    $opr_done = 1;
333
}
331
}
334
 
332
 
335
#-------------------------------------------------------------------------------
333
#-------------------------------------------------------------------------------
336
# Function        : DeletePackage
334
# Function        : DeletePackage
Line 338... Line 336...
338
# Description     : Delete a Package structure within a Repository
336
# Description     : Delete a Package structure within a Repository
339
#                   Intended for test usage
337
#                   Intended for test usage
340
#
338
#
341
# Inputs          : URL                 - Url to Repo + Package Base
339
# Inputs          : URL                 - Url to Repo + Package Base
342
#
340
#
343
# Returns         : 
341
# Returns         :
344
#
342
#
345
sub DeletePackage
343
sub DeletePackage
346
{
344
{
347
    my $opt_error = 0;
345
    my $opt_error = 0;
348
    #
346
    #
Line 396... Line 394...
396
#                       -tag=name       - Import to Tag Only
394
#                       -tag=name       - Import to Tag Only
397
#                       -branch=name    - Import to Branch only
395
#                       -branch=name    - Import to Branch only
398
#                       -new            - Must be new package
396
#                       -new            - Must be new package
399
#                       -replace        - Replace existing
397
#                       -replace        - Replace existing
400
#
398
#
401
# Returns         : 
399
# Returns         :
402
#
400
#
403
sub CreatePackage
401
sub CreatePackage
404
{
402
{
405
    my $opt_import;
403
    my $opt_import;
406
    my $opt_tag;
404
    my $opt_tag;
Line 411... Line 409...
411
    my $opt_replace;
409
    my $opt_replace;
412
    my $pname;
410
    my $pname;
413
    my $type;
411
    my $type;
414
    my $opt_author;
412
    my $opt_author;
415
    my $opt_date;
413
    my $opt_date;
416
 
-
 
417
 
-
 
418
    Message ("Create New Package Version" );
414
    Message ("Create New Package Version" );
419
 
415
 
420
    #
416
    #
421
    #   Parse more options
417
    #   Parse more options
422
    #
418
    #
Line 438... Line 434...
438
 
434
 
439
    #
435
    #
440
    #   Subcommand specific help
436
    #   Subcommand specific help
441
    #
437
    #
442
    SubCommandHelp( $opt_help, "Create a Package Version") if ($opt_help || $#ARGV < 0);
438
    SubCommandHelp( $opt_help, "Create a Package Version") if ($opt_help || $#ARGV < 0);
443
                
-
 
-
 
439
 
444
    #
440
    #
445
    #   Alter the error reporting parameters
441
    #   Alter the error reporting parameters
446
    #
442
    #
447
    ErrorConfig( 'verbose' => $opt_verbose );
443
    ErrorConfig( 'verbose' => $opt_verbose );
448
 
444
 
Line 498... Line 494...
498
#                   the  package
494
#                   the  package
499
#
495
#
500
#                   Intended to allow the importation of multiple
496
#                   Intended to allow the importation of multiple
501
#                   versions of a package
497
#                   versions of a package
502
#
498
#
503
# Inputs          : 
499
# Inputs          :
504
#
500
#
505
# Returns         : 
501
# Returns         :
506
#
502
#
507
sub ImportPackage
503
sub ImportPackage
508
{
504
{
509
    Message ("Import Package Version" );
505
    Message ("Import Package Version" );
510
 
506
 
Line 561... Line 557...
561
    #   Insert defaults
557
    #   Insert defaults
562
    #   User can specify base package via -package or a non-options argument
558
    #   User can specify base package via -package or a non-options argument
563
    #
559
    #
564
    $opt_package = $ARGV[0] unless ( $opt_package );
560
    $opt_package = $ARGV[0] unless ( $opt_package );
565
    unlink $opt_datafile if ( defined $opt_datafile );
561
    unlink $opt_datafile if ( defined $opt_datafile );
566
                    
-
 
-
 
562
 
567
    #
563
    #
568
    #   Subcommand specific help
564
    #   Subcommand specific help
569
    #
565
    #
570
    SubCommandHelp( $opt_help, "Import directory to a Package")
566
    SubCommandHelp( $opt_help, "Import directory to a Package")
571
        if ($opt_help || ! $opt_package );
567
        if ($opt_help || ! $opt_package );
Line 645... Line 641...
645
    }
641
    }
646
    else
642
    else
647
    {
643
    {
648
        Message ("Reusing Workspace");
644
        Message ("Reusing Workspace");
649
    }
645
    }
650
                    
-
 
-
 
646
 
651
    #
647
    #
652
    #   Determine differences between the two folders
648
    #   Determine differences between the two folders
653
    #       Create structures for each directory
649
    #       Create structures for each directory
654
    #
650
    #
655
    Message ("Determine Files in packages");
651
    Message ("Determine Files in packages");
Line 745... Line 741...
745
            my $end = $base + 200;
741
            my $end = $base + 200;
746
            $end = $num if ( $end > $num );
742
            $end = $num if ( $end > $num );
747
 
743
 
748
            $svn->SvnCmd ( 'delete', map ("$opt_workdir/$_@", @rm_files[$base .. $end] ),
744
            $svn->SvnCmd ( 'delete', map ("$opt_workdir/$_@", @rm_files[$base .. $end] ),
749
                            { 'error' => 'Deleting files from workspace' } );
745
                            { 'error' => 'Deleting files from workspace' } );
750
            
746
 
751
            $base = $end + 1;
747
            $base = $end + 1;
752
        }
748
        }
753
    }
749
    }
754
    
750
 
755
    #
751
    #
756
    #   Add New Files
752
    #   Add New Files
757
    #   Won't add empty directories at this point
753
    #   Won't add empty directories at this point
758
    #
754
    #
759
    #   Process by sorted list
755
    #   Process by sorted list
Line 902... Line 898...
902
#-------------------------------------------------------------------------------
898
#-------------------------------------------------------------------------------
903
# Function        : DeleteBranch
899
# Function        : DeleteBranch
904
#
900
#
905
# Description     : Delete the branch that a workspace is based upon
901
# Description     : Delete the branch that a workspace is based upon
906
#
902
#
907
# Inputs          : 
903
# Inputs          :
908
#
904
#
909
# Returns         : 
905
# Returns         :
910
#
906
#
911
sub DeleteBranch
907
sub DeleteBranch
912
{
908
{
913
    my $opt_path;
909
    my $opt_path;
914
    my $opt_error = 0;
910
    my $opt_error = 0;
Line 952... Line 948...
952
                      'comment'   => [$uref->Path().": Delete Branch",'Deleted by user command: jats svn delete-branch'],
948
                      'comment'   => [$uref->Path().": Delete Branch",'Deleted by user command: jats svn delete-branch'],
953
                      );
949
                      );
954
    $opr_done = 1;
950
    $opr_done = 1;
955
}
951
}
956
 
952
 
-
 
953
#-------------------------------------------------------------------------------
-
 
954
# Function        : CreateBranch
-
 
955
#
-
 
956
# Description     : Branch a workspace and then switch to the new branch
-
 
957
#
-
 
958
# Inputs          :
-
 
959
#
-
 
960
# Returns         :
-
 
961
#
-
 
962
sub CreateBranch
-
 
963
{
-
 
964
    my $opt_path;
-
 
965
    my $opt_comment;
-
 
966
    my $opt_switch = 1;
-
 
967
    my $opt_branch;
-
 
968
 
-
 
969
    #
-
 
970
    #   Parse more options
-
 
971
    #
-
 
972
    GetOptions (
-
 
973
                "help:+"        => \$opt_help,
-
 
974
                "manual:3"      => \$opt_help,
-
 
975
                "path:s"        => \$opt_path,
-
 
976
                "switch!"       => \$opt_switch,
-
 
977
                "comment:s"     => \$opt_comment,
-
 
978
                ) || Error ("Invalid command line" );
-
 
979
 
-
 
980
    #
-
 
981
    #   Subcommand specific help
-
 
982
    #
-
 
983
    SubCommandHelp( $opt_help, "Create Branch") if ($opt_help);
-
 
984
 
-
 
985
    #
-
 
986
    #   Sanity Tests
-
 
987
    #
-
 
988
    Message ("Create Workspace Branch" );
-
 
989
    Error ("Too many arguments: @ARGV") if ( $#ARGV > 0 );
-
 
990
    Error ("Not enough arguments. No branch name specified") if ( $#ARGV < 0 );
-
 
991
 
-
 
992
    #
-
 
993
    #   Sanity test the label
-
 
994
    #
-
 
995
    $opt_branch = SvnIsaSimpleLabel ($ARGV[0] );
-
 
996
 
-
 
997
    #
-
 
998
    #   Do all the hard work
-
 
999
    #
-
 
1000
    $opt_path = '.' unless ( defined $opt_path );
-
 
1001
    my $uref = NewSessionByWS($opt_path, 0, 1);
-
 
1002
    my $ws_root = $uref->SvnLocateWsRoot(1);
-
 
1003
    my $ws_url = $uref->Full();
-
 
1004
 
-
 
1005
    #
-
 
1006
    #   Use the verion of the branch that has been committed as the base of the
-
 
1007
    #   copy. If the user has modified files, then they won't be commited
-
 
1008
    #
-
 
1009
    #   This operation will be server-side only
-
 
1010
    #
-
 
1011
    Message ("Creating branch: $opt_branch");
-
 
1012
    my $repoLink = $uref->{InfoWs}{URL} . '@' . $uref->{InfoWs}{Revision};
-
 
1013
    $uref->{DEVBRANCH} =  join ('/', 'branches', $opt_branch);
-
 
1014
    my $branch_tag = $uref->SvnCopy (
-
 
1015
                'old' => $repoLink,
-
 
1016
                'new' => join ('/', $ws_url, $uref->{DEVBRANCH} ),
-
 
1017
                'comment' => $opt_comment ? $opt_comment : 'Created by Jats svn branch',
-
 
1018
                'replace' => 0,
-
 
1019
                );
-
 
1020
 
-
 
1021
    if ( $opt_switch )
-
 
1022
    {
-
 
1023
        Verbose ("Switching to new branch: $opt_branch");
-
 
1024
        $branch_tag = SvnPath2Url($branch_tag);
-
 
1025
        $uref->SvnSwitch ($branch_tag,
-
 
1026
                          $opt_path,
-
 
1027
                          '--Print' );
-
 
1028
    }
-
 
1029
    else
-
 
1030
    {
-
 
1031
        Warning ("Using existing workspace, not the created branch");
-
 
1032
    }
-
 
1033
    Message ("Repository Ref: " . $uref->RmRef);
-
 
1034
    Message ("Vcs Tag       : " . $uref->SvnTag);
-
 
1035
 
-
 
1036
#    #
-
 
1037
#    #   The copy operation *should* be a server side operation only
-
 
1038
#    #   If the user has commited changes, but not yet updated the local
-
 
1039
#    #   workspace, then subversion will do a client side copy
-
 
1040
#    #   This is not good.
-
 
1041
#    #
-
 
1042
#    $uref->SvnCopyWs (
-
 
1043
#                   target => join ('/', $ws_url, 'branches', $opt_branch),
-
 
1044
#                   'allowLocalMods' => 1,
-
 
1045
#                   'noupdatecheck' => 1,
-
 
1046
#                   'noswitch' => ! $opt_switch,
-
 
1047
#                   'replace' => 0,
-
 
1048
#                   'comment' => $opt_comment ? $opt_comment : 'Created by Jats svn branch',
-
 
1049
#                   );
-
 
1050
#
-
 
1051
#    Message ("Repository Ref: " . $uref->RmRef);
-
 
1052
#    Message ("Vcs Tag       : " . $uref->SvnTag);
-
 
1053
 
-
 
1054
    $opr_done = 1;
-
 
1055
}
957
 
1056
 
958
#-------------------------------------------------------------------------------
1057
#-------------------------------------------------------------------------------
-
 
1058
# Function        : SwitchBranch
-
 
1059
#
-
 
1060
# Description     : Switch to a specified branch
-
 
1061
#
-
 
1062
# Inputs          :
-
 
1063
#
-
 
1064
# Returns         :
-
 
1065
#
-
 
1066
sub SwitchBranch
-
 
1067
{
-
 
1068
    my $opt_path = '.';
-
 
1069
    my $opt_branch;
-
 
1070
 
-
 
1071
    #
-
 
1072
    #   Parse more options
-
 
1073
    #
-
 
1074
    GetOptions (
-
 
1075
                "help:+"        => \$opt_help,
-
 
1076
                "manual:3"      => \$opt_help,
-
 
1077
                "path:s"        => \$opt_path,
-
 
1078
                ) || Error ("Invalid command line" );
-
 
1079
 
-
 
1080
    #
-
 
1081
    #   Subcommand specific help
-
 
1082
    #
-
 
1083
    SubCommandHelp( $opt_help, "Switch Branch") if ($opt_help);
-
 
1084
    return ShowBranches($opt_path) if ( $#ARGV < 0 );
-
 
1085
 
-
 
1086
    #
-
 
1087
    #   Sanity Tests
-
 
1088
    #
-
 
1089
    Error ("Too many arguments: @ARGV") if ( $#ARGV > 0 );
-
 
1090
 
-
 
1091
    #
-
 
1092
    #   Calculate the target name
-
 
1093
    #       trunk is special
-
 
1094
    #       tags/... is special
-
 
1095
    $opt_branch = $ARGV[0];
-
 
1096
    if ( $opt_branch eq 'trunk' ) {
-
 
1097
    } elsif ( $opt_branch =~ m~tags/.+~ ) {
-
 
1098
    } else {
-
 
1099
        $opt_branch = join ('/', 'branches', $opt_branch);
-
 
1100
    }
-
 
1101
    Message ("Switching to new branch: $opt_branch");
-
 
1102
 
-
 
1103
    #
-
 
1104
    #   Do all the hard work
-
 
1105
    #
-
 
1106
    my $uref = NewSessionByWS($opt_path, 0, 1);
-
 
1107
    my $ws_url = $uref->Full();
-
 
1108
    my $branch_tag = join ('/', $ws_url, $opt_branch);
-
 
1109
 
-
 
1110
    #
-
 
1111
    #   Validate the branch
-
 
1112
    #
-
 
1113
    $uref->SvnValidateTarget (
-
 
1114
                        'cmd'    => 'svn switch',
-
 
1115
                        'target' => $branch_tag,
-
 
1116
                        'require' => 1,
-
 
1117
                        );
-
 
1118
 
-
 
1119
    $uref->SvnSwitch ($branch_tag, $opt_path, '--Print' );
-
 
1120
    $opr_done = 1;
-
 
1121
}
-
 
1122
 
-
 
1123
#-------------------------------------------------------------------------------
-
 
1124
# Function        : ShowBranches
-
 
1125
#
-
 
1126
# Description     : Show branches in current workspace
-
 
1127
#                   Internal use only
-
 
1128
#
-
 
1129
# Inputs          : $opt_path           - Optional path
-
 
1130
#
-
 
1131
# Returns         :
-
 
1132
#
-
 
1133
sub ShowBranches
-
 
1134
{
-
 
1135
    my ($opt_path) = @_;
-
 
1136
 
-
 
1137
    my $uref = NewSessionByWS($opt_path, 0, 1);
-
 
1138
    my $ws_url = $uref->Full();
-
 
1139
 
-
 
1140
    #
-
 
1141
    #   Display the packages full URL - allow the user to manuallu look at more
-
 
1142
    #   List the bracnhes
-
 
1143
    #
-
 
1144
    Message ("Url: $ws_url", 'Available Branches');
-
 
1145
    SvnUserCmd( 'ls', join ('/', $ws_url, 'branches'), { 'credentials' => 1 });
-
 
1146
    $opr_done = 1;
-
 
1147
}
-
 
1148
#-------------------------------------------------------------------------------
959
# Function        : SubCommandHelp
1149
# Function        : SubCommandHelp
960
#
1150
#
961
# Description     : Provide help on a subcommand
1151
# Description     : Provide help on a subcommand
962
#
1152
#
963
# Inputs          : $help_level             - Help Level 1,2,3
1153
# Inputs          : $help_level             - Help Level 1,2,3
Line 986... Line 1176...
986
    pod2usage({-verbose => 99,
1176
    pod2usage({-verbose => 99,
987
               -noperldoc => 1,
1177
               -noperldoc => 1,
988
               -sections => $topic . '/' . join('|', @sections) } );
1178
               -sections => $topic . '/' . join('|', @sections) } );
989
}
1179
}
990
 
1180
 
991
 
-
 
992
 
-
 
993
#-------------------------------------------------------------------------------
1181
#-------------------------------------------------------------------------------
994
#   Documentation
1182
#   Documentation
995
#   NOTE
1183
#   NOTE
996
#
1184
#
997
#   Each subcommand MUST have
1185
#   Each subcommand MUST have
Line 1035... Line 1223...
1035
    test                   - Test access to subversion
1223
    test                   - Test access to subversion
1036
    paths                  - Display Subversion tag to URL conversions
1224
    paths                  - Display Subversion tag to URL conversions
1037
    ls URL                 - List Repo contents for URL
1225
    ls URL                 - List Repo contents for URL
1038
    tag [URL]              - Convert URL or Path to a Release Manager Tag
1226
    tag [URL]              - Convert URL or Path to a Release Manager Tag
1039
    url [TAG]              - Convert TAG or Path to a Subversion URL
1227
    url [TAG]              - Convert TAG or Path to a Subversion URL
-
 
1228
    create-package URL     - Create a new package at URL
1040
    delete-package URL     - Delete Package Subtree
1229
    delete-package URL     - Delete Package Subtree
-
 
1230
    branch BRANCH          - Create a Development Branch
-
 
1231
    switch [BRANCH]        - Switch to a Development Branch
1041
    delete-branch          - Delete a Development Branch
1232
    delete-branch          - Delete a Development Branch
1042
    create URL             - Create a new package at URL
-
 
1043
    import URL             - Import files to package at URL
1233
    import URL             - Import files to package at URL
1044
 
1234
 
1045
 Use the command
1235
 Use the command
1046
    jats svn command -h
1236
    jats svn command -h
1047
 for command specific help
1237
 for command specific help
1048
 
1238
 
1049
 
-
 
1050
=head1 OPTIONS
1239
=head1 OPTIONS
1051
 
1240
 
1052
=over
1241
=over
1053
 
1242
 
1054
=item B<-help[=n]>
1243
=item B<-help[=n]>
Line 1193... Line 1382...
1193
 
1382
 
1194
If a TAG is to be converted, then the resultant value should be used with
1383
If a TAG is to be converted, then the resultant value should be used with
1195
caution. The result is only as good as the provided URL and may not address
1384
caution. The result is only as good as the provided URL and may not address
1196
the root of a package.
1385
the root of a package.
1197
 
1386
 
-
 
1387
=head1 Create a Package Version
-
 
1388
 
-
 
1389
=head2 NAME
-
 
1390
 
-
 
1391
Create a Package Version
-
 
1392
 
-
 
1393
=head2 SYNOPSIS
-
 
1394
 
-
 
1395
jats svn [options] create-package URL [command options]
-
 
1396
 
-
 
1397
 Options:
-
 
1398
    -help[=n]               - Help message, [n=1,2,3]
-
 
1399
    -man                    - Full documentation [-help=3]
-
 
1400
    -verbose[=n]            - Verbose command operation
-
 
1401
 
-
 
1402
 Command Options
-
 
1403
    -help[=n]               - Provide command specific help
-
 
1404
    -new                    - Package must not exist
-
 
1405
    -replace                - Replace any existing versions
-
 
1406
    -import=nnn             - Import directory tree
-
 
1407
    -label=nnn              - Label imported package
-
 
1408
    -trunk                  - Import to trunk (default)
-
 
1409
    -tags=nnn               - Import to tags
-
 
1410
    -branch=nnn             - Import to branches
-
 
1411
 
-
 
1412
=head2 ARGUMENTS
-
 
1413
 
-
 
1414
The command takes one argument: The URL of the desired package.
-
 
1415
This may be be:
-
 
1416
 
-
 
1417
=over
-
 
1418
 
-
 
1419
=item * A full URL
-
 
1420
 
-
 
1421
Complete with protocol and path information.
-
 
1422
 
-
 
1423
=item * A simple URL
-
 
1424
 
-
 
1425
JATS will prepend the site-specific repository location to the user provided URL
-
 
1426
 
-
 
1427
=back
-
 
1428
 
-
 
1429
=head2 OPTIONS
-
 
1430
 
-
 
1431
=over
-
 
1432
 
-
 
1433
=item -help[=n]
-
 
1434
 
-
 
1435
Print a help message and exit. The level of help may be either 1, 2 or 3.
-
 
1436
 
-
 
1437
This option may be specified multiple times to increment the help level, or
-
 
1438
the help level may be directly specified as a number.
-
 
1439
 
-
 
1440
=item -new
-
 
1441
 
-
 
1442
This option specifies that the named package MUST not exist at all.
-
 
1443
 
-
 
1444
=item -replace
-
 
1445
 
-
 
1446
This option allows the program to replace any existing versions of the
-
 
1447
imported source. It will allow the deletion of any existing trunk, tags or
-
 
1448
branches.
-
 
1449
 
-
 
1450
=item -import=nnn
-
 
1451
 
-
 
1452
This option specifies the path of a subdirectory tree to import into the newly
-
 
1453
created package. In not provided, then only a package skeleton will be created.
-
 
1454
 
-
 
1455
=item -label=nnn
-
 
1456
 
-
 
1457
This option specifies a label to place the imported source.
-
 
1458
 
-
 
1459
=item -trunk
-
 
1460
 
-
 
1461
This option specifies that imported source will be placed on the trunk of the
-
 
1462
package. This is the default mode of import.
-
 
1463
 
-
 
1464
The options -trunk, -tags and -branch are mutually exclusive.
-
 
1465
 
-
 
1466
=item -tags=nnn
-
 
1467
 
-
 
1468
This option specifies that imported source will be placed directly on the
-
 
1469
named tag of the package.
-
 
1470
 
-
 
1471
The options -trunk, -tags and -branch are mutually exclusive.
-
 
1472
 
-
 
1473
=item -branch=nnn
-
 
1474
 
-
 
1475
This option specifies that imported source will be placed directly on the
-
 
1476
named branch of the package.
-
 
1477
 
-
 
1478
The options -trunk, -tags and -branch are mutually exclusive.
-
 
1479
 
-
 
1480
=back
-
 
1481
 
-
 
1482
=head2 DESCRIPTION
-
 
1483
 
-
 
1484
This command will create a new package within a repository. It will ensure
-
 
1485
that the package contains the three required subdirectories: trunk, tags and
-
 
1486
branches.
-
 
1487
 
-
 
1488
The command will also ensure that packages are not placed at inappropriate
-
 
1489
locations within the repository. It is not correct to place a package within
-
 
1490
another package.
-
 
1491
 
-
 
1492
The command will, optionally, import a directory tree into the repository and,
-
 
1493
optionally, label the package.
-
 
1494
 
-
 
1495
The package body may be imported to the 'trunk' or to a branch or a tag.
-
 
1496
By default the data will be imported to the trunk and may be labeled (tagged).
-
 
1497
 
-
 
1498
Options allow the targets to be deleted if they exist or to ensure that they
-
 
1499
are not present.
-
 
1500
 
-
 
1501
The command does not attempt to merge file versions within the repository. It
-
 
1502
may result in multiple instances of a file within the repository. Use only for
-
 
1503
simple imports. Use the 'import' command for more sophisticated import requirements.
-
 
1504
 
1198
=head1 Delete a Package
1505
=head1 Delete a Package
1199
 
1506
 
1200
=head2 NAME
1507
=head2 NAME
1201
 
1508
 
1202
Delete a Package
1509
Delete a Package
Line 1236... Line 1543...
1236
This command will delete a package from the repository. It will ensure
1543
This command will delete a package from the repository. It will ensure
1237
that the package is a valid package, before it is deleted.
1544
that the package is a valid package, before it is deleted.
1238
 
1545
 
1239
The command is intended to be used by test scripts, rather than users.
1546
The command is intended to be used by test scripts, rather than users.
1240
 
1547
 
1241
=head1 Delete Branch
1548
=head1 Create Branch
1242
 
1549
 
1243
=head2 NAME
1550
=head2 NAME
1244
 
1551
 
1245
Delete the Workspace Branch
1552
Create a Workspace Branch
1246
 
1553
 
1247
=head2 SYNOPSIS
1554
=head2 SYNOPSIS
1248
 
1555
 
1249
jats svn delete-branch [options]
1556
jats svn branch branch-name [options]
1250
 
1557
 
1251
 Options:
1558
 Options:
1252
    -help[=n]              - Help message, [n=1,2,3]
1559
    -help[=n]              - Help message, [n=1,2,3]
1253
    -man                   - Full documentation [-help=3]
1560
    -man                   - Full documentation [-help=3]
1254
    -verbose[=n]           - Verbose command operation
1561
    -verbose[=n]           - Verbose command operation
1255
    -path=path             - Target workspace
1562
    -path=path             - Target workspace
-
 
1563
    -[no]switch            - Switch to new branch(default)
-
 
1564
    -comment=text          - Comment to apply to the new branch
1256
 
1565
 
1257
=head2 ARGUMENTS
1566
=head2 ARGUMENTS
1258
 
1567
 
1259
The command takes no arguments.
1568
The command takes one argument. The name of the branch to be created.
1260
 
1569
 
1261
=head2 OPTIONS
1570
=head2 OPTIONS
1262
 
1571
 
1263
=over
1572
=over
1264
 
1573
 
1265
=item B<-path=path>
1574
=item B<-path=path>
1266
 
1575
 
1267
This options specifies the path of the target workspace. If not provided the
1576
This options specifies the path of the target workspace. If not provided the
1268
command will use the current directory.
1577
command will use the current directory.
1269
 
1578
 
-
 
1579
=item B<-[no]switch>
-
 
1580
 
-
 
1581
If enabled (the default) the workspace will be switched to the new branch at
-
 
1582
the end of the process.
-
 
1583
 
-
 
1584
=item B<-comment=text>
-
 
1585
 
-
 
1586
If present, the specified text will be used as a Subversion comment when the
-
 
1587
branch is created.
-
 
1588
 
-
 
1589
If not provided, then JATS will provide a basic comment.
-
 
1590
 
1270
=back
1591
=back
1271
 
1592
 
1272
=head2 DESCRIPTION
1593
=head2 DESCRIPTION
1273
 
1594
 
1274
This command will delete the branch associated with the workspace in the
1595
This command will create a named branch associated with the workspace in the
1275
specified path. It is intended to simplify the deletion of Private or
1596
specified path. It is intended to simplify the creation of Private or
1276
Development branches.
1597
Development branches.
1277
 
1598
 
1278
If the workspace is not linked to a 'branch' then the command will fail.
1599
If the named branch already exists, then the command will fail.
1279
 
1600
 
-
 
1601
The command performs a server-side copy. It will not commit any locally
-
 
1602
modified files. Nor will it inform you if there are any.
-
 
1603
 
-
 
1604
By default, the user is 'switched' to the newly created branch.
-
 
1605
 
1280
=head1 Create a Package Version
1606
=head1 Switch Branch
1281
 
1607
 
1282
=head2 NAME
1608
=head2 NAME
1283
 
1609
 
1284
Create a Package Version
1610
Switch a Workspace Branch
1285
 
1611
 
1286
=head2 SYNOPSIS
1612
=head2 SYNOPSIS
1287
 
1613
 
1288
jats svn [options] create URL [command options]
1614
jats svn switch [branch-name] [options]
1289
 
1615
 
1290
 Options:
1616
 Options:
1291
    -help[=n]               - Help message, [n=1,2,3]
1617
    -help[=n]              - Help message, [n=1,2,3]
1292
    -man                    - Full documentation [-help=3]
1618
    -man                   - Full documentation [-help=3]
1293
    -verbose[=n]            - Verbose command operation
1619
    -verbose[=n]           - Verbose command operation
1294
 
-
 
1295
 Command Options
-
 
1296
    -help[=n]               - Provide command specific help
-
 
1297
    -new                    - Package must not exist
-
 
1298
    -replace                - Replace any existing versions
-
 
1299
    -import=nnn             - Import directory tree
-
 
1300
    -label=nnn              - Label imported package
-
 
1301
    -trunk                  - Import to trunk (default)
-
 
1302
    -tags=nnn               - Import to tags
1620
    -path=path             - Target workspace
1303
    -branch=nnn             - Import to branches
-
 
1304
 
1621
 
1305
=head2 ARGUMENTS
1622
=head2 ARGUMENTS
1306
 
1623
 
1307
The command takes one argument: The URL of the desired package.
1624
The command takes one optional argument. The name of the target branch.
-
 
1625
 
1308
This may be be:
1626
=head2 OPTIONS
1309
 
1627
 
1310
=over
1628
=over
1311
 
1629
 
1312
=item * A full URL
1630
=item B<-path=path>
1313
 
1631
 
-
 
1632
This options specifies the path of the target workspace. If not provided the
1314
Complete with protocol and path information.
1633
command will use the current directory.
1315
 
1634
 
1316
=item * A simple URL
1635
=back
1317
 
1636
 
1318
JATS will prepend the site-specific repository location to the user provided URL
1637
=head2 DESCRIPTION
1319
 
1638
 
1320
=back
-
 
-
 
1639
This command will switch the users workspace to the named branch. This is
-
 
1640
identical to the Subversion switch command, except it is easier to user and
-
 
1641
has several validity checks and other enhancements.
1321
 
1642
 
1322
=head2 OPTIONS
1643
The command has two modes of operation:
1323
 
1644
 
1324
=over
1645
=over 4
1325
 
1646
 
1326
=item -help[=n]
1647
=item   1. Display a list of branched in the current package.
1327
 
1648
 
1328
Print a help message and exit. The level of help may be either 1, 2 or 3.
1649
If no branch is specified, then the utility will display a list of branches in
-
 
1650
the packages 'branches' directory.
1329
 
1651
 
1330
This option may be specified multiple times to increment the help level, or
-
 
1331
the help level may be directly specified as a number.
1652
=item   2. Switch to the named branch.
1332
 
1653
 
1333
=item -new
1654
The named branch must exists otherwise the command will fail.
1334
 
1655
 
1335
This option specifies that the named package MUST not exist at all.
1656
There are two spcial variants of the branch name:
1336
 
1657
 
1337
=item -replace
1658
=over 4
1338
 
1659
 
1339
This option allows the program to replace any existing versions of the
-
 
1340
imported source. It will allow the deletion of any existing trunk, tags or
-
 
1341
branches.
1660
=item trunk
1342
 
1661
 
1343
=item -import=nnn
1662
If the branch is named 'trunk' then it will refer to the packages truck
1344
 
1663
 
1345
This option specifies the path of a subdirectory tree to import into the newly
1664
=item tags
1346
created package. In not provided, then only a package skeleton will be created.
-
 
1347
 
1665
 
-
 
1666
If the branch name starts with 'tags/', then the command will refer to
1348
=item -label=nnn
1667
a tag within the package and not a branch.
1349
 
1668
 
1350
This option specifies a label to place the imported source.
-
 
-
 
1669
=back
1351
 
1670
 
-
 
1671
The command will add and remove unmodified files from the workspace during this
1352
=item -trunk
1672
operation.
1353
 
1673
 
1354
This option specifies that imported source will be placed on the trunk of the
-
 
1355
package. This is the default mode of import.
1674
=back
1356
 
1675
 
1357
The options -trunk, -tags and -branch are mutually exclusive.
1676
=head3 Examples
1358
 
1677
 
1359
=item -tags=nnn
1678
To switch to the packages trunk
1360
 
1679
 
1361
This option specifies that imported source will be placed directly on the
-
 
1362
named tag of the package.
1680
    jats svn switch trunk
1363
 
1681
 
1364
The options -trunk, -tags and -branch are mutually exclusive.
1682
To switch to the a branch called MyBranch
1365
 
1683
 
1366
=item -branch=nnn
1684
    jats svn switch MyBranch
1367
 
1685
 
1368
This option specifies that imported source will be placed directly on the
-
 
1369
named branch of the package.
1686
To switch to a tagged version of the package
1370
 
1687
 
1371
The options -trunk, -tags and -branch are mutually exclusive.
1688
    jats svn switch tags/MyPackage_1.0.0000.cr
1372
 
1689
 
1373
=back
1690
To display a list of available branches (not tags)
1374
 
1691
 
1375
=head2 DESCRIPTION
1692
    jats svn switch
1376
 
1693
 
1377
This command will create a new package within a repository. It will ensure
-
 
1378
that the package contains the three required subdirectories: trunk, tags and
-
 
1379
branches.
1694
=head1 Delete Branch
1380
 
1695
 
1381
The command will also ensure that packages are not placed at inappropriate
-
 
1382
locations within the repository. It is not correct to place a package within
-
 
1383
another package.
1696
=head2 NAME
1384
 
1697
 
1385
The command will, optionally, import a directory tree into the repository and,
-
 
1386
optionally, label the package.
1698
Delete the Workspace Branch
1387
 
1699
 
1388
The package body may be imported to the 'trunk' or to a branch or a tag.
1700
=head2 SYNOPSIS
1389
By default the data will be imported to the trunk and may be labeled (tagged).
-
 
1390
 
1701
 
1391
Options allow the targets to be deleted if they exist or to ensure that they
-
 
1392
are not present.
1702
jats svn delete-branch [options]
1393
 
1703
 
-
 
1704
 Options:
-
 
1705
    -help[=n]              - Help message, [n=1,2,3]
-
 
1706
    -man                   - Full documentation [-help=3]
-
 
1707
    -verbose[=n]           - Verbose command operation
-
 
1708
    -path=path             - Target workspace
-
 
1709
 
-
 
1710
=head2 ARGUMENTS
-
 
1711
 
-
 
1712
The command takes no arguments.
-
 
1713
 
-
 
1714
=head2 OPTIONS
-
 
1715
 
-
 
1716
=over
-
 
1717
 
-
 
1718
=item B<-path=path>
-
 
1719
 
-
 
1720
This options specifies the path of the target workspace. If not provided the
-
 
1721
command will use the current directory.
-
 
1722
 
-
 
1723
=back
-
 
1724
 
-
 
1725
=head2 DESCRIPTION
-
 
1726
 
1394
The command does not attempt to merge file versions within the repository. It
1727
This command will delete the branch associated with the workspace in the
1395
may result in multiple instances of a file within the repository. Use only for
1728
specified path. It is intended to simplify the deletion of Private or
-
 
1729
Development branches.
-
 
1730
 
1396
simple imports. Use the 'import' command for more sophisticated import requirements.
1731
If the workspace is not linked to a 'branch' then the command will fail.
1397
 
1732
 
1398
=head1 Import directory to a Package
1733
=head1 Import directory to a Package
1399
 
1734
 
1400
=head2 NAME
1735
=head2 NAME
1401
 
1736
 
Line 1424... Line 1759...
1424
    -author=name            - Force author of changes
1759
    -author=name            - Force author of changes
1425
    -date=dateString        - Force date of changes
1760
    -date=dateString        - Force date of changes
1426
    -log=text               - Append text to the commit message
1761
    -log=text               - Append text to the commit message
1427
    -datafile=path          - Export tag data for automation
1762
    -datafile=path          - Export tag data for automation
1428
 
1763
 
1429
 
-
 
1430
=head2 ARGUMENTS
1764
=head2 ARGUMENTS
1431
 
1765
 
1432
The command takes one argument: The URL of the desired package.
1766
The command takes one argument: The URL of the desired package.
1433
This may be be:
1767
This may be be:
1434
 
1768
 
Line 1460... Line 1794...
1460
This option will increase the level of verbosity of the utility.
1794
This option will increase the level of verbosity of the utility.
1461
 
1795
 
1462
If an argument is provided, then it will be used to set the level, otherwise the
1796
If an argument is provided, then it will be used to set the level, otherwise the
1463
existing level will be incremented. This option may be specified multiple times.
1797
existing level will be incremented. This option may be specified multiple times.
1464
 
1798
 
1465
 
-
 
1466
=item -package=name
1799
=item -package=name
1467
 
1800
 
1468
Either this option or a bare URL on the command line must be provided. It
1801
Either this option or a bare URL on the command line must be provided. It
1469
specifies the repository and package to be used as a basis for the work.
1802
specifies the repository and package to be used as a basis for the work.
1470
 
1803