soscmd v.3.5.3 gets deleted files when getting label

If you are having a problem using SourceOffSite, post a message here.

Moderator: SourceGear

Post Reply
Guest

soscmd v.3.5.3 gets deleted files when getting label

Post by Guest » Mon Oct 25, 2004 11:44 am

I am currently attempting to implement a build script that labels a project within SOS and then retrieves that label. When I retrieve that label using soscmd I also get files that have been deleted (although not "destroyed"). This unfortunately causes build errors to be generated during the build. Are there any additional parameters to control this behavior? The commands I am using are included below.

ECHO Adding label "%LBL%"

REM CREATE LABEL
soscmd -command AddLabel -server %SRV% -name %USR% -password %PWD% -database "C:\VSS\srcsafe.ini" -project %PRJ% -label %LBL%

ECHO Getting "%LBL%"

REM GET LABEL
soscmd -command GetProject -server %SRV% -name %USR% -password %PWD% -database "C:\VSS\srcsafe.ini" -project %PRJ% -label %LBL% -recursive

Thank you,

Guest

lbauer
Posts: 9736
Joined: Tue Dec 16, 2003 1:25 pm
Location: SourceGear

Post by lbauer » Wed Oct 27, 2004 8:25 am

This is a known issue in SOS 3.5.x. This is actually how SOS was designed to work.

It has been fixed in SOS 4.0.x because we get the label in a different way.

In SOS 3.5.x, If you delete a file from a project labeled Version_1 without destroying it),then you re-label that project Version_2 after the file is deleted, when you perform a get latest from the Version_2 label, the deleted file will re-appear. Similarly, if you delete (but not destroy) a file prior to any label being applied and then label the project, the deleted file will appear when performing a "get by label".

The SOS 3.5.3 server communicates with the database via the VSS automation component. The Automation Component restricts what SOS can do in situations like this. If a file is labeled and deleted (not purged), VSS sets a "this labeled file has been deleted" flag. It does this even if the file is deleted at the time the label is applied. Using the Automation Component, SOS can either always get labeled files that are deleted, or never get labeled files that are deleted.

As you can probably see, there are disadvantages to whichever option that we use to retrieve labeled files. We decided that it is a bigger disadvantage to never get the deleted files since this could interfere with the build process if a build expects the file to be there and it is not.

In previous versions of SourceOffSite, the Get by Label operation would
not retrieve deleted projects or files. This could result in a Get by Label
operation not returning all files and projects associated with that label.
This was clearly not the expected nor desired behavior.

In version 3.0, Get By Label was changed to get all files associated with
the label, regardless of whether they were deleted.

Now, in SourceOffSite 3.5.3, special care is taken to get each file
appropriately, whether its project exists or not. Unfortunately, the
SourceSafe automation layer applies labels across the board to files, even
when they have already been deleted. This means that a Get by Label
operation will retrieve deleted files and projects, some of which may have
actually been deleted before the label in question was applied. This may
result in the Client retrieving more files than expected.

To avoid unwanted files and projects from being retrieved by
SourceOffSite when performing a Get by Label operation, the
SourceSafe database could be altered in one of the following two ways:

* Purge the deleted files.
* If you wish to keep a copy of the files around, archive the files.

Once the deleted files are archived or purged, the Get By Label operation
in SourceOffSite will not return deleted files. Get By Label will only return
deleted files which have not been archived or purged.
Linda Bauer
SourceGear
Technical Support Manager

Post Reply