This commit is contained in:
z_demo_z
2001-04-02 23:55:33 +00:00
parent 1fe183be02
commit 6f4518f94f
23 changed files with 651 additions and 0 deletions

View File

@@ -0,0 +1,50 @@
#!CVSGUI1.0 --folder --name "Change Root"
global numChanged
set numChanged 0
global changeTo
set changeTo ":pserver:alexgui@stratadev.strata3d.com:/cvspub/cvsgui"
proc changeRoot {dirName} {
set oldDir [pwd]
cd $dirName
set fileid [open Root w]
global changeTo
puts $fileid $changeTo
close $fileid
global numChanged
incr numChanged
cd $oldDir
}
proc iterate {dirName} {
set oldDir [pwd]
cd $dirName
cvsout "Entering $dirName\n"
set dirList [glob -nocomplain *]
set dirSize [llength $dirList]
for {set j 0} {$j < $dirSize} {incr j} {
set fileName [lindex $dirList $j]
if {[file isdirectory $fileName]} {
if {[string compare cvs [string tolower $fileName]] == 0} {
changeRoot $fileName
} else {
iterate $fileName
}
}
}
cd $oldDir
}
set selList [cvssel]
set selSize [llength $selList]
for {set i 0} {$i < $selSize} {incr i} {
iterate [lindex $selList $i]
}
cvsout "Done !\n"
cvsout "$numChanged file(s) changed !\n"

3
zsnes/Macros/CvsInit.tcl Normal file
View File

@@ -0,0 +1,3 @@
#!CVSGUI1.0 --admin --name "cvs init"
cvs init

View File

@@ -0,0 +1,55 @@
[INNNNNNNNNNNNNNNNNNNNN PROGRESS !]
Macros start-up :
-----------------
* In order to be recognized by the application, the macro file has to be
located in the "Macros" folder (or any of its sub-folder).
* A header tells the application in which menu to hook-up the macro :
#!CVSGUI1.0 [--admin|--selection|--files|--folder] --name "The name which appears in the menu"
Built-in TCL commands available anywhere :
------------------------------------------
* cvs : the cvs command.
* cvsout ?arg arg...?
output a set of strings to the console window.
* cvserr ?arg arg...?
output a set of strings to the console window.
* cvsentries pathName funcName
load the CVS/Entries informations from pathName and set the funcName with
a "cvsbrowser" like syntax (see below).
Built-in TCL commands only from the Selections menu :
-----------------------------------------------------
* cvsbrowser :
- cvsbrowser get : returns a list of the selected items in the browser. A simple
return is : {"C:/myproject/foo.c" "C:/myproject/foo.rc"}
- cvsbrowser info fileName arrayName : set the array "arrayName" with a set of informations
about "fileName". If the browser has such an information, the array "arrayName" contains :
+ $arrayName(name) : the file name
+ $arrayName(kind) : [file|folder]
+ $arrayName(path) : the file path
+ $arrayName(missing) : [0|1]
+ $arrayName(unknown) : [0|1]
+ $arrayName(ignored) : [0|1]
+ $arrayName(locked) : [0|1]
+ $arrayName(modified) : [0|1]
+ $arrayName(status) : A string like "Mod. file" or "Unknown folder"
+ if the element is a file (if $arrayName(kind) is "file")
+ $arrayName(revision) : the file revision (i.e. 1.1, 1.2.3.4...)
+ $arrayName(timestamp) : the time stamp on the server
+ $arrayName(option) : the substitution option (i.e. -kb)
+ $arrayName(tag) : the tag name (if any)
+ $arrayName(conflict) : the conflict desc. (if any)
Built-in TCL commands only from the Files/Folder menu :
-------------------------------------------------------
* cvssel : return a list of the selected file(s) or folder(s). A simple list is
{"C:/myproject/foo.c", "C:/myproject/rsr/foo.rc"} or {"C:/myproject", "C:/myproject/rsr"}

View File

