home *** CD-ROM | disk | FTP | other *** search
/ PC World 2000 August / PCWorld_2000-08_cd.bin / Software / TemaCD / wincvs / data1.cab / Example_Files / Macros / FastModSearch.tcl < prev    next >
Text File  |  1999-03-23  |  1KB  |  57 lines

  1. #!CVSGUI1.0 --selection --name "Fast search modified"
  2.  
  3. global numFound
  4. set numFound 0
  5.  
  6. proc iterate {dirName} {
  7.     cvsentries $dirName browsit
  8.  
  9.     set selList [browsit get]
  10.     set selSize [llength $selList]
  11.     set toRecurse {}
  12.     set printFlag 1
  13.  
  14.     for {set j 0} {$j < $selSize} {incr j} {
  15.         set file [lindex $selList $j]
  16.         browsit info $file fileInfo2
  17.  
  18.         if {[string compare $fileInfo2(kind) "file"] == 0} {
  19.             if {$fileInfo2(modified) == 1} {
  20.                 if {$printFlag == 1} {
  21.                     cvsout "In $dirName :\n"
  22.                     set printFlag 0
  23.                 }
  24.                 cvserr "    $fileInfo2(name) is modified\n"
  25.                 global numFound
  26.                 incr numFound
  27.             }
  28.         }
  29.  
  30.         if {[string compare $fileInfo2(kind) "folder"] == 0 && $fileInfo2(missing) == 0 && $fileInfo2(unknown) == 0} {
  31.             lappend toRecurse $file
  32.         }
  33.     }
  34.  
  35.     set selRecurse [llength $toRecurse]
  36.     for {set j 0} {$j < $selRecurse} {incr j} {
  37.         set file [lindex $toRecurse $j]
  38.         iterate $file
  39.     }
  40. }
  41.  
  42. set selList [cvsbrowser get]
  43. set selSize [llength $selList]
  44.  
  45. cvsout "Looking for modified files...\n"
  46. for {set i 0} {$i < $selSize} {incr i} {
  47.     set file [lindex $selList $i]
  48.     cvsbrowser info $file fileInfo
  49.  
  50.     if {[string compare $fileInfo(kind) "folder"] == 0 && $fileInfo(missing) == 0 && $fileInfo(unknown) == 0} {
  51.         iterate $file
  52.     }
  53. }
  54.  
  55. cvsout "Done !\n"
  56. cvsout "$numFound file(s) found !\n"
  57.