Subversion Repositories DevTools

Rev

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

Rev 297 Rev 299
Line 286... Line 286...
286
    my $opt_dir;
286
    my $opt_dir;
287
    my $opt_label;
287
    my $opt_label;
288
    my $opt_replace = 0;
288
    my $opt_replace = 0;
289
    my $opt_reuse;
289
    my $opt_reuse;
290
    my $opt_workdir = "SvnImportDir";
290
    my $opt_workdir = "SvnImportDir";
-
 
291
    my $opt_delete = 1;
291
 
292
 
292
    #
293
    #
293
    #   Other globals
294
    #   Other globals
294
    #
295
    #
295
    my $url_label;
296
    my $url_label;
Line 304... Line 305...
304
                    "package=s"     => \$opt_package,
305
                    "package=s"     => \$opt_package,
305
                    "dir=s"         => \$opt_dir,
306
                    "dir=s"         => \$opt_dir,
306
                    "label=s"       => \$opt_label,
307
                    "label=s"       => \$opt_label,
307
                    "replace"       => \$opt_replace,
308
                    "replace"       => \$opt_replace,
308
                    "reuse"         => \$opt_reuse,
309
                    "reuse"         => \$opt_reuse,
309
                    "workspace"     => \$opt_workdir,
310
                    "workspace=s"   => \$opt_workdir,
-
 
311
                    "delete!"       => \$opt_delete,
310
 
312
 
311
                    #
313
                    #
312
                    #   Update documentation at the end of the file
314
                    #   Update documentation at the end of the file
313
                    #
315
                    #
314
                    ) || Error ("Invalid command line" );
316
                    ) || Error ("Invalid command line" );
Line 375... Line 377...
375
 
377
 
376
        $svn->SvnCo ( $svn->Full . '/trunk', $opt_workdir );
378
        $svn->SvnCo ( $svn->Full . '/trunk', $opt_workdir );
377
        Error ("Cannot locate the created Workspace")
379
        Error ("Cannot locate the created Workspace")
378
            unless ( -d $opt_workdir );
380
            unless ( -d $opt_workdir );
379
    }
381
    }
-
 
382
    else
-
 
383
    {
-
 
384
        Message ("Reusing Workspace");
-
 
385
    }
380
                    
386
                    
381
    #
387
    #
382
    #   Determine differences between the two folders
388
    #   Determine differences between the two folders
383
    #       Create structures for each directory
389
    #       Create structures for each directory
384
    #
390
    #
Line 386... Line 392...
386
 
392
 
387
    my $search = JatsLocateFiles->new("--Recurse=1",
393
    my $search = JatsLocateFiles->new("--Recurse=1",
388
                                       "--DirsToo",
394
                                       "--DirsToo",
389
                                       "--FilterOutRe=/\.svn/",
395
                                       "--FilterOutRe=/\.svn/",
390
                                       "--FilterOutRe=/\.svn\$",
396
                                       "--FilterOutRe=/\.svn\$",
-
 
397
                                       "--FilterOutRe=^/${opt_workdir}\$",
-
 
398
                                       "--FilterOutRe=^/${opt_workdir}/",
391
                                       );
399
                                       );
392
    my @ws = $search->search($opt_workdir);
400
    my @ws = $search->search($opt_workdir);
393
    my @dir = $search->search($opt_dir);
401
    my @dir = $search->search($opt_dir);
394
 
402
 
395
    #Information ("WS Results", @ws);
403
    #Information ("WS Results", @ws);
Line 556... Line 564...
556
                       'replace' => $opt_replace,
564
                       'replace' => $opt_replace,
557
                       'comment' => 'Created by Jats Svn Import',
565
                       'comment' => 'Created by Jats Svn Import',
558
                       );
566
                       );
559
        Message ("Repository Ref: " . $svn->RmRef);
567
        Message ("Repository Ref: " . $svn->RmRef);
560
    }
568
    }
-
 
569
 
-
 
570
    #
-
 
571
    #   Clean up
-
 
572
    #
-
 
573
    if ( $opt_delete && ! $opt_reuse )
-
 
574
    {
-
 
575
        Message ("Delete Workspace");
-
 
576
        rmtree( $opt_workdir );
-
 
577
    }
-
 
578
    
561
    $opr_done = 1;
579
    $opr_done = 1;
562
}
580
}
563
 
581
 
564
#-------------------------------------------------------------------------------
582
#-------------------------------------------------------------------------------
565
# Function        : SubCommandHelp
583
# Function        : SubCommandHelp
Line 707... Line 725...
707
    -man                   - Full documentation [-help=3]
725
    -man                   - Full documentation [-help=3]
708
    -verbose[=n]           - Verbose command operation
726
    -verbose[=n]           - Verbose command operation
709
 
727
 
710
=head2 ARGUMENTS
728
=head2 ARGUMENTS
711
 
729
 
