Creating a new subdirectory structure in ClearCase?

后端 未结 3 1440
有刺的猬
有刺的猬 2020-11-27 08:05

I\'m a ClearCase newbie and up until now have been used to SVN. Therefore, I\'m a bit confused on the steps I need to take to create a new directory structure containing mul

相关标签:
3条回答
  • 2020-11-27 08:35

    As explained in How can I use ClearCase to “add to source control …” recursively?, you have to use clearfsimport which does what you are saying (checkout the parent directories, mkelem for the elements)

    clearfsimport -preview -rec -nset c:\sourceDir\ChildDirectory5 m:\MyView\MyVob\ParentDirectory
    

    Note the :

    • -preview option: it will allow to check what would happen without actually doing anything.
    • '*' used only in Windows environment, in order to import the content of a directory
    • -nset option (see my previous answer about nset).

    I would recommend dynamic view for those initialization phases where you need to import a lot of data: you can quickly see what your view looks like without making any update (like "without updating your workspace"):
    ClearCase allows to access the data in two ways:

    • snapshot view (like a SVN workspace, except all the .svn are actually externalized in a view storage outside the workspace)
    • dynamic view: all your files are visible through the network (instant access/update)
    0 讨论(0)
  • 2020-11-27 08:36

    I use a variant of this script (I call it "ctadd"):

    #!/usr/bin/perl
    
    use strict;
    use Getopt::Attrribute;
    
    (our $nodo : Getopt(nodo));
    (our $exclude_pat : Getopt(exclude_pat=s));
    
    for my $i (@ARGV) {
      if ($i =~ /\s/) {
        warn "skipping file with spaces ($i)\n";
        next;
      }
      chomp(my @files = `find $i -type f`);
      @files = grep !/~$/, @files;  # emacs backup files
      @files = grep !/^\#/, @files; # emacs autosave files
      if (defined($exclude_pat)) {
        @files = grep !/$exclude_pat/, @files;
      }
      foreach (@files) {
        warn "skipping files with spaces ($_)\n" if /\s/ ;
      }
      @files = grep !/\s/, @files;
      foreach (@files) {
        my $cmd = "cleartool mkelem -nc -mkp \"$_\"";
        print STDERR "$cmd\n";
        system($cmd) unless $nodo;
      }
    }
    

    The -mkpath option of cleartool mkelem will automatically create and/or check out any needed directories.

    For this script, -nodo will have it simply output the commands, and -exclude will allow you to specify a pattern for which any file that matches it will be excluded.

    Note that Getopt::Attribute is not part of the standard Perl distribution, but it is available on a CPAN mirror near you.

    0 讨论(0)
  • 2020-11-27 08:48

    You have to import your local directory structure. The command is clearfsimport.

    0 讨论(0)
提交回复
热议问题