@@ -0,0 +1,56 @@
#!CVSGUI1.0 --selection --name "Fast search modified"
global numFound
set numFound 0
proc iterate {dirName} {
cvsentries $dirName browsit
set selList [browsit get]
set selSize [llength $selList]
set toRecurse {}
set printFlag 1
for {set j 0} {$j < $selSize} {incr j} {
set file [lindex $selList $j]
browsit info $file fileInfo2
if {[string compare $fileInfo2(kind) "file"] == 0} {
if {$fileInfo2(modified) == 1} {
if {$printFlag == 1} {
cvsout "In $dirName :\n"
set printFlag 0
}
cvserr " $fileInfo2(name) is modified\n"
global numFound
incr numFound
}
}
if {[string compare $fileInfo2(kind) "folder"] == 0 && $fileInfo2(missing) == 0 && $fileInfo2(unknown) == 0} {
lappend toRecurse $file
}
}
set selRecurse [llength $toRecurse]
for {set j 0} {$j < $selRecurse} {incr j} {
set file [lindex $toRecurse $j]
iterate $file
}
}
set selList [cvsbrowser get]
set selSize [llength $selList]
cvsout "Looking for modified files...\n"
for {set i 0} {$i < $selSize} {incr i} {
set file [lindex $selList $i]
cvsbrowser info $file fileInfo
if {[string compare $fileInfo(kind) "folder"] == 0 && $fileInfo(missing) == 0 && $fileInfo(unknown) == 0} {
iterate $file
}
}
cvsout "Done !\n"
cvsout "$numFound file(s) found !\n"

View File

@@ -0,0 +1,11 @@
#!CVSGUI1.0 --files --name "Files sample"
set selList [cvssel]
set selSize [llength $selList]
cvsout "Hello, this is a sample macro !\n"
cvsout "Total selected : " $selSize "\n"
for {set i 0} {$i < $selSize} {incr i} {
cvsout " -> " [lindex $selList $i] \n
}

View File

@@ -0,0 +1,40 @@
#!CVSGUI1.0 --folder --name "Clean-up merging files"
global numDeleted
set numDeleted 0
proc iterate {dirName} {
if {[string compare cvs [string tolower $dirName]] == 0} {
return
}
set oldDir [pwd]
cd $dirName
cvsout "Entering $dirName\n"
set dirList [glob -nocomplain *]
set dirSize [llength $dirList]
for {set j 0} {$j < $dirSize} {incr j} {
set fileName [lindex $dirList $j]
if {[file isdirectory $fileName]} {
iterate $fileName
} elseif {[file isfile $fileName]} {
if {[string compare [string range $fileName 0 1] ".#"] == 0} {
cvsout "*** deleting -> " "'" $dirName / $fileName "'" ...\n
file delete $fileName
global numDeleted
incr numDeleted
}
}
}
cd $oldDir
}
set selList [cvssel]
set selSize [llength $selList]
for {set i 0} {$i < $selSize} {incr i} {
iterate [lindex $selList $i]
}
cvsout "Done !\n"
cvsout "$numDeleted file(s) deleted !\n"

View File

@@ -0,0 +1,3 @@
#!CVSGUI1.0 --admin --name "List the modules on the server"
cvs co -c

View File

@@ -0,0 +1,33 @@
#!CVSGUI1.0 --selection --name "Selection sample"
set selList [cvsbrowser get]
set selSize [llength $selList]
cvsout "Hello, this is a sample macro !\n"
cvsout "Total selected : " $selSize "\n\n"
for {set i 0} {$i < $selSize} {incr i} {
#file tail
#file dirname
set file [lindex $selList $i]
cvsbrowser info $file fileInfo
cvsout "Info for " $file "\n"
cvsout "--> Name : " $fileInfo(name) "\n"
cvsout "--> Kind : " $fileInfo(kind) "\n"
cvsout "--> Path : " $fileInfo(path) "\n"
cvsout "--> Missing : " $fileInfo(missing) "\n"
cvsout "--> Unknown : " $fileInfo(unknown) "\n"
cvsout "--> Ignored : " $fileInfo(ignored) "\n"
cvsout "--> Locked : " $fileInfo(locked) "\n"
cvsout "--> Modified : " $fileInfo(modified) "\n"
cvsout "--> Status : " $fileInfo(status) "\n"
if {[string compare $fileInfo(kind) "file"] == 0} {
cvsout "--> Revision : " $fileInfo(revision) "\n"
cvsout "--> Timestamp : " $fileInfo(timestamp) "\n"
cvsout "--> Option : " $fileInfo(option) "\n"
cvsout "--> Tag : " $fileInfo(tag) "\n"
cvsout "--> Conflict : " $fileInfo(conflict) "\n"
}
cvsout "\n"
}

View File

@@ -0,0 +1,3 @@
#!CVSGUI1.0 --admin --name "Print the cvs version"
cvs --version