Contributing bug fixes to the Vault NANT tasks

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

Moderator: SourceGear

Post Reply
miked30

Contributing bug fixes to the Vault NANT tasks

Post by miked30 » Tue May 17, 2005 5:04 am

I have been using the Vault NANT tasks over the last few days. The check out task repeatedly failed when the user didn't have a working folder assigned.

After getting the source code I discovered that this was because the check out was also performing a get of the files. See code below.

I don't think that the check out should automatically do a get. Really that behaviour should be controlled by an attribute.

I would be happy to fix the problem and make any required changes but it is not obvious how to contribute to this project.

Could you give me details please?

Thanks.

Mike

Code: Select all

private void CheckOut( string fileName )
{
	string normalizedPath = RepositoryPath.NormalizeFolder( fileName );

	if( IsVaultFolder( normalizedPath ) == true )
	{
		VaultClientFolder vaultClientFolder = ClientInstance.TreeCache.Repository.Root.FindFolderRecursive( normalizedPath );
		ClientInstance.CheckOut( vaultClientFolder, true, VaultCheckOutType.CheckOut, comment );
		ClientInstance.Get( vaultClientFolder, true, true, MakeWritableType.MakeAllFilesWritable, SetFileTimeType.Current, MergeType.OverwriteWorkingCopy, null );
		VaultLog( vaultClientFolder.Name + " successfully checked out." );
	}

	if( IsVaultFile( normalizedPath ) == true )
	{
		VaultClientFile vaultClientFile = ClientInstance.TreeCache.Repository.Root.FindFileRecursive( normalizedPath );
		ClientInstance.CheckOut( vaultClientFile, VaultCheckOutType.CheckOut, comment );
		ClientInstance.Get( vaultClientFile, true, MakeWritableType.MakeAllFilesWritable, SetFileTimeType.Current, MergeType.OverwriteWorkingCopy, null );
		VaultLog( vaultClientFile.Name + " successfully checked out." );
	}

	if( IsVaultFolder( normalizedPath ) == false && IsVaultFile( normalizedPath ) == false ) 
	{
		throw new BuildException( "File or folder " + normalizedPath + " not found for checkout.", Location );
	}
}

jeremy_sg
Posts: 1821
Joined: Thu Dec 18, 2003 11:39 am
Location: Sourcegear
Contact:

Post by jeremy_sg » Tue May 24, 2005 9:40 am

I agree with you that it's not obvious that Checkout would also do a get of the file, however, the standard behvior of the GUI client and the IDE client are to get the file when checking it out. The nant tasks are the only ones capable of checking in a file from a non-working folder. It's confusing, but hopefully, the things will get clearer as we work to make the CLC and nant tasks more intuitive.

Post Reply