Subversion Repositories DevTools

Rev

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

Rev 1329 Rev 1403
Line 203... Line 203...
203
        $uref = NewSessionByWS($opt_path, 0, 1);
203
        $uref = NewSessionByWS($opt_path, 0, 1);
204
        my $ws_root = $uref->SvnLocateWsRoot(1);
204
        my $ws_root = $uref->SvnLocateWsRoot(1);
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  );
-
 
210
    
209
    $opr_done = 1;
211
    $opr_done = 1;
210
}
212
}
211
#-------------------------------------------------------------------------------
213
#-------------------------------------------------------------------------------
212
# Function        : ShowUrl
214
# Function        : ShowUrl
213
#
215
#
Line 424... Line 426...
424
                "verbose:+"     => \$opt_verbose,
426
                "verbose:+"     => \$opt_verbose,
425
                "import=s"      => \$opt_import,
427
                "import=s"      => \$opt_import,
426
                "new"           => \$opt_new,
428
                "new"           => \$opt_new,
427
                "branch=s"      => \$opt_branch,
429
                "branch=s"      => \$opt_branch,
428
                "trunk"         => \$opt_trunk,
430
                "trunk"         => \$opt_trunk,
429
                "tag=s"         => \$opt_tag,
431
                "tags=s"        => \$opt_tag,
430
                "label=s"       => \$opt_label,
432
                "label=s"       => \$opt_label,
431
                "replace"       => \$opt_replace,
433
                "replace"       => \$opt_replace,
432
                'author=s'      => \$opt_author,
434
                'author=s'      => \$opt_author,
433
                'date=s'        => \$opt_date,
435
                'date=s'        => \$opt_date,
434
 
436
 
Line 455... Line 457...
455
    Error ("Nothing imported to be labeled") if ( $count && !$opt_import );
457
    Error ("Nothing imported to be labeled") if ( $count && !$opt_import );
456
    Error ("Import path does not exist: $opt_import") if ( $opt_import && ! -d $opt_import );
458
    Error ("Import path does not exist: $opt_import") if ( $opt_import && ! -d $opt_import );
457
    Error ("Conflicting options: new and replace") if ( $opt_new && $opt_replace );
459
    Error ("Conflicting options: new and replace") if ( $opt_new && $opt_replace );
458
    Error ("Too many command line arguments") if ( exists $ARGV[1] );
460
    Error ("Too many command line arguments") if ( exists $ARGV[1] );
459
 
461
 
460
    ($type, $opt_label) = ('tags', $opt_tag)            if ( $opt_tag);
462
    $type = 'tags/' . $opt_tag          if ( $opt_tag);
461
    ($type, $opt_label) = ('branches', $opt_branch)     if ( $opt_branch );
463
    $type = 'branches/' . $opt_branch   if ( $opt_branch );
462
    ($type, $opt_label) = ('trunk', $opt_label)         if ( $opt_trunk);
464
    $type = 'trunk'                     if ( $opt_trunk);
463
 
465
 
464
    #
466
    #
465
    #   Do all the hard work
467
    #   Do all the hard work
466
    #       Create
468
    #       Create
467
    #       Import
469
    #       Import
Line 476... Line 478...
476
                      'replace' => $opt_replace,
478
                      'replace' => $opt_replace,
477
                      );
479
                      );
478
    #
480
    #
479
    # Report RmPath as using a pegged version of a new package is a bit silly
481
    # Report RmPath as using a pegged version of a new package is a bit silly
480
    #
482
    #
481
    Message ("Repository Ref: " . $uref->RmPath);
483
#    Message ("Repository Ref: " . $uref->RmPath);
-
 
484
#    Message ("Vcs Tag       : " . $uref->SvnTag);
482
    if ( $uref->{REVNO} )
485
    if ( $uref->{REVNO} )
483
    {
486
    {
484
        $uref->setRepoProperty('svn:author', $opt_author) if (defined ($opt_author));
487
        $uref->setRepoProperty('svn:author', $opt_author) if (defined ($opt_author));
485
        $uref->setRepoProperty('svn:date', $opt_date) if (defined ($opt_date));
488
        $uref->setRepoProperty('svn:date', $opt_date) if (defined ($opt_date));
486
    }
489
    }