712
The command takes one argument: The URL of the desirecd package.
730
The command takes one argument: The URL of the desired package.
713
This may be be:
731
This may be be:
714
 
732
 
715
=over
733
=over
716
 
734
 
717
=item * A full URL
735
=item * A full URL
Line 749... Line 767...
749
    -help[=n]               - Help message, [n=1,2,3]
767
    -help[=n]               - Help message, [n=1,2,3]
750
    -man                    - Full documentation [-help=3]
768
    -man                    - Full documentation [-help=3]
751
    -verbose[=n]            - Verbose command operation
769
    -verbose[=n]            - Verbose command operation
752
 
770
 
753
 Command Options
771
 Command Options
754
    -help[=n]               - Provide comand specific help
772
    -help[=n]               - Provide command specific help
755
    -import=nnn             - Import directory tree
773
    -import=nnn             - Import directory tree
756
    -label=nnn              - Label it (trunk import only)
774
    -label=nnn              - Label it (trunk import only)
757
    -new                    - Package must not exist
775
    -new                    - Package must not exist
758
    -replace                - Replace any existing versions
776
    -replace                - Replace any existing versions
759
    -trunk                  - Import to trunk
777
    -trunk                  - Import to trunk
760
    -tags=nnn               - Import to tags
778
    -tags=nnn               - Import to tags
761
    -branch=nnn             - Import to branches
779
    -branch=nnn             - Import to branches
762
 
780
 
763
=head2 ARGUMENTS
781
=head2 ARGUMENTS
764
 
782
 
765
The command takes one argument: The URL of the desirecd package.
783
The command takes one argument: The URL of the desired package.
766
This may be be:
784
This may be be:
767
 
785
 
768
=over
786
=over
769
 
787
 
770
=item * A full URL
788
=item * A full URL
Line 793... Line 811...
793
This option specifies the path of a subdirectory tree to import into the newly
811
This option specifies the path of a subdirectory tree to import into the newly
794
created package. In not provided, then only a package skeleton will be created.
812
created package. In not provided, then only a package skeleton will be created.
795
 
813
 
796
=item -label=nnn
814
=item -label=nnn
797
 
815
 
798
This option specifes a label to place the imported source, if the source is
816
This option specifies a label to place the imported source, if the source is
799
being imported to the 'trunk' of the package.
817
being imported to the 'trunk' of the package.
800
 
818
 
801
=item -new
819
=item -new
802
 
820
 
803
This option specifies that the named package MUST not exist at all.
821
This option specifies that the named package MUST not exist at all.
804
 
822
 
805
=item -replace
823
=item -replace
806
 
824
 
807
This option allows the program to replace any existing versions of the
825
This option allows the program to replace any existing versions of the
808
imported source. It will allow the deletion of any existing trunk, trags or
826
imported source. It will allow the deletion of any existing trunk, tags or
809
branches.
827
branches.
810
 
828
 
811
=item -trunk
829
=item -trunk
812
 
830
 
813
This option specifies that imported source will be placed on the trunk of the
831
This option specifies that imported source will be placed on the trunk of the
814
package. This is the default mode of import.
832
package. This is the default mode of import.
815
 
833
 
816
The options -trunk, -tags and -branch are mutally exclusive.
834
The options -trunk, -tags and -branch are mutually exclusive.
817
 
835
 
818
=item -tags=nnn
836
=item -tags=nnn
819
 
837
 
820
This option specifies that imported source will be placed directly on the
838
This option specifies that imported source will be placed directly on the
821
named tag of ther package.
839
named tag of the package.
822
 
840
 
823
The options -trunk, -tags and -branch are mutally exclusive.
841
The options -trunk, -tags and -branch are mutually exclusive.
824
 
842
 
825
=item -branch=nnn
843
=item -branch=nnn
826
 
844
 
827
This option specifies that imported source will be placed directly on the
845
This option specifies that imported source will be placed directly on the
828
named branch of ther package.
846
named branch of the package.
829
 
847
 
830
The options -trunk, -tags and -branch are mutally exclusive.
848
The options -trunk, -tags and -branch are mutually exclusive.
831
 
849
 
832
=back
850
=back
833
 
851
 
834
=head2 DESCRIPTION
852
=head2 DESCRIPTION
835
 
853
 
Line 843... Line 861...
843
 
861
 
844
The command will, optionally, import a directory tree into the repository and,
862
The command will, optionally, import a directory tree into the repository and,
845
optionally, label the package.
863
optionally, label the package.
846
 
864
 
847
The package body may be imported to the 'trunk' or to a branch or a tag.
865
The package body may be imported to the 'trunk' or to a branch or a tag.
848
By default the data will be imported to the trunk and may be labled (tagged).
866
By default the data will be imported to the trunk and may be labeled (tagged).
849
 
867
 
850
Options allow the targets to be deleletd if they exist or to ensure that they
868
Options allow the targets to be deleted if they exist or to ensure that they
851
are not present.
869
are not present.
852
 
