WUGNET, the Windows User Group Network
Your Complete Resource Center for "The Best" in Shareware, Computing Tips and Support, Windows Industry News... and much more!
Home Forums Shareware Windows Tips Hot Offers FREE Newsletters Arcade Contact Us About Partners
Search WUGNET: RSS Feeds RSS Feeds Advertise with WUGNET    |    Shareware eBooks
HomeHome FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

VSS Automation - Labels

 
   Home -> Office other -> SourceSafe RSS
Next:  Why are some menu items not working Visio 2007 (a..  
Author Message
Jerry

External


Since: Apr 11, 2006
Posts: 45



(Msg. 1) Posted: Mon May 12, 2008 7:36 am
Post subject: VSS Automation - Labels
Archived from groups: microsoft>public>visual>sourcesafe (more info?)

Hi, I'm looking at adding a label, of a version #, to all the files in a
project when we release a new build. But I seem to be getting an error when
actually trying to apply the label via automation. Basically I want to be
able to look back at the project later and see what VSS version of a file,
was included in a build.

See code below. I've tried various commands but it's basically failing on
--> oFileVersion.Label("v08.05.01","")

Can't I add a label to a specific file version? I seem to be able to via the
GUI. Am I going about this the wrong way?

Thanks,

Jerry

cVSSPath="\\Common\VSS\srcsafe.ini"
cProject="$/Project_Utilities/"

oVSS=CREATEOBJECT("SourceSafe")
oVSS.Open(cVSSPath, "admin","")

VSS_GetFiles(oVSS,cProject)

PROCEDURE VSS_GetFiles(toVSS, tcPath)
LOCAL oVSSItem, oFileVersion

FOR EACH oVSSItem IN toVSS.VSSITEM(tcPath).Items
DO CASE
CASE oVSSItem.Type=0 && 0 - Project
VSS_GetFiles(toVSS,tcPath+oVSSItem.Name+"/")
CASE oVSSItem.Type=1 && 1 - File
FOR EACH oFileVersion IN toVSS.VSSItem(tcPath+"/"+oVSSItem.Name).Versions
IF EMPTY(oFileVersion.Label)
oFileVersion.Label("v08.05.01","")
ELSE
EXIT
ENDIF
ENDFOR
ENDCASE
ENDFOR
ENDPROC
Back to top
Login to vote
Mark Tolonen

External


Since: May 07, 2008
Posts: 14



(Msg. 2) Posted: Mon May 12, 2008 11:15 pm
Post subject: Re: VSS Automation - Labels [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"Jerry" <Jerry.DeleteThis@discussions.microsoft.com> wrote in message
news:B65308ED-E15E-43E3-BB48-284B517B4D1E@microsoft.com...
> Hi, I'm looking at adding a label, of a version #, to all the files in a
> project when we release a new build. But I seem to be getting an error
> when
> actually trying to apply the label via automation. Basically I want to be
> able to look back at the project later and see what VSS version of a file,
> was included in a build.
>
> See code below. I've tried various commands but it's basically failing on
> --> oFileVersion.Label("v08.05.01","")
>
> Can't I add a label to a specific file version? I seem to be able to via
> the
> GUI. Am I going about this the wrong way?
>
> Thanks,
>
> Jerry
>
> cVSSPath="\\Common\VSS\srcsafe.ini"
> cProject="$/Project_Utilities/"
>
> oVSS=CREATEOBJECT("SourceSafe")
> oVSS.Open(cVSSPath, "admin","")
>
> VSS_GetFiles(oVSS,cProject)
>
> PROCEDURE VSS_GetFiles(toVSS, tcPath)
> LOCAL oVSSItem, oFileVersion
>
> FOR EACH oVSSItem IN toVSS.VSSITEM(tcPath).Items
> DO CASE
> CASE oVSSItem.Type=0 && 0 - Project
> VSS_GetFiles(toVSS,tcPath+oVSSItem.Name+"/")
> CASE oVSSItem.Type=1 && 1 - File
> FOR EACH oFileVersion IN toVSS.VSSItem(tcPath+"/"+oVSSItem.Name).Versions
> IF EMPTY(oFileVersion.Label)
> oFileVersion.Label("v08.05.01","")
> ELSE
> EXIT
> ENDIF
> ENDFOR
> ENDCASE
> ENDFOR
> ENDPROC

Just label the project. Here's a Python example:

import win32com.client
vss=win32com.client.gencache.EnsureDispatch('SourceSafe')
vss.Open(r'c:\vss\srcsafe.ini')
p=vss.VSSItem('$/MyProject')
p.Label('test')

This is the equivalent of assigning a label to a project in the GUI.

-Mark
Back to top
Login to vote
Jerry

External


Since: Apr 11, 2006
Posts: 45



(Msg. 3) Posted: Fri May 16, 2008 12:53 pm
Post subject: Re: VSS Automation - Labels [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Hi Mark, there are a couple things I don't like about that method:
• when I view the history of an item it now has an extra line in there with
an Action of "Labelled..."
• if a file hasn't changed for 10 releases, I'm going to have a new label
for each new release
• if I only retrieve the history using the "From" & "To" options, with the
version # I'm putting in the labels, I only get those new records and not the
actual source safe versions.

Essentially I was looking to get the same results as when you bring up the
history of a file, select a version, click the Details button & then add a
label, but through automation. Can that be done? I know it would be more code
but I think it would be cleaner.


Thanks,

Jerry


"Mark Tolonen" wrote:

>
> "Jerry" <Jerry.RemoveThis@discussions.microsoft.com> wrote in message
> news:B65308ED-E15E-43E3-BB48-284B517B4D1E@microsoft.com...
> > Hi, I'm looking at adding a label, of a version #, to all the files in a
> > project when we release a new build. But I seem to be getting an error
> > when
> > actually trying to apply the label via automation. Basically I want to be
> > able to look back at the project later and see what VSS version of a file,
> > was included in a build.
> >
> > See code below. I've tried various commands but it's basically failing on
> > --> oFileVersion.Label("v08.05.01","")
> >
> > Can't I add a label to a specific file version? I seem to be able to via
> > the
> > GUI. Am I going about this the wrong way?
> >
> > Thanks,
> >
> > Jerry
> >
> > cVSSPath="\\Common\VSS\srcsafe.ini"
> > cProject="$/Project_Utilities/"
> >
> > oVSS=CREATEOBJECT("SourceSafe")
> > oVSS.Open(cVSSPath, "admin","")
> >
> > VSS_GetFiles(oVSS,cProject)
> >
> > PROCEDURE VSS_GetFiles(toVSS, tcPath)
> > LOCAL oVSSItem, oFileVersion
> >
> > FOR EACH oVSSItem IN toVSS.VSSITEM(tcPath).Items
> > DO CASE
> > CASE oVSSItem.Type=0 && 0 - Project
> > VSS_GetFiles(toVSS,tcPath+oVSSItem.Name+"/")
> > CASE oVSSItem.Type=1 && 1 - File
> > FOR EACH oFileVersion IN toVSS.VSSItem(tcPath+"/"+oVSSItem.Name).Versions
> > IF EMPTY(oFileVersion.Label)
> > oFileVersion.Label("v08.05.01","")
> > ELSE
> > EXIT
> > ENDIF
> > ENDFOR
> > ENDCASE
> > ENDFOR
> > ENDPROC
>
> Just label the project. Here's a Python example:
>
> import win32com.client
> vss=win32com.client.gencache.EnsureDispatch('SourceSafe')
> vss.Open(r'c:\vss\srcsafe.ini')
> p=vss.VSSItem('$/MyProject')
> p.Label('test')
>
> This is the equivalent of assigning a label to a project in the GUI.
>
> -Mark
>
>
Back to top
Login to vote
Display posts from previous:   
       Home -> Office other -> SourceSafe All times are: Eastern Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Categories:
 Windows XP
 Windows Vista
 Windows Other
 Office
  Office Other
 Security
 WinRAR
  • Home |
  • Shareware |
  • Windows Tips |
  • Hot Offers |
  • FREE Newsletters |
  • Arcade |
  • Forums |
  • eBooks |
  • About WUGNET |
  • Partners |
  • Contact

  • WUGNET Privacy Policy |
  • Link to WUGNET