Line 518... Line 521...
518
    my $opt_author;
521
    my $opt_author;
519
    my $opt_date;
522
    my $opt_date;
520
    my $opt_log = '';
523
    my $opt_log = '';
521
    my $opt_branch;
524
    my $opt_branch;
522
    my $opt_datafile;
525
    my $opt_datafile;
-
 
526
    my $opt_printfiles;
523
 
527
 
524
    #
528
    #
525
    #   Other globals
529
    #   Other globals
526
    #
530
    #
527
    my $url_label;
531
    my $url_label;
Line 540... Line 544...
540
                    'branch=s'      => \$opt_branch,
544
                    'branch=s'      => \$opt_branch,
541
                    'replace'       => \$opt_replace,
545
                    'replace'       => \$opt_replace,
542
                    'reuse'         => \$opt_reuse,
546
                    'reuse'         => \$opt_reuse,
543
                    'workspace=s'   => \$opt_workdir,
547
                    'workspace=s'   => \$opt_workdir,
544
                    'delete!'       => \$opt_delete,
548
                    'delete!'       => \$opt_delete,
-
 
549
                    'printfiles=i'  => \$opt_printfiles,
545
                    'author=s'      => \$opt_author,
550
                    'author=s'      => \$opt_author,
546
                    'date=s'        => \$opt_date,
551
                    'date=s'        => \$opt_date,
547
                    'log=s'         => \$opt_log,
552
                    'log=s'         => \$opt_log,
548
                    'datafile=s'    => \$opt_datafile,
553
                    'datafile=s'    => \$opt_datafile,
549
 
554
 
Line 632... Line 637...
632
                            'target' => $svn->Full,
637
                            'target' => $svn->Full,
633
                            'require' => 1,
638
                            'require' => 1,
634
                            );
639
                            );
635
 
640
 
636
        my $url_co = $opt_branch ? $url_branch : $svn->Full . '/trunk';
641
        my $url_co = $opt_branch ? $url_branch : $svn->Full . '/trunk';
637
        $svn->SvnCo ( $url_co, $opt_workdir, $opt_verbose ? '--Print' : '--NoPrint' );
642
        $svn->SvnCo ( $url_co, $opt_workdir, 'print' => $opt_printfiles );
638
        Error ("Cannot locate the created Workspace")
643
        Error ("Cannot locate the created Workspace")
639
            unless ( -d $opt_workdir );
644
            unless ( -d $opt_workdir );
640
    }
645
    }
641
    else
646
    else
642
    {
647
    {
Line 859... Line 864...
859
                       'noswitch' => 1,
864
                       'noswitch' => 1,
860
                       'replace' => $opt_replace,
865
                       'replace' => $opt_replace,
861
                       'comment' => "$pkgPath: Tagged by Jats Svn Import",
866
                       'comment' => "$pkgPath: Tagged by Jats Svn Import",
862
                       );
867
                       );
863
        Message ("Repository Ref: " . $svn->RmRef);
868
        Message ("Repository Ref: " . $svn->RmRef);
-
 
869
        Message ("Vcs Tag       : " . $svn->SvnTag);
864
        $svn->setRepoProperty('svn:author', $opt_author) if (defined ($opt_author));
870
        $svn->setRepoProperty('svn:author', $opt_author) if (defined ($opt_author));
865
        $svn->setRepoProperty('svn:date', $opt_date) if (defined ($opt_date));
871
        $svn->setRepoProperty('svn:date', $opt_date) if (defined ($opt_date));
866
    }
872
    }
867
 
873
 
868
    #
874
    #
