Kinook Software Forums

Kinook Software Forums (http://www.kinook.com/Forum/index.php)
-   [VBP] Third Party Tools (http://www.kinook.com/Forum/forumdisplay.php?f=3)
-   -   Problem with "Get Latest..." when using label (http://www.kinook.com/Forum/showthread.php?t=1566)

Alexey 02-17-2006 09:32 AM

Problem with "Get Latest..." when using label
 
In VSS tree I have a node $/MnProject, and there are several VB files (forms, modules etc) in this project. I add step of "SourceSafe" type to my build. I click menu "Properties..." and choose the "Database" tab. There I set:

Operation: Get
Database:
Username:
Password:
Projects and/or files...: $/MnProject/*.*
Recurse checkbox: checked
Version to operate on...:
Path for local files:


If I press "Test" button, everything works fine and I see how files are copied from VSS to my local drive; the last log record says "Build successfully completed". Wonderful.

But if change the following parameter:

Version to operate on...: LMyLabel

then I get the following output:

Code:

    Version not found

    Process completed with exit code 100
    17.02.2006 17:16:17: Step 'Get Latest from VSS' failed
    17.02.2006 17:16:18: Build ended.

Strange, because I certainly have a label "MyLabel" on two files located under $/MnProject! For example, if I start MS VSS Explorer, right-click on the $/MnProject node in the project tree, select "Show history..." and check all four upper checkboxes - then I do see those two labeled files in the history list!

What's the reason?

kinook 02-17-2006 09:38 AM

SourceSafe file labels aren't good for much -- you have to specify each individual filename to get on a file label. Project labels are much more useful -- they can be used in conjunction with wildcards and recursive gets.

Alexey 02-17-2006 09:57 AM

Well, we often have such situations when a "stable" build of our software product is associated not just with the latest version of the whole VSS project (recursively with all its contents) but with different versions of different files. For example, we have such a situation:

$/MnProject contains:

1. MainModule.bas, latest VSS version is 5.
2. frmMain.frm, latest VSS version is 22.
3. clsMyClass.cls, latest VSS version is 14.
4. MnProject.vbp, latest VSS version is 7.

We want to make build - but not from the latest versions. Instead, we need to take the following versions for the build:

1. MainModule.bas - 4.
2. frmMain.frm - 22.
3. clsMyClass.cls - 10.
4. MnProject.vbp - 7.

Note that items 1 and 3 need to be taken from VSS with their previous versions (not latest!).

In such case I can't leave "Version to operate on..." blank - because it's said "blank for current". I also can't use version number in this filed - versions differ (see above). I also can't use dates. So the only way out is to use labels, isn't it? And if yes - then it would be nice to place "LMyLabel" in that field and see how everythings works!

Alexey 02-17-2006 10:27 AM

And more...
 
OK, I set "Version to operate on..." to "D02/17/06". I do have VSS subfolders (projects, not files!) with this date under $/MnProject. But again I get "Version not found" and "exit code 100" in the output pane. I understand nothing...

kinook 02-17-2006 11:44 AM

Regarding versioning of multiple releases, look into share/pin/branch/merge functionality [1]. Although SourceSafe's implementation is not the most robust, so you may want to evaluate alternative products if you have to manage many different parallel releases.

Regarding getting by date, VSS only looks at file dates, not projects/folders. You may want to specify a date range [2].

[1] http://msdn.microsoft.com/library/en...d_Projects.asp
[2] http://msdn.microsoft.com/library/en...ne_SwitchV.asp

Alexey 02-20-2006 12:10 AM

Quote:

Originally posted by kinook
Regarding versioning of multiple releases, look into share/pin/branch/merge functionality [1]. Although SourceSafe's implementation is not the most robust, so you may want to evaluate alternative products if you have to manage many different parallel releases.
Thanx, but actually I do not need sharing files across projects. The only thing I need is that the -V switch should work as described in [2]. It's said there that "the -V option displays all files and projects identified by the version number specified on the command line". So it should work with files as well, not only with projects... or I'm wrong?

Quote:

Originally posted by kinook
Regarding getting by date, VSS only looks at file dates, not projects/folders. You may want to specify a date range [2].

[1] http://msdn.microsoft.com/library/en...d_Projects.asp
[2] http://msdn.microsoft.com/library/en...ne_SwitchV.asp [/B]
Thank You for the links. I still can't understand why it doesn't want to work when -V switch is used with L to specify a label!

Alexey 02-20-2006 02:14 AM

1 Attachment(s)
That's the command line that fails (together with all other output):

20.02.2006 10:06:42: --------------------Starting Build: 'MyTest.bld'--------------------
20.02.2006 10:06:42: Building project step 'Get Latest from VSS'...
"C:\Program Files\Microsoft Visual Studio\Common\VSS\win32\ss.exe" Get $/MnProject/*.* -GL"D:\MyVSS Root WorkFolder" -GWS -GTM -GCK -R -NL -I-N -VLMyLabel -Yyumashin,****** -W-
Version not found

Process completed with exit code 100
20.02.2006 10:06:42: Step 'Get Latest from VSS' failed
20.02.2006 10:06:42: Build ended.


And I also attach the screenshot of the step's properties.

BTW, I also labelled a project (not file) inside $/MnProject. It also gives the same output, although in one of your previous messages you wrote that labeling should work with projects OK.

Alexey 02-20-2006 07:35 AM

OK, it seems that it's a question not to You but to Microsoft. VSS is really a strange thing.

As far as I can't perform the built-in "Get latest" step in the desired manner, I'm thinking of writing some kind of script that will recursively search through the VSS project tree, getting individual versions of each file one-by-one. As in my example above:

Build 1.12.034 is:
1. MainModule.bas - 4.
2. frmMain.frm - 22.
3. clsMyClass.cls - 10.
4. MnProject.vbp - 7.

Of course, I should store somewhere such table describing the structure of the build, but it's another question. Probably this will MS SQL Server 2000.

So my question is: has your built-in script language enough capabilities to perform this task? I'll need smth. like this:
Code:

For i = 1 To VSSItemsCollection.Count
    sVersion = GetVersionForBuild(VSSItemsCollection(i).FileName, "1.12.034")
    VSSItemsCollection(i).GetVersionFromVSS sVersion, sLocalFolder
Next i

Here GetVersionForBuild is my custom function obtaining (e.g. from SQL Server) version number of a given file for a given build. For example, the following call
Code:

    sVersion = GetVersionForBuild("clsMyClass.cls", "1.12.034")
should return "10" (see the "blue" example above). And GetVersionFromVSS is another custom function calling ss.exe with switch Get etc.

Is such approach possible? And will it be possible to retrieve VSSItemsCollection (of a given project) from your script language?

kinook 02-20-2006 08:11 AM

http://www.visualbuild.com/Manual?scripting.htm
http://groups.google.com/groups?hl=e...pt&sa=N&tab=wg


All times are GMT -5. The time now is 05:36 AM.


Copyright 1999-2019 Kinook Software, Inc.