RE: Commit file problem

"James Geurts" <[email protected]> Wed, 3 Mar 2004 12:15:10 -0500
Newsgroups gmane.comp.version-control.sourcegear-vault.user
Message-ID <[email protected]>
Maybe to help with this issue:

ClientInstance.InternalChangeSet_GetItems(false) returns a type
ChangeSetItem_CheckedOutMissing for the myfile.cs item.  This is to be
expected since I did not do a Get for that file.

Is there a way to convert ChangeSetItem_CheckedOutMissing to
ChangeSetItem_Modified other than the way that I'm currently using?

Thanks

Jim

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of James Geurts
Sent: Tuesday, March 02, 2004 3:19 PM
To: [email protected]
Subject: [vault-list] Commit file problem

Hey all,

I'm using a modified version of Brian's NAnt tasks to try to accomplish some
things with my project.  I've run into a problem though...  I'm trying to
commit a file to Vault, but I keep getting errors.  Unfortunately the errors
that I'm getting are just not helpful to me right now.

So, I'm basically just trying to check in a modified file.  I am using Vault
2.0 client/server assemblies.  The file has previously been checked out, but
I can not guarantee that a Get was performed.  Is a Get required before a
check-in?

The file exists (I have verified this) but the following code fails on the
commit method.


normalizedPath = "$/myRepo/myfile.cs";
diskFile = " C:\WINNT\TEMP\tmp3672.tmp\myfile.cs";


VaultClientFile vaultClientFile =
ClientInstance.TreeCache.Repository.Root.FindFileRecursive(normalizedPath);

ChangeSetItemColl changeSet = new ChangeSetItemColl();
changeSet.Add( new ChangeSetItem_Modified( DateTime.Now, pComment, "",
vaultClientFile.ID, vaultClientFile.ObjVerID, diskFilename, normalizedPath,
false, 0 ) );

ClientInstance.Commit(changeSet)


The error message that I get is:

System.NullReferenceException: Object reference not set to an instance of an
object.
   at VaultClientOperationsLib.ClientInstance.Commit(ChangeSetItemColl
givenItems, Boolean keepCheckedOut, Boolean removeLocalCopy, Boolean
bIsImport, DateTime dateImport, Int32 nUserIDImport)
   at VaultClientOperationsLib.ClientInstance.Commit(ChangeSetItemColl
givenItems, Boolean keepCheckedOut, Boolean removeLocalCopy)
   at VaultClientOperationsLib.ClientInstance.Commit(ChangeSetItemColl
changeSetItems)
   at NAnt.Core.Tasks.VaultCheckIn.CheckInFile(String fileName)


Any help/pointers with this would be appreciated.

Thanks

Jim

_______________________________________________
vault-list mailing list
[email protected]
http://lists.sourcegear.com/cgi-bin/mailman/listinfo/vault-list