Register now and start sharing your code snippets.

Recursively add files to ClearCase

Ruby posted 5 months ago by christian

This script adds all files in the current directory to ClearCase.

Save the following script as add_recursively.rb in the directory you want to add to ClearCase:

   1  %x{cleartool ls -view_only -r -s . > view_private_files.txt}
   2  
   3  lines = File.open('view_private_files.txt').readlines.collect{|line| %Q{"#{line.chomp}"} }
   4  
   5  # Work around command line length limit in Windows
   6  while lines.size > 0
   7    %x{cleardlg /addtosrc #{lines.slice!(0..100).join(' ')}}
   8  end

Next open a command line window and execute the script:

   1  cd clearcase_vob
   2  ruby add_recursively.rb

ClearCase sucks, use Mercurial or git instead…

Tagged add, recursive, clearcase, ruby, script

ClearCase commands for listing changes (between builds, by me, etc)

Shell Script (Bash) posted 7 months ago by christian

   1  # List changes done by me
   2  cleartool lshistory -since 10-January-2007 -recurse -me
   3  
   4  # List view only files
   5  cleartool ls -view_only -recurse
   6  
   7  # Find changes between two releases
   8  cleartool find PATH -print -version "lbtype(NEW_BUILD_LABEL) && !version(OLD_BUILD_LABEL)"

Tagged clearcase, cleartool, diff, changes