Line 881... Line 887...
881
    {
887
    {
882
        my $data = JatsProperties::New();
888
        my $data = JatsProperties::New();
883
 
889
 
884
        $data->setProperty('Command'        , 'ImportPackage');
890
        $data->setProperty('Command'        , 'ImportPackage');
885
        $data->setProperty('Label'          , $opt_label);
891
        $data->setProperty('Label'          , $opt_label);
886
        $data->setProperty('subversion.tag' , $svn->RmRef);
892
        $data->setProperty('subversion.url' , $svn->RmRef);
-
 
893
        $data->setProperty('subversion.tag' , $svn->SvnTag);
887
 
894
 
888
        $data->Dump('InfoFile') if ($opt_verbose);
895
        $data->Dump('InfoFile') if ($opt_verbose);
889
        $data->store( $opt_datafile );
896
        $data->store( $opt_datafile );
890
    }
897
    }
891
 
898
 
Line 1285... Line 1292...
1285
    -man                    - Full documentation [-help=3]
1292
    -man                    - Full documentation [-help=3]
1286
    -verbose[=n]            - Verbose command operation
1293
    -verbose[=n]            - Verbose command operation
1287
 
1294
 
1288
 Command Options
1295
 Command Options
1289
    -help[=n]               - Provide command specific help
1296
    -help[=n]               - Provide command specific help
1290
    -import=nnn             - Import directory tree
-
 
1291
    -label=nnn              - Label it (trunk import only)
-
 
1292
    -new                    - Package must not exist
1297
    -new                    - Package must not exist
1293
    -replace                - Replace any existing versions
1298
    -replace                - Replace any existing versions
-
 
1299
    -import=nnn             - Import directory tree
-
 
1300
    -label=nnn              - Label imported package
1294
    -trunk                  - Import to trunk
1301
    -trunk                  - Import to trunk (default)
1295
    -tags=nnn               - Import to tags
1302
    -tags=nnn               - Import to tags
1296
    -branch=nnn             - Import to branches
1303
    -branch=nnn             - Import to branches
1297
 
1304
 
1298
=head2 ARGUMENTS
1305
=head2 ARGUMENTS
1299
 
1306
 
Line 1321... Line 1328...
1321
Print a help message and exit. The level of help may be either 1, 2 or 3.
1328
Print a help message and exit. The level of help may be either 1, 2 or 3.
1322
 
1329
 
1323
This option may be specified multiple times to increment the help level, or
1330
This option may be specified multiple times to increment the help level, or
1324
the help level may be directly specified as a number.
1331
the help level may be directly specified as a number.
1325
 
1332
 
1326
=item -import=nnn
-
 
1327
 
-
 
1328
This option specifies the path of a subdirectory tree to import into the newly
-
 
1329
created package. In not provided, then only a package skeleton will be created.
-
 
1330
 
-
 
1331
=item -label=nnn
-
 
1332
 
-
 
1333
This option specifies a label to place the imported source, if the source is
-
 
1334
being imported to the 'trunk' of the package.
-
 
1335
 
-
 
1336
=item -new
1333
=item -new
1337
 
1334
 
1338
This option specifies that the named package MUST not exist at all.
1335
This option specifies that the named package MUST not exist at all.
1339
 
1336
 
1340
=item -replace
1337
=item -replace
1341
 
1338
 
1342
This option allows the program to replace any existing versions of the
1339
This option allows the program to replace any existing versions of the
1343
imported source. It will allow the deletion of any existing trunk, tags or
1340
imported source. It will allow the deletion of any existing trunk, tags or
1344
branches.
1341
branches.
1345
 
1342
 
-
 
1343
=item -import=nnn
-
 
1344
 
-
 
1345
This option specifies the path of a subdirectory tree to import into the newly
-
 
1346
created package. In not provided, then only a package skeleton will be created.
-
 
1347
 
-
 
1348
=item -label=nnn
-
 
1349
 
-
 
1350
This option specifies a label to place the imported source.
-
 
1351
 
1346
=item -trunk
1352
=item -trunk
1347
 
1353
 
1348
This option specifies that imported source will be placed on the trunk of the
1354
This option specifies that imported source will be placed on the trunk of the
1349
package. This is the default mode of import.
1355
package. This is the default mode of import.
1350
 
1356