Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Code inventory tool?
Message
 
 
À
24/02/2006 10:36:52
Mike Yearwood
Toronto, Ontario, Canada
Information générale
Forum:
Visual FoxPro
Catégorie:
Source Safe Control
Divers
Thread ID:
01098866
Message ID:
01099123
Vues:
21
Mike,

VSS does have a automation interface which may be a little easier than writing batch files and parsing the output.
* this code pins the current version of every file in a VSS project

* code based off KB article found at http://support.microsoft.com/default.aspx?scid=http://support.microsoft.com:80/support/kb/articles/Q258/1/46.asp&NoWebContent=1
* and http://www.michaelis.net/SourceSafe/Faq.htm#_Toc33748951
* and http://www.eps-software.com/download/whitepaper_extendingsourcesafe.pdf
* and http://msdn.microsoft.com/library/en-us/dnvss/html/vssauto.asp?frame=true

public loVSS

loVSS = createobject( "SourceSafe" )
loVSS.Open( "\\vss01\vss\srcsafe.ini", "", "" )

set step on
ltStart = datetime()

PinProject( "$/X/Y/Z/Prod/" )

? "Done at", datetime(), " elapsed time:", datetime() - ltStart
return


function PinProject( lcProject )
local loProject, loItems, loItem, lnVersionNumber, loOldItem

lcProject = addbs( lcProject )

? datetime(), " now working on project:" + lcProject
? ""

loProject = loVSS.VSSItem( lcProject ) && sets current project
loItems = loProject.Items() && collection of items in this project

for each loItem in loItems
   do case
      case ( loItem.Type = 0 )
         * recurse into the subproject (folder)
         PinProject( lcProject + loItem.Name + "/" )

      case ( loItem.Type = 1 )
         * a file to process
         @ $,0 say loItem.Name + space(30)
         lnVersionNumber = loItem.VersionNumber
         loOldItem = loItem.Version( lnVersionNumber )
         loProject.Share( loOldItem, "", 0 )
   endcase
endfor
return
>What about reporting the daily activities of individual programmers?
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform