Subversion Repositories DevTools

Rev

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

Rev 383 Rev 385
Line 43... Line 43...
43
my $opt_comment;
43
my $opt_comment;
44
my $opt_workspace;
44
my $opt_workspace;
45
my $opt_packagebase;
45
my $opt_packagebase;
46
my $opt_branch;
46
my $opt_branch;
47
my $opt_list;
47
my $opt_list;
-
 
48
my $opt_author;
-
 
49
my $opt_date;
-
 
50
my $opt_complexTag;
48
 
51
 
49
#
52
#
50
#   Globals
53
#   Globals
51
#
54
#
52
my $session;                                # Subversion Session
55
my $session;                                # Subversion Session
Line 61... Line 64...
61
# Description     :
64
# Description     :
62
#
65
#
63
# Inputs          :
66
# Inputs          :
64
#
67
#
65
my $result = GetOptions (
68
my $result = GetOptions (
66
                "help:+"        => \$opt_help,              # flag, multiple use allowed
69
                'help:+'        => \$opt_help,              # flag, multiple use allowed
67
                "manual:3"      => \$opt_help,              # flag
70
                'manual:3'      => \$opt_help,              # flag
68
                "verbose:+"     => \$opt_verbose,           # flag, multiple use allowed
71
                'verbose:+'     => \$opt_verbose,           # flag, multiple use allowed
69
                "check"         => \$opt_check,             # Flag
72
                'check'         => \$opt_check,             # Flag
70
                "available"     => \$opt_avail,             # Flag
73
                'available'     => \$opt_avail,             # Flag
71
                "label"         => \$opt_label,             # Flag
74
                'label'         => \$opt_label,             # Flag
72
                "auto"          => \$opt_label,             # Same as -label
75
                'auto'          => \$opt_label,             # Same as -label
73
                "delete"        => \$opt_delete,            # Flag
76
                'delete'        => \$opt_delete,            # Flag
74
                "replace!"      => \$opt_replace,           # Flag
77
                'replace!'      => \$opt_replace,           # Flag
75
                "rename=s"      => \$opt_rename,            # String
78
                'rename=s'      => \$opt_rename,            # String
76
                "clone=s"       => \$opt_clone,             # String
79
                'clone=s'       => \$opt_clone,             # String
77
                "comment=s"     => \$opt_comment,           # String
80
                'comment=s'     => \$opt_comment,           # String
78
                "workspace=s"   => \$opt_workspace,         # String
81
                'workspace=s'   => \$opt_workspace,         # String
79
                "packagebase=s" => \$opt_packagebase,       # String
82
                'packagebase=s' => \$opt_packagebase,       # String
80
                "branch"        => \$opt_branch,            # Flag
83
                'branch'        => \$opt_branch,            # Flag
81
                "list"          => \$opt_list,              # Flag
84
                'list'          => \$opt_list,              # Flag
82
 
-
 
-
 
85
                'author=s'      => \$opt_author,            # String
-
 
86
                'date=s'        => \$opt_date,              # String
-
 
87
                'allowlocal!'   => \$opt_complexTag,        # [no]aaaaaa
83
                );
88
                );
84
 
89
 
85
                #
90
                #
86
                #   UPDATE THE DOCUMENTATION AT THE END OF THIS FILE !!!
91
                #   UPDATE THE DOCUMENTATION AT THE END OF THIS FILE !!!
87
                #
92
                #
Line 185... Line 190...
185
                'comment' => $opt_comment ? $opt_comment : 'Renamed by Jats Svnlabel',
190
                'comment' => $opt_comment ? $opt_comment : 'Renamed by Jats Svnlabel',
186
                'replace' => $opt_replace ? 1 : 0,
191
                'replace' => $opt_replace ? 1 : 0,
187
                );
192
                );
188
    
193
    
189
    Message ("Repository Ref: " . $session->RmRef);
194
    Message ("Repository Ref: " . $session->RmRef);
-
 
195
    updateProperties();
190
    $opr_done = 1;
196
    $opr_done = 1;
191
}
197
}
192
 
198
 
193
################################################################################
199
################################################################################
194
#   
200
#   
Line 214... Line 220...
214
           "WorkSpace: $session->{WSURL}" )
220
           "WorkSpace: $session->{WSURL}" )
215
        if ( !$opt_branch && (($session->WsType) eq 'tags') );
221
        if ( !$opt_branch && (($session->WsType) eq 'tags') );
216
 
222
 
