GUI says item is modified, but API says it's unmodified

This forum is now locked, since Gold Support is no longer offered.

Moderator: SourceGear

Locked
Tilman
Posts: 52
Joined: Thu Mar 08, 2007 3:49 am

GUI says item is modified, but API says it's unmodified

Post by Tilman » Thu Nov 15, 2007 5:36 am

Hi,

I'm using the API (3.5.2) to check stuff into Vault. I'm trying to use ChangesSetItem.Type to determine which items are Unmodified, so I can undo their check outs, rather than checking them in. The problem I'm having is, all items seem to have ChangeSetItemType.Unmodified, no matter whether they are modified, or not.

Here is what I'm doing

Code: Select all

            m_VaultClient.Get(versionFolder, true, true, MakeWritableType.MakeAllFilesWritable, 
                SetFileTimeType.CheckIn, MergeType.OverwriteWorkingCopy, null);
            m_VaultClient.CheckOut(versionFolder, true, VaultCheckOutType.Exclusive, "Build automation");

            copyFilesBack();

            m_VaultClient.Refresh();

            foreach (ChangeSetItem csi in m_VaultClient.InternalChangeSet_GetItems(false))
            {
                if (csi.DisplayRepositoryPath.StartsWith(versionFolder.FullPath)
                    && csi.Type != ChangeSetItemType.Unmodified)
                {
                    csi.Comment = "Build automation";

                    updateFileChangeSets.Add(csi);
                }
            }
copyFilesBack() replaces the checked out files in the working folder with modified files. In theory, Vault should detect this modification (after the Refresh at the latest), and it does in the GUI, however, the API seems to always say csi.Type == ChangeSetItemType.Unmodified.

Is there anything I'm doing wrong?

Cheers,

Tilman

jclausius
Posts: 3655
Joined: Tue Dec 16, 2003 1:17 pm
Location: SourceGear
Contact:

Post by jclausius » Thu Nov 15, 2007 8:26 am

If you can, try to get the working folder object for the change set's item path. Next, query that object for the file's working folder status (GetStatus()).
Jeff Clausius
SourceGear

Tilman
Posts: 52
Joined: Thu Mar 08, 2007 3:49 am

Post by Tilman » Thu Nov 15, 2007 10:09 am

Thanks.

Locked