PDA

View Full Version : Trouble with Source Safe Get Files


marscheese
06-16-2006, 08:47 AM
So in the build I'm setting up, I get files from Source Safe.

In the "flags" tab under properties, when I click the "skip" option for "Handling of writeable files", it doesn't seem to work.

If I check out a file from SourceSafe (thus making the file writable on my machine), and try running the build, I get this error:

"A writable copy of c:\ProSolv\Build\UTILITIES\ServiceLib\ServiceLib.d sp already exists

Process completed with exit code 100"

I'm confused, because this option is supposed to stop this exact sort of thing from happening. If there are no checked out files, then there is no error. Using the other options (such as replacing the file instead of skipping it) seem to work just fine.

I don't think there is anything I am doing wrong, but if there are any suggestions, or if this is some sort of bug, I would like to know. Thanks in advance.

kinook
06-16-2006, 12:31 PM
It's just how VSS works.

http://www.visualbuild.com/Manual/vssflagstab.htm

"Handling of writeable local files: ...'Skip' will skip any local writeable files, and not replace with the version from the database (the action will also fail in this case since the VSS command-line tool will return a non-zero exit code)..."

Technically, skip means skip and treat as an error, but it's probably reasonable behavior, since the local file may be different from the one in VSS.

You could mark the step to ignore failure or parse LASTSTEP_OUTPUT in the step's vbld_StepDone event and set the status to success as appropriate.
http://www.visualbuild.com/Manual/scriptevents.htm
http://www.visualbuild.com/Manual/systemmacros.htm

TwoSixTwo
08-11-2006, 01:59 PM
We have the same problem.

But first let me say that this tool is excellent and has made my job much easier. We just bought a site license so that all of our developers can benefit from a reliable build process.

The skip exits with an error code of 100. It stops on the first writeable file. The old dos scripts we used would not exit, but move on to the next file in the sourcesafe project. That's the behavior I'm after.

If we ignore, it won't get any subsequent files.
There is 'Treat exitcode of 1 as successful'. Is there a way that I can get it to pick up where it left on exit code of 100? Or can I make it ignore exit codes of 100?

Any help would be appreciated. Thanks.

kinook
08-12-2006, 07:38 AM
Testing the Get step in VStudio.bld (after changing the 'Handling of local writeable files' option on the Flags tab to Skip), it gets all read-only files and only skips writeable files. If your step is not doing that, compare it with ours (or check the 'Show command-line...' checkbox on the Options tab of the SourceSafe action, build the step again, and compare with the one in your batch file/script).

To ignore exit code 100, either mark the step to continue on failure (this doesn't affect the behavior the ss.exe itself--see above), or use the following VBScript code in the step's vbld_StepDone script event:


If Step.BuildStatus = vbldStepStatFailed And _
InStr(vbld_AllMacros()("LASTSTEP_OUTPUT"), "Process completed with exit code 100" & vbCrLf) > 0 Then
Step.BuildStatus = vbldStepStatSucceeded
End If


http://www.visualbuild.com/Manual/scriptevents.htm

TwoSixTwo
08-15-2006, 02:16 PM
Thanks for your help. I did see where it gets all of the read-only files and skips the writeables. It behaves as described. I was confusing the exit code message with failure because I only had one writeable file.

Thanks again for the prompt reply. The code snippet was just what I needed. Now the step won't have a big, honking failure status.

One correction: the InStr test is >= 0 not just > 0

kinook
08-15-2006, 04:28 PM
Hmmm, I'm pretty sure InStr returns 0 if the string is not found and 1+ if found, but whatever works for you. Also, since ss.exe returns exit code 100 for just about every error, just marking the step to continue on failure and not build failure steps is about the same difference (you can get fancier and parse the output for certain error strings if you're really particular).

brizeka
02-25-2009, 04:59 PM
I am trying to implement the solution you have provided but have not been successful. When adding the code below the process always executes "MsgBox '2:' ". The text of LASTSTEP_OUTPUT does contain the text, as I can see it in the MsgBox display. Also, even after executing the "MsgBox '2:' " code, The Build Status is still "Failed". If I Build Next Step, only then does the status change. Is there something I am missing?

---< code >---
If Step.BuildStatus = vbldStepStatFailed And _
InStr(vbld_AllMacros()("LASTSTEP_OUTPUT"), "Process completed with exit code 100") = 0 Then
Step.BuildStatus = vbldStepStatSucceeded
MsgBox "1:" & Step.BuildStatus
End If

If Step.BuildStatus = vbldStepStatFailed Then
Step.BuildStatus = vbldStepStatSucceeded
MsgBox "2:" & Step.BuildStatus & vbld_AllMacros()("LASTSTEP_OUTPUT")
End If

kinook
02-26-2009, 10:29 AM
Since ss.exe returns exit code 100 for just about every error, marking the step to continue on failure and not build failure steps will have the same effect.