How do you capture information from the command-line client (vault.exe) on which local files that have been updated from repository at a ‘get’ command? How do you capture information on which local files that were not updated due to they were writeable?
Our objective is to warn the user in case any local file is writeable but not checked out.
We are migrating from VSS to Vault 3.0. We have been using a batch file to access the VSS repository from the command-line client (ss). The main purpose of this batch file is to retrieve latest files from repository, unless local files are checked out or writeable. The batch file is part of a set of scripts that provides means for each developer to update working folders and rebuild source code every night. We are now trying to convert the batch file to access a Vault repository.
A. VSS example:
Set working folder and current project. Retrieve read-only copies of all the files in the current project, and all its subprojects. Redirect all command output to ‘log.txt’.
Code: Select all
ss workfold $/Bin c:\bin -olog.txt
ss cp $/Bin -olog.txt
ss get * -r -olog.txt
if errorlevel 1 echo WARNING: Some files were not retrieved from VSS.
Code: Select all
$/Bin
file1.c
Replacing local copy of file2.c
A writable copy of file3.c already exists
b) Replacing local copy of file2.c - Local file needs to be updated.
c) A writable copy of file3.c already exists - Local file is writable, but not checked out.
In case a local file was not updated from repository, this can be captured with ‘if errorlevel 1’ to provide means of warning the user that some files were not retrieved. Redirection of output to a file gives a simple but powerful way of listing which files that were retrieved and which files were not.
B. Vault example:
Code: Select all
set cmGetOptions=-makereadonly -merge later -setfiletime checkin
set cmRepositoryFolder=$/Bin/
set cmLocalFolder=c:\bin
vault setworkingfolder %cmRepositoryFolder% %cmLocalFolder%
vault get %cmRepositoryFolder% %cmGetOptions%
vault unsetworkingfolder %cmRepositoryFolder%
Code: Select all
<vault>
<listworkingfolders>
<workingfolder reposfolder="$/Bin" localfolder="c:\bin" />
</listworkingfolders>
<result success="yes" />
</vault>
<vault>
<result success="yes" />
</vault>
<vault>
<listworkingfolders />
<result success="yes" />
</vault>
/Niklas