Commit and Get not working...
Posted: Wed Nov 26, 2008 1:35 pm
Hello,
I've tried and tried, using the examples and solutions to this problem in other topics, but cannot get the API to check in a modified file. This is what I am currently trying which is almost directly from an example on finding files, checking them out, modifying them, and checking them back in: http://weblogs.asp.net/jeremy_sheeley/a ... 97021.aspx
Here is what I'm doing in C#:
Previously, I did not do the Get(...) because I didn't know I needed to and would end up with the commit failing and the files in question remaining checked out with an edited status. Now, however the Get(...) throws a GetLatestVersionFailedException. It doesn't tell me why this fails, and I have no insights myself. I am sure I'm connected and logged into vault because I can check file shared paths, find files, get the repository tree and refresh it, etc... I am also pretty sure that a working folder is set because in calling vaultClientInstance.Init(), I give it a working folder. Additionally, I tried setting a working folder specific to the file I want to check in every time I try a Get(...) but to no avail.
I have also tried to specifically create a ChangeSetItemColl object and put into it ChangeSetItem_Modified objects and then call the Commit() method on this:
Doing this for a ChangeSetItem_AddFile works just fine but when trying to check something back in, I'm always left with a failed commit and the files being left checked out. Any ideas as to why this is happening and how I can get a checkin/commit to work?
I'm using :
Vault client version 4.1.3.18336
Vault server version 4.1.3.18336
Thanks in advance.
-Nick
I've tried and tried, using the examples and solutions to this problem in other topics, but cannot get the API to check in a modified file. This is what I am currently trying which is almost directly from an example on finding files, checking them out, modifying them, and checking them back in: http://weblogs.asp.net/jeremy_sheeley/a ... 97021.aspx
Here is what I'm doing in C#:
Code: Select all
vaultClientInstance.CheckOut(vclientfile, VaultCheckOutType.Exclusive,"no comment");
vaultClientInstance.Get(vclientfile, true, MakeWritableType.MakeAllFilesWritable, SetFileTimeType.Current, MergeType.OverwriteWorkingCopy, null);
// Modify the file
vaultClientInstance.Commit();
I have also tried to specifically create a ChangeSetItemColl object and put into it ChangeSetItem_Modified objects and then call the Commit() method on this:
Code: Select all
myCheckinChangeSetCollection.Add(new ChangeSetItem_Modified(new VaultDateTime(DateTime.Now.Ticks),
"Automatically checked in",
"",
vclientFile.ID,
vclientFile.ObjVerID,
workingFolderPath,
vclientFile.FullName,
true,
(int)VaultEOL.None));
vaultClientInstance.Commit(myCheckinChangeSetCollection, false, false);
I'm using :
Vault client version 4.1.3.18336
Vault server version 4.1.3.18336
Thanks in advance.
-Nick