Subversion Repositories DevTools

Rev

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

Rev 2354 Rev 2424
Line 263... Line 263...
263
    #
263
    #
264
    my $uref;
264
    my $uref;
265
    my $url;
265
    my $url;
266
    if ( $opt_tag )
266
    if ( $opt_tag )
267
    {
267
    {
-
 
268
        my $path = $opt_tag;
-
 
269
        my $label;
-
 
270
 
-
 
271
        $path =~ s~^SVN::~~;
-
 
272
        if ( $path =~ m~(.+)::(.+)~ )
-
 
273
        {
-
 
274
            $path = $1;
-
 
275
            $label = $2;
-
 
276
        }
268
        $url = SvnPath2Url($opt_tag);
277
        $url = SvnPath2Url($path);
-
 
278
        if ( $label && $label =~ m~^\d+$~ )
-
 
279
        {
-
 
280
            $url .= '@' . $label;
-
 
281
        }
-
 
282
        elsif ( $label )
-
 
283
        {
-
 
284
            $url =~ m~(.+)(/(tags|branches|trunk)(/|$|@))~;
-
 
285
            $url = $1 . '/tags/'. $label;
-
 
286
        }
269
    }
287
    }
270
    else
288
    else
271
    {
289
    {
272
        $uref = NewSessionByWS($opt_path, 0, 1);
290
        $uref = NewSessionByWS($opt_path, 0, 1);
273
        my $ws_root = $uref->SvnLocateWsRoot(1);
291
        my $ws_root = $uref->SvnLocateWsRoot(1);
Line 518... Line 536...
518
    my $opt_date;
536
    my $opt_date;
519
    my $opt_log = '';
537
    my $opt_log = '';
520
    my $opt_branch;
538
    my $opt_branch;
521
    my $opt_datafile;
539
    my $opt_datafile;
522
    my $opt_printfiles;
540
    my $opt_printfiles;
-
 
541
    my $opt_commit = 1;
523
 
542
 
524
    #
543
    #
525
    #   Other globals
544
    #   Other globals
526
    #
545
    #
527
    my $url_label;
546
    my $url_label;
Line 545... Line 564...
545
                    'printfiles=i'  => \$opt_printfiles,
564
                    'printfiles=i'  => \$opt_printfiles,
546
                    'author=s'      => \$opt_author,
565
                    'author=s'      => \$opt_author,
547
                    'date=s'        => \$opt_date,
566
                    'date=s'        => \$opt_date,
548
                    'log=s'         => \$opt_log,
567
                    'log=s'         => \$opt_log,
549
                    'datafile=s'    => \$opt_datafile,
568
                    'datafile=s'    => \$opt_datafile,
-
 
569
                    'commit!'       => \$opt_commit,
550
 
570
 
551
                    #
571
                    #
552
                    #   Update documentation at the end of the file
572
                    #   Update documentation at the end of the file
553
                    #
573
                    #
554
                    ) || Error ("Invalid command line" );
574
                    ) || Error ("Invalid command line" );
Line 575... Line 595...
575
    #   Configure the error reporting process now that we have the user options
595
    #   Configure the error reporting process now that we have the user options
576
    #
596
    #
577
    Error ("No package URL specified") unless ( $opt_package );
597
    Error ("No package URL specified") unless ( $opt_package );
578
    Error ("No base directory specified") unless ( $opt_dir );
598
    Error ("No base directory specified") unless ( $opt_dir );
579
    Error ("Invalid base directory: $opt_dir") unless ( -d $opt_dir );
599
    Error ("Invalid base directory: $opt_dir") unless ( -d $opt_dir );
-
 
600
    Error ("Cannot label if not committing") if ( $opt_label && ! $opt_commit );
580
 
601
 
581
    #
602
    #
582
    #   Create an SVN session
603
    #   Create an SVN session
583
    #
604
    #
584
    my $svn = NewSessionByUrl ( $opt_package );
605
    my $svn = NewSessionByUrl ( $opt_package );
Line 832... Line 853...
832
 
853
 
833
    #
854
    #
834
    #   Commit the workspace
855
    #   Commit the workspace
835
    #   This will go back onto the trunk
856
    #   This will go back onto the trunk
836
    #
857
    #
837
    $svn = NewSessionByWS( $opt_workdir );
-
 
838
    my $pkgPath = $svn->Path();
-
 
839
 
-
 