217
    $session->SvnCopyWs (
223
    $session->SvnCopyWs (
218
                   target => $ws_label,
224
                   target => $ws_label,
-
 
225
                   'allowLocalMods' => $opt_complexTag,
219
                   'noswitch' => 1,
226
                   'noswitch' => 1,
220
                   'replace' => $opt_replace ? 1 : 0,
227
                   'replace' => $opt_replace ? 1 : 0,
221
                   'comment' => $opt_comment ? $opt_comment : 'Created by Jats Svnlabel',
228
                   'comment' => $opt_comment ? $opt_comment : 'Created by Jats Svnlabel',
222
                   );
229
                   );
223
 
230
 
224
    Message ("Repository Ref: " . $session->RmRef);
231
    Message ("Repository Ref: " . $session->RmRef);
-
 
232
    updateProperties();
225
    $opr_done = 1;
233
    $opr_done = 1;
226
}
234
}
227
 
235
 
228
################################################################################
236
################################################################################
229
#
237
#
Line 262... Line 270...
262
                'comment' => $opt_comment ? $opt_comment : 'Copied by Jats Svnlabel',
270
                'comment' => $opt_comment ? $opt_comment : 'Copied by Jats Svnlabel',
263
                'replace' => $opt_replace ? 1 : 0,
271
                'replace' => $opt_replace ? 1 : 0,
264
                );
272
                );
265
    
273
    
266
    Message ("Repository Ref: " . $session->RmRef);
274
    Message ("Repository Ref: " . $session->RmRef);
-
 
275
    updateProperties();
267
    $opr_done = 1;
276
    $opr_done = 1;
268
}
277
}
269
 
278
 
270
 
279
 
271
Error ("No valid operations specified. Try -h") unless ( $opr_done );
280
Error ("No valid operations specified. Try -h") unless ( $opr_done );
Line 400... Line 409...
400
    Verbose ("Package root  : $pkg_root");
409
    Verbose ("Package root  : $pkg_root");
401
#DebugDumpData ("Session", $session );
410
#DebugDumpData ("Session", $session );
402
}
411
}
403
 
412
 
404
#-------------------------------------------------------------------------------
413
#-------------------------------------------------------------------------------
-
 
414
# Function        : updateProperties
-
 
415
#
-
 
416
# Description     : Update the properties, if present
-
 
417
#
-
 
418
# Inputs          : Globals
-
 
419
#
-
 
420
# Returns         : Nothing
-
 
421
#
-
 
422
sub updateProperties
-
 
423
{
-
 
424
    $session->setRepoProperty('svn:author', $opt_author) if (defined ($opt_author));
-
 
425
    $session->setRepoProperty('svn:date', $opt_date) if (defined ($opt_date));
-
 
426
}
-
 
427
 
-
 
428
#-------------------------------------------------------------------------------
405
#   Documentation
429
#   Documentation
406
#
430
#
407
 
431
 
408
=pod
432
=pod
409
 
433
 
Line 419... Line 443...
419
 
443
 
420
 Options:
444
 Options:
421
    -help                  - brief help message
445
    -help                  - brief help message
422
    -help -help            - Detailed help message
446
    -help -help            - Detailed help message
423
    -man                   - Full documentation
447
    -man                   - Full documentation
424
    -available             - Check for label availablility
448
    -available             - Check for label availability
425
    -check                 - Check for label existence
449
    -check                 - Check for label existence
426
    -clone=xxx             - Clone a package version
450
    -clone=xxx             - Clone a package version
427
    -delete                - Delete label from the repository
451
    -delete                - Delete label from the repository
428
    -label                 - Labels a Package
452
    -label                 - Labels a Package
429
    -auto                  - Same as -label
453
    -auto                  - Same as -label
430
    -list                  - List lables in a package
454
    -list                  - List labels in a package
431
    -rename=xxx            - Rename a label
455
    -rename=xxx            - Rename a label
432
                           
-
 
-
 
456
 
433
 Modifiers
457
 Modifiers
434
    -branch                - Use branches, not tags
458
    -branch                - Use branches, not tags
435
    -replace               - Replace existing labels. Use with -label
459
    -replace               - Replace existing labels. Use with -label
436
    -comment=text          - Comment to add to repository operations
460
    -comment=text          - Comment to add to repository operations
437
    -workspace=path        - Path to a workspace to label
461
    -workspace=path        - Path to a workspace to label
438
    -packagebase=path      - Repostory path to package base
462
    -packagebase=path      - Repository path to package base
-
 
463
    -author=name           - Force author of changes
-
 
464
    -date=dateString       - Force date of changes
-
 
465
    -allowLocalMods        - Allow complex tagging
439
 
466
 
440
=head1 OPTIONS
467
=head1 OPTIONS
441
 
468
 
442
=over 8
469
=over 8
443
 
470
 
Line 453... Line 480...
453
 
480
 
454
Prints the manual page and exits.
481
Prints the manual page and exits.
455
 
482
 
