Automation strategy

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

Moderator: SourceGear

Post Reply
ragnar
Posts: 7
Joined: Mon Jun 11, 2012 5:13 am

Automation strategy

Post by ragnar » Mon Jul 30, 2012 5:20 am

I am building an automated process where files and folders in a specific folder structure can be updated or added. I want to use the Vault command line tool to keep all the folders and files in source control between running the process. So I need to be able to check out a folder structure (with files), make my changes and additions to both files and folders, and then commit it all to Vault, this has to be done automatically hopefully using the Vault command line tool.

I should be able to use the CHECKOUT command to checkout the whole folder structure. I can use the SETWORKINGFOLDER command to make sure that the folder structure has a working directory before calling the checkout command. What I'm not sure about, and can't seem to find any conclusive information about, is which is the best way to commit the changes back into Vault after the automatic process has finished using the command tool.

Do I have to use the ADD command to add new files and folders in the source control or is it sufficient to use either COMMIT or CHECKIN? What is the difference between COMMIT and CHECKIN? What would be the preferred way to accomplish this using the Vault command line tool?

lbauer
Posts: 9736
Joined: Tue Dec 16, 2003 1:25 pm
Location: SourceGear

Re: Automation strategy

Post by lbauer » Mon Jul 30, 2012 10:20 am

If new files appear in the working folder, they would need to be Added. Vault CLC is not aware of these new files.

Commit and Checkin are similar terms from different types of development styles. Checkin implies items have been checked out and you are checking them into the repository.

Commit does the same thing as checkin, but tends to mean items or transactions are sitting in the pending change set and need to be committed to the repository. This is particularly the case if you are using CVS mode (edit-merge-commit) rather than VSS mode (checkout -edit-checkin.)

For instance, if you had a Delete operation in the pending change set, you'd probably commit the Delete, rather than checkin the Delete, since it's not a checkout. But the end result is the same.
Linda Bauer
SourceGear
Technical Support Manager

ragnar
Posts: 7
Joined: Mon Jun 11, 2012 5:13 am

Re: Automation strategy

Post by ragnar » Thu Aug 09, 2012 9:28 am

Is there a way to get a list of files in a repository folder? I need to figure out which files to add to the repository. I know which files are in the working folder but I need to know which files are already in the repository to compile a list of files to add. Is there a CLC command to do this or something comparable?

lbauer
Posts: 9736
Joined: Tue Dec 16, 2003 1:25 pm
Location: SourceGear

Re: Automation strategy

Post by lbauer » Thu Aug 09, 2012 9:46 am

Yes. The Command Line Client has a LISTFOLDER command.
From CLC Help:


usage: vault.exe LISTFOLDER [options] repositoryfolder

LISTFOLDER will display the contents of the folder specified by
repositoryfolder, including the status of any working folders.

Server and authentication information is specified by:
-host host

Hostname of the server to connect to. Can also use "-server".
-ssl

Enables SSL for server connection.
-user username

Username to use when connecting to server.
-password password

Password to use when connecting to server.
-repository repositoryname

Repository to connect to.
This is a list of possible options:

-norecursive

Do not act recursively on folders.
Linda Bauer
SourceGear
Technical Support Manager

Post Reply