Contact us


All times are UTC - 8 hours



Post new topic Reply to topic  [ 4 posts ] 
Author Message
Offline Profile  


Joined: Wed Jun 08, 2011 5:20 am
Posts: 2
Hi folks,

I will appologize in advance as i"m new to VB6 and VSS OLE Automation so pardon my ignorance if it's an easy answer (which i'll take at this point)! Quick background: Previous employee who worked with our production build tool left the company so i'm holding the bag with a homegrown tool built in VB6 that we use to pull data from VSS via the OLE api to create builds.

During a build, we put a recursive label on the entire project as a way to "checkpoint" when a build was cut. Normally we just pull the latest version of files from VSS but my boss wants us to be able to pull from a specific version/label. I'm working on a chunk of code which loops through a VSS object's versions, trying to match up to a passed in "label". If we match the label, i want to pull that explicit version of the file. The code is unable to pull the file by version if the version was attached to a label vs a "true" version # applied by a checkin, branch, etc. I'm beginning to think the problem is that because the label was applied at the top level, the version # attached to a child object (with that same label) won't allow us to grab the file at that point in time.

Case in point. I have a file $/A/B/test.pdf. During a build, we apply a label to $/A recursively. In the VSS UI, if i were to do a "Show History" for a given timeframe on the file test.pdf, I'd see 4 entries. The most recent 2 are only labels applied at the /A project level recursively. The latter 2 entries show up as actual version #'s because they were file checkins or branches.

<my attempt at History UI view>
Version User Date Action
<pic of label icon> Cascoli 9/08/09 8:36a Labeled '5.0002.0338'
<pic of label icon> Cascoli 8/07/09 8:36a Labeled '5.0002.0336'
2 Cascoli 7/15/09 8:36a Branched at version 2
1 Cascoli 7/01/09 8:36a Created

From the UI, you can see versions 1 and 2 are true versions (so to speak) but i only see the version #'s (3 and 4) for the last two entries if i highlight each entry and click Details button. The code does a basic search through the versions of the file object and grabs the label attached. If it matches the label we're looking for, we take the Version # and set the object to that specific file version. Unfortunately, setting the object to versions 3 and 4 fails later on when I do the "get". If I did the same object set but with version 1 or 2, it works fine. Any ideas? Actual code is below. Thanks in advance!


...
For Each oVSSVersion In moVSSItem.Versions(VSSFLAG_HISTIGNOREFILES + VSSFLAG_RECURSNO)

If UCase(oVSSVersion.Label) = UCase(sLabel) Then

Set moVSSItem = moVSSItem.Version(oVSSVersion.VersionNumber)
bLabelMatchFound = True
Exit For
End If

Next oVSSVersion

If Not (bLabelMatchFound) Then
Set moVSSItem = Nothing
End If

...

' Call the Get method with the proper switches for the kind of file being retrieved
moVSSItem.Get sLocalPath, VSSFLAG_REPREPLACE Or IIf(bWriteable, VSSFLAG_USERRONO, VSSFLAG_USERROYES)


Offline Profile  


Joined: Tue Mar 08, 2005 12:23 am
Posts: 1315
The version number for the labelled item you see is not the file's version number. It's the version number of its parent project.

For example,

Version User Date Action
<pic of label icon> Cascoli 9/08/09 8:36a Labeled '5.0002.0338'
<pic of label icon> Cascoli 8/07/09 8:36a Labeled '5.0002.0336' //you see the version number for the label is 3 (the project version), while acturally the labelled file version is 2.
2 Cascoli 7/15/09 8:36a Branched at version 2
1 Cascoli 7/01/09 8:36a Created

So to get a labelled file, please enumerate the file history and get the nearest "true" version number before the labelled version. As in your sample, if you want to retrieve Labeled '5.0002.0338', you need to get its real version number (2 Cascoli 7/15/09 8:36a Branched at version 2).

Hope it helps.

_________________
Catherine Sea
Dynamsoft Support Team
Follow us@Twitter, Facebook


Offline Profile  


Joined: Wed Jun 08, 2011 5:20 am
Posts: 2
Ah...ok. Thanks for the clarification!!! I'll head in that direction :)


Offline Profile  


Joined: Tue Mar 08, 2005 12:23 am
Posts: 1315
You are welcome. :D

_________________
Catherine Sea
Dynamsoft Support Team
Follow us@Twitter, Facebook


Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ]  Moderators: Robert, Catherine


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
cron
Copyright © 2016 Dynamsoft | All Rights Reserved
dynamic designed by Dynamsoft team