Command line client throws WorkingFolderConflictException

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

Moderator: SourceGear

Locked
PACEGMBH
Posts: 54
Joined: Tue Jun 28, 2005 7:18 am
Location: GERMANY

Command line client throws WorkingFolderConflictException

Post by PACEGMBH » Wed Mar 05, 2008 10:19 am

Using Vault 4.1 the command line client throws a VaultClientOperationsLib.WorkingFolderConflictException after retrieving two files one after each other using the get command with temporary working folders:
get -workingfolder "F:/Vault_4.1/EWB_3.1" "$/Products/EngineeringWorkbench/trunk/EWBFramework.sln"
get -workingfolder "F:/Vault_4.1/EWB_3.1" "$/Products/EngineeringWorkbench/trunk/EWBFramework.vssscc"
In the sources of the command line client I saw that there is a bug in the current implementation of restoreWorkingFolderIfNecessary(), which does not properly reset the temporary working folder for the file case. Here comes the fixed version of the method:

Code: Select all

		public void restoreWorkingFolderIfNecessary(bool resetWorkingFolder, string repositoryPath, string originalWorkingFolderPath)
		{
			// Reset the original working folder, if we changed it.
			if ( resetWorkingFolder && repositoryPath != null)
			{
				if (originalWorkingFolderPath == null)
				{
					// Pace Start
					// Bug fix for removal of working folder for files instead of folders
					VaultClientTreeObject workingFolderTreeObject = RepositoryUtil.FindVaultTreeObjectAtReposOrLocalPath(repositoryPath);
					if (workingFolderTreeObject is VaultClientFile)
					{
						workingFolderTreeObject = workingFolderTreeObject.Parent;
						repositoryPath = workingFolderTreeObject.FullPath;
					}
					// Pace End
					ServerOperations.client.ClientInstance.TreeCache.RemoveWorkingFolder(repositoryPath);
				}
				else
					ServerOperations.client.ClientInstance.TreeCache.SetWorkingFolder(repositoryPath, originalWorkingFolderPath);
			}
		}
Please let me know in which maintenance release you will fix this problem.

Frank

Beth
Posts: 8550
Joined: Wed Jun 21, 2006 8:24 pm
Location: SourceGear
Contact:

Post by Beth » Wed Mar 05, 2008 1:41 pm

On the first part, I can definitely tell you that you can't set one working folder to multiple repository paths. If your working folder was already set to the parent of those two files, then don't use the -workingfolder switch.

You can use the setworkingfolder command to set it for the parent folder and then just perform Gets without specifying the working folder again. Another option would be to use the -nonworkingfolder switch to just perform a Get to any location you specify.

On the second portion, are you receiving an error, or what behavior do you get?

PACEGMBH
Posts: 54
Joined: Tue Jun 28, 2005 7:18 am
Location: GERMANY

Post by PACEGMBH » Thu Mar 06, 2008 5:15 am

Beth,

get -workingfolder

sets temporarily a working folder.

Please compare your CLC documentation:
-workingfolder [disk_path]

Retrieve files to working folder specified by disk_path. The working
folder specified is temporary, used only for this get request. This
option cannot be specified with -nonworkingfolder and only one repositorypath
can be specified.
Of course I should not have a working folder set previously. This is not the case for the given commands.

The problem arises because the CLC's restoreWorkingFolderIfNecessary() method has a bug when resetting the temp. working folder for files (it works fine for folders). Please use the given test case to verify the problem. My posted fix solves this problem.

Please let me know in which maintenance release the described problem will be fixed.

Frank

PACEGMBH
Posts: 54
Joined: Tue Jun 28, 2005 7:18 am
Location: GERMANY

Post by PACEGMBH » Fri Mar 07, 2008 9:02 am

Any news on teh issue? Could you reproduce the problem or do you need a sample file?

Frank

shannon

Post by shannon » Fri Mar 07, 2008 10:31 am

Frank,

Can you go ahead and send me a sample file to shannon_at_sourcegear_dot_com and I will look into this?

Thanks,
Shannon

Locked