870
 
853
The command does not attempt to merge file versions within the repository. It
871
The command does not attempt to merge file versions within the repository. It
854
may result in multiple instances of a file within the repository. Use only for
872
may result in multiple instances of a file within the repository. Use only for
855
simple imports.
873
simple imports.
Line 876... Line 894...
876
    -dir=path               - Path to new version
894
    -dir=path               - Path to new version
877
    -label                  - Label the result
895
    -label                  - Label the result
878
    -replace                - Allow the label to be replaced
896
    -replace                - Allow the label to be replaced
879
    -reuse                  - Reuse the import directory
897
    -reuse                  - Reuse the import directory
880
    -workspace=path         - Path and name of alternate workspace
898
    -workspace=path         - Path and name of alternate workspace
-
 
899
    -[no]delete             - Deletes workspace after use. Default:yes
881
 
900
 
882
=head2 ARGUMENTS
901
=head2 ARGUMENTS
883
 
902
 
884
The command takes one argument: The URL of the desirecd package.
903
The command takes one argument: The URL of the desired package.
885
This may be be:
904
This may be be:
886
 
905
 
887
=over
906
=over
888
 
907
 
889
=item * A full URL
908
=item * A full URL
Line 915... Line 934...
915
existing level will be incremented. This option may be specified multiple times.
934
existing level will be incremented. This option may be specified multiple times.
916
 
935
 
917
 
936
 
918
=item -package=name
937
=item -package=name
919
 
938
 
920
This option is mandatory. It specifies the repository and package to be used as a
939
Either this option or a bare URL on the command line must be provided. It
921
basis for the work.
940
specifies the repository and package to be used as a basis for the work.
922
 
941
 
923
=item -dir=path
942
=item -dir=path
924
 
943
 
925
This option is mandatory. It specifies the path to a local directory that
944
This option is mandatory. It specifies the path to a local directory that
926
contains a version of the software to be checked in.
945
contains a version of the software to be checked in.
927
 
946
 
928
=item -label=name
947
=item -label=name
929
 
948
 
930
The resulting software version will be labled with this tag, if it is provided.
949
The resulting software version will be labeled with this tag, if it is provided.
931
 
950
 
932
=item -replace
951
=item -replace
933
 
952
 
934
This option, if provided, allows the label to be replaced.
953
This option, if provided, allows the label to be replaced.
935
 
954
 
936
=item -reuse
955
=item -reuse
937
 
956
 
938
This option can be used to speed the creation of multiple versions in a scripted
957
This option can be used to speed the creation of multiple versions in a scripted
939
environment. The option allows the utility to reuse the workspace if it exists
958
environment. The option allows the utility to reuse the workspace if it exists.
940
 
959
 
941
=item -workpspace=path
960
=item -workspace=path
942
 
961
 
943
This option specifies an alternate workspace directory to create and use. The
962
This option specifies an alternate workspace directory to create and use. The
944
default directory is "SvnImportDir" within the users current directory.
963
default directory is "SvnImportDir" within the users current directory.
945
 
964
 
-
 
965
=item [no]delete
-
 
966
 
-
 
967
This option control the deletion of the workspace directory. By default he
-
 
968
directory will be deleted, unless re-use is also used.
-
 
969
 
946
=back
970
=back
947
 
971
 
948
=head2 DESCRIPTION
972
=head2 DESCRIPTION
949
 
973
 
950
Import a new version of a package to the trunk of the package. The utility
974
Import a new version of a package to the trunk of the package. The utility
Line 954... Line 978...
954
This utility is used import software from another version control system
978
This utility is used import software from another version control system
955
The utility will:
979
The utility will:
956
 
980
 
957
=over
981
=over
958
 
982
 
959
=item * Create a Work Space based on the current pakage version
983
=item * Create a Work Space based on the current package version
960
 
984
 
961
The 'trunk' of the named package will be used as the baes for the workspace.
985
The 'trunk' of the named package will be used as the base for the workspace.
962
 
986
 
963
=item * Update files and directories
987
=item * Update files and directories
964
 
988
 
965
Determines the files and directories that have been added and deleted and
989
Determines the files and directories that have been added and deleted and
966
update the Workspace to reflect the new structure.
990
update the Workspace to reflect the new structure.
Line 969... Line 993...
969
 
993
 
970
=item * Label the new version
994
=item * Label the new version
971
 
995
 
972
=back
996
=back
973
 
997
 
-
 
998
The utility can optionally perform other operations including:
-
 
999
 
-
 
1000
=over
-
 
1001
 
-
 
1002
=item * Import directly to a branch. This does not affect the 'trunk'.
-
 
1003
 
-
 
1004
=item * Import directly to a tag. This does not affect the 'trunk'
-
 
1005
 
-
 
1006
=back
-
 
1007
 
974
=cut
1008
=cut
975
 
1009