840
    my $ciComment = "$pkgPath: Checkin by Svn Import";
-
 
841
    $ciComment .= "\n" . $opt_log if ( $opt_log );
-
 
842
    $ciComment =~ s~\r\n~\n~g;
-
 
843
    $ciComment =~ s~\r~\n~g;
-
 
844
    $ciComment = encode('UTF-8', $ciComment, Encode::FB_DEFAULT);
-
 
845
 
-
 
846
    $svn->SvnCi ('comment' => $ciComment, 'allowSame' => 1 );
-
 
847
    Message ("Repository Ref: " . $svn->RmRef) unless( $opt_label );
-
 
848
    $svn->setRepoProperty('svn:author', $opt_author) if (defined ($opt_author));
-
 
849
    $svn->setRepoProperty('svn:date', $opt_date) if (defined ($opt_date));
-
 
850
 
-
 
851
    #
-
 
852
    #   Label the result
-
 
853
    #   The workspace will have been updated, so we can use it as the base for
-
 
854
    #   the labeling process
-
 
855
    #
-
 
856
    if ( $opt_label )
858
    if ( $opt_commit )
857
    {
859
    {
858
        $svn->SvnCopyWs (
860
        $svn = NewSessionByWS( $opt_workdir );
859
                       target => $url_label,
861
        my $pkgPath = $svn->Path();
-
 
862
 
860
                       'noswitch' => 1,
863
        my $ciComment = "$pkgPath: Checkin by Svn Import";
861
                       'replace' => $opt_replace,
864
        $ciComment .= "\n" . $opt_log if ( $opt_log );
862
                       'comment' => "$pkgPath: Tagged by Jats Svn Import",
865
        $ciComment =~ s~\r\n~\n~g;
863
                       );
866
        $ciComment =~ s~\r~\n~g;
-
 
867
        $ciComment = encode('UTF-8', $ciComment, Encode::FB_DEFAULT);
-
 
868
 
864
        Message ("Repository Ref: " . $svn->RmRef);
869
        $svn->SvnCi ('comment' => $ciComment, 'allowSame' => 1 );
865
        Message ("Vcs Tag       : " . $svn->SvnTag);
870
        Message ("Repository Ref: " . $svn->RmRef) unless( $opt_label );
866
        $svn->setRepoProperty('svn:author', $opt_author) if (defined ($opt_author));
871
        $svn->setRepoProperty('svn:author', $opt_author) if (defined ($opt_author));
867
        $svn->setRepoProperty('svn:date', $opt_date) if (defined ($opt_date));
872
        $svn->setRepoProperty('svn:date', $opt_date) if (defined ($opt_date));
-
 
873
 
-
 
874
        #
-
 
875
        #   Label the result
-
 
876
        #   The workspace will have been updated, so we can use it as the base for
-
 
877
        #   the labeling process
-
 
878
        #
-
 
879
        if ( $opt_label )
-
 
880
        {
-
 
881
            $svn->SvnCopyWs (
-
 
882
                           target => $url_label,
-
 
883
                           'noswitch' => 1,
-
 
884
                           'replace' => $opt_replace,
-
 
885
                           'comment' => "$pkgPath: Tagged by Jats Svn Import",
-
 
886
                           );
-
 
887
            Message ("Repository Ref: " . $svn->RmRef);
-
 
888
            Message ("Vcs Tag       : " . $svn->SvnTag);
-
 
889
            $svn->setRepoProperty('svn:author', $opt_author) if (defined ($opt_author));
-
 
890
            $svn->setRepoProperty('svn:date', $opt_date) if (defined ($opt_date));
-
 
891
        }
-
 
892
    }
-
 
893
    else
-
 
894
    {
-
 
895
        Message ("Workspace not commited","Workspace: $opt_workdir");
868
    }
896
    }
869
 
897
 
870
    #
898
    #
871
    #   Clean up
899
    #   Clean up
872
    #
900
    #
873
    if ( $opt_delete && ! $opt_reuse )
901
    if ( $opt_delete && ! $opt_reuse  && $opt_commit )
874
    {
902
    {
875
        Message ("Delete Workspace");
903
        Message ("Delete Workspace");
876
        rmtree( $opt_workdir );
904
        rmtree( $opt_workdir );
877
    }
905
    }
878
 
906
 
Line 1395... Line 1423...
1395
 
1423
 
