Automatic Merge and the Unknown file status

A collection of information about SourceOffSite, including solutions to common problems.

Moderator: SourceGear

Post Reply
Posts: 250
Joined: Tue Dec 30, 2003 10:13 am

Automatic Merge and the Unknown file status

Post by corey » Tue Jul 27, 2004 9:38 am

When the SOS Client cannot determine the VSS version number of a local file that is under source control, it marks the file's status as Unknown.

( For more information about file statuses in SOS and how they are determined, see the KB article: )

If you attempt a Get Latest Version operation, with Automatic Merge enabled, on a file of Unknown status, the operation will fail and SOS will report that it cannot automatically merge the file. Here's why:

SOS keeps track of the VSS version of each local file under source control, but it does not keep around a copy of that file. For instance, if you perform a Get Latest Version on the file FOO, and the latest version in the VSS database is version 3, then SOS will fetch version 3 of FOO and its status will become current (or blank in the GUI). If you then check out and edit FOO, the file will become Edited. Now suppose you have multiple checkouts enabled on your VSS database and another developer also checks out, edits, and checks in FOO. The latest version in the VSS database is now version 4, and upon your next file list refresh, its status will change to Needs Merge (you have the file edited but your original copy is no longer the latest version in the database). If you then attempt a Get Latest on FOO with Automatic Merge enabled (to merge in the remote changes with your changes), SOS will first need to fetch version 3 of the file, then version 4 of the file, in order to successfully be able to do a 3-way merge of version 3, version 4, and your modified copy of version 3. Make sense? :D

However, in a situation where the file is of status Unknown, SOS has no knowledge of what the version is of the local file, so it cannot fetch that baseline to perform a 3-way merge, and thus the Get Latest with Automatic Merge will fail. Your only options are to (1) attempt to first resolve the Unknown status using file list refresh with checksums enabled or (2) to perform the Get Latest with either Overwrite or Do Not Overwrite enabled instead of Automatic Merge.
Corey Steffen
SourceGear LLC

Post Reply