456
=item B<-clone=xxx>
483
=item B<-clone=xxx>
457
 
484
 
458
This option will copy a labled version of a package to a new label.
485
This option will copy a labeled version of a package to a new label.
459
 
486
 
460
=item B<-delete>
487
=item B<-delete>
461
 
488
 
462
This option will delete the specified label from the repository
489
This option will delete the specified label from the repository
463
 
490
 
464
=item B<-available>
491
=item B<-available>
465
 
492
 
466
This option will check for the lables non-existence. An error will be reported
493
This option will check for the labels non-existence. An error will be reported
467
if the label exists.
494
if the label exists.
468
 
495
 
469
=item B<-check>
496
=item B<-check>
470
 
497
 
471
This option will check for the lables existence. An error will be reported
498
This option will check for the labels existence. An error will be reported
472
if the label does not exist.
499
if the label does not exist.
473
 
500
 
474
=item B<-label>
501
=item B<-label>
475
 
502
 
476
This option will label a workspace.
503
This option will label a workspace.
Line 488... Line 515...
488
argument after the option. If any further operation are to be performed the
515
argument after the option. If any further operation are to be performed the
489
new label name will be used.
516
new label name will be used.
490
 
517
 
491
=item B<-list>
518
=item B<-list>
492
 
519
 
493
This option will case all lables for the related package to be shown. The
520
This option will case all labels for the related package to be shown. The
494
command assumes that the repository is in a trunk/tags/branches format.
521
command assumes that the repository is in a trunk/tags/branches format.
495
 
522
 
496
By default tags are shown. Branches may be shown with the -branches option.
523
By default tags are shown. Branches may be shown with the -branches option.
497
 
524
 
498
=item B<-replace>
525
=item B<-replace>
Line 526... Line 553...
526
 
553
 
527
This option modifies all commands. It causes the labeling operations to be
554
This option modifies all commands. It causes the labeling operations to be
528
performed on a the packages 'branches' area instead of the default 'tags'
555
performed on a the packages 'branches' area instead of the default 'tags'
529
area.
556
area.
530
 
557
 
-
 
558
=item -author=name
-
 
559
 
-
 
560
This option will force the author of changes as recorded in the repository.
-
 
561
The repository must be configured to allow such changes.
-
 
562
 
-
 
563
This option may not work for non-admin users.
-
 
564
 
-
 
565
=item -date=dateString
-
 
566
 
-
 
567
This option will force the date of the changes as recorded in the repository.
-
 
568
The repository must be configured to allow such changes.
-
 
569
The dateString is in a restricted ISO 8601 format: ie 2009-02-12T00:44:04.921324Z
-
 
570
 
-
 
571
This option may not work for non-admin users.
-
 
572
 
-
 
573
=item -allowLocalMods
-
 
574
 
-
 
575
This option modifies the checking that is done when the workspace is labeled.
-
 
576
The default is to 'not' allow local modifications. All modifications must be
-
 
577
committed before the label is created.
-
 
578
 
-
 
579
If local modifications are allowed, then the utility will warn about local
-
 
580
modifications, but the labelling process will continue. This allows
-
 
581
for 'complex' tagging. The modified files will be transferred to the repository
-
 
582
and will form a part of the tag.
-
 
583
 
-
 
584
This mode of operation should NOT be used for normal labeling. It is useful for
-
 
585
the preservation of 'Mixed Workspaces'.
-
 
586
 
531
=back
587
=back
532
 
588
 
533
=head1 DESCRIPTION
589
=head1 DESCRIPTION
534
 
590
 
535
This program provides a number of useful Subversion labeling operations. These
591
This program provides a number of useful Subversion labeling operations. These
Line 537... Line 593...
537
 
593
 
538
=over 8
594
=over 8
539
 
595
 
540
=item   *
596
=item   *
541
 
597
 
542
check - check existance of a label
598
check - check existence of a label
543
 
599
 
544
=item   *
600
=item   *
545
 
601
 
546
available - check non-existance of a label
602
available - check non-existence of a label
547
 
603
 
548
=item   *
604
=item   *
549
 
605
 
550
list - list the labels on a package
606
list - list the labels on a package
551
 
607
 
Line 577... Line 633...
577
 
633
 
578
=over
634
=over
579
 
635
 
580
=item   * Package Path
636
=item   * Package Path
581
 
637
 
582
Any text preceeding a / will be taken to be a package path. This identifies the
638
Any text proceeding a / will be taken to be a package path. This identifies the
583
root of the package within the repository.
639
root of the package within the repository.
584
 
640
 
585
=item   * Label Type
641
=item   * Label Type
586
 
642
 
587
This will be one of 'trunk', 'branches' or 'tags'.
643
This will be one of 'trunk', 'branches' or 'tags'.