1396
This command will convert a TAG or a PATH to a full URL that can be used
1424
This command will convert a TAG or a PATH to a full URL that can be used
1397
directly by Subversion. If no PATH or TAG is provided, then the command uses a
1425
directly by Subversion. If no PATH or TAG is provided, then the command uses a
1398
path of the current directory.
1426
path of the current directory.
1399
 
1427
 
1400
The command will convert either a TAG or a URL. It will not do both.
1428
The command will convert either a TAG or a PATH. It will not do both.
1401
 
1429
 
1402
The command will use the configured Subversion URL prefixes to expand the TAG.
1430
The command will use the configured Subversion URL prefixes to expand the TAG.
1403
 
1431
 
1404
If a PATH is to be converted, then the PATH must address a Subversion workspace.
1432
If a PATH is to be converted, then the PATH must address a Subversion workspace.
1405
The conversion will return a URL to the root of the Workspace and Peg it to
1433
The conversion will return a URL to the root of the Workspace and Peg it to
Line 1408... Line 1436...
1408
 
1436
 
1409
If a TAG is to be converted, then the resultant value should be used with
1437
If a TAG is to be converted, then the resultant value should be used with
1410
caution. The result is only as good as the provided URL and may not address
1438
caution. The result is only as good as the provided URL and may not address
1411
the root of a package.
1439
the root of a package.
1412
 
1440
 
-
 
1441
=head3 Examples
-
 
1442
 
-
 
1443
To display the URL of the current workspace
-
 
1444
 
-
 
1445
    jats svn url
-
 
1446
 
-
 
1447
To display the URL of a known workspace
-
 
1448
 
-
 
1449
    jats svn url -path=myWorkSpace
-
 
1450
 
-
 
1451
To convert a TAG from Release Manager or other JATS commands
-
 
1452
 
-
 
1453
    jats svn url AUPERASVN01/COTS
-
 
1454
    jats svn url SVN::AUPERASVN01/COTS/bouncycastle/trunk::bouncycastle_1.3.1.cots@502
-
 
1455
 
1413
=head1 Create a Package Version
1456
=head1 Create a Package Version
1414
 
1457
 
1415
=head2 NAME
1458
=head2 NAME
1416
 
1459
 
1417
Create a Package Version
1460
Create a Package Version
Line 1816... Line 1859...
1816
    -[no]delete             - Deletes workspace after use. Default:yes
1859
    -[no]delete             - Deletes workspace after use. Default:yes
1817
    -author=name            - Force author of changes
1860
    -author=name            - Force author of changes
1818
    -date=dateString        - Force date of changes
1861
    -date=dateString        - Force date of changes
1819
    -log=text               - Append text to the commit message
1862
    -log=text               - Append text to the commit message
1820
    -datafile=path          - Export tag data for automation
1863
    -datafile=path          - Export tag data for automation
-
 
1864
    -[no]commit             - Prevent chnages being commited. Default:Yes
-
 
1865
    -printfiles=n           - Control commit verbosity
1821
 
1866
 
1822
=head2 ARGUMENTS
1867
=head2 ARGUMENTS
1823
 
1868
 
1824
The command takes one argument: The URL of the desired package.
1869
The command takes one argument: The URL of the desired package.
1825
This may be be:
1870
This may be be:
Line 1926... Line 1971...
1926
=item -datafile=path
1971
=item -datafile=path
1927
 
1972
 
1928
This option will cause the utility to create a data file to record the import
1973
This option will cause the utility to create a data file to record the import
1929
tag. It is used for automation of the import process.
1974
tag. It is used for automation of the import process.
1930
 
1975
 
-
 
1976
=item -[no]commit
-
 
1977
 
-
 
1978
This option will prevent the final workspace from being committed to the
-
 
1979
Repository. This allows inspection of the results.
-
 
1980
 
-
 
1981
The default operation is to commit and label the results of the import.
-
 
1982
 
-
 
1983
=item -printfiles=n
-
 
1984
 
-
 
1985
This option controls commit verbosity. The default operation is to display
-
 
1986
the files added and removed during the commit.
-
 
1987
 
-
 
1988
Suitable numbers are: None, 0 (No Display) and 1 (Full Display).
-
 
1989
 
1931
=back
1990
=back
1932
 
1991
 
1933
=head2 DESCRIPTION
1992
=head2 DESCRIPTION
1934
 
1993
 
1935
Import a new version of a package to the trunk of the package. The utility
1994
Import a new version of a package to the trunk of the package. The utility