- A file exists in the repository, and at some point, is fetched using get latest to a client machine.
- Someone deletes the file in the repository
- Later on, a get latest is done, but the file that was deleted in the repository still exists on the client machine.
- This causes a project to continue to build correctly, when it should report an error because the file shouldn't exist anymore.
remove stale files
Moderator: SourceGear
remove stale files
Here's a pretty common scenario:
You should be able to configure this in the GUI Client under Tools->Options->Local Files->Perform Repository Deletions locally. "Remove Working Copy" should delete the file from you working directory on the next Get latest on the folder.
I think this works in the GUI Client, but not in Visual Studio.
I think this works in the GUI Client, but not in Visual Studio.
Linda Bauer
SourceGear
Technical Support Manager
SourceGear
Technical Support Manager
Thanks, that seems to work from the GUI, but not from the command line.
Is this because I unset the working folder from my batch file? Should I configure the GUI to store the working folder data inside the working folders? Something else?
Code: Select all
:: Pull the files from vault
echo Logging into vault...
vault rememberlogin -user %USER% -password %PASS% -host %HOST% -repository %REPOS%
echo Setting working folder in project %PROJ% to directory \%RESTOFPATH%...
vault setworkingfolder %PROJ% \%RESTOFPATH%
echo Getting files...
vault get -out \%RESTOFPATH%\vaultout.txt -verbose %PROJ%
vault unsetworkingfolder %PROJ%
echo Logging off...
vault forgetlogin
We just upgraded to version 3.1.5.3546 and the CLC still does not remove the stale files when doing a 'GetLatest'. Is there something I need to do (complete re-get, etc.)?
I upgraded the client side software, and then immediately logged in and performed the get, but it still did not remove files that were deleted from the repository.[/quote]
I upgraded the client side software, and then immediately logged in and performed the get, but it still did not remove files that were deleted from the repository.[/quote]
Sure thing:lbauer wrote:Are you doing a get to a working folder or to a non-working folder, using -destpath?
Could you post your command (taking out any actual connection info)?
Code: Select all
vault rememberlogin -user %USER% -password %PASS% -host %HOST% -repository %REPOS% -out %TEMPDIR%\vaultout.txt
vault setworkingfolder %PROJ% %RESTOFPATH% -out %TEMPDIR%\vaultout.txt
vault get -makereadonly -performdeletions removeworkingcopyifunmodified -setfiletime modification -out %RESTOFPATH%\vaultout.txt -verbose %PROJ%
vault unsetworkingfolder %PROJ%
vault forgetlogin
This thread referes to "stale" files. Are you trying to delete files in the working directory that have been deleted in the database?
I ran just a "Get" command with the CLC and files that had been deleted from the database were deleted in the working folder.
There may be a problem with your command. For instance, setting and unsetting the working folder in the same command may prevent Vault from determining the state of the working folder.
I ran just a "Get" command with the CLC and files that had been deleted from the database were deleted in the working folder.
There may be a problem with your command. For instance, setting and unsetting the working folder in the same command may prevent Vault from determining the state of the working folder.
Linda Bauer
SourceGear
Technical Support Manager
SourceGear
Technical Support Manager
It's not really the same command, since I call the vault.exe 5 separate times in the batch file, but I'll try to remove the unsetworkingfolder command and see what happens.
[EDIT]
I tried that, and it still didn't remove the file from the working folder that was deleted in the repository.
Your comment about not determining the state of the working folder seems strange to me, since it has no problem determining what files it has to get (only gets updated files). So I don't understand the difference between determining new files versus old files?
[/EDIT]
[EDIT]
I tried that, and it still didn't remove the file from the working folder that was deleted in the repository.
Your comment about not determining the state of the working folder seems strange to me, since it has no problem determining what files it has to get (only gets updated files). So I don't understand the difference between determining new files versus old files?
[/EDIT]
I believe that the "performrepositorydeletions" switch only works if the files had been previously retrieved to a working folder. Otherwise, Vault doesn't know whether they are modified or not - they are just files in the same folder that don't match any file in the current repository folder.
So, I think this would work:
1. Set the working folder
2. Do a Get Latest
3. Have someone else delete one of the files
4. Do another get latest. The deleted file in the repository should now be removed in the local folder.
It looks like you are setting the working folder, and then wanting the Get to delete a file because it doesn't exist in the Vault folder. However, Vault doesn't know that the file used to exist unless the working folder is set up before the file was deleted.
Hope this makes sense,
So, I think this would work:
1. Set the working folder
2. Do a Get Latest
3. Have someone else delete one of the files
4. Do another get latest. The deleted file in the repository should now be removed in the local folder.
It looks like you are setting the working folder, and then wanting the Get to delete a file because it doesn't exist in the Vault folder. However, Vault doesn't know that the file used to exist unless the working folder is set up before the file was deleted.
Hope this makes sense,