Examples

The following assumptions are made in these examples:

Example 1: Add a project to the database
Example 2: Add a file to project
Example 3: Get a file
Example 4: Get file list
Example 5: Check in a file
Example 6: Check out a file
Example 7: Label a project
Example 8: Retrieve all files in a project tree by a label
Example 9: Share a project with another project
Example 10: Branch a shared file
Example 11: Delete a project permanently
Example 12: Put the Command Line Client in an interactive shell
Example 13: Add a file to project in an interactive shell

Example 1: Add a project to the database
----------------------------------------
This adds an entire project located at "c:\projects\new" on the local machine to the project "$/123" in the VSS database.

SAWVcmd AddFolder -server 127.0.0.1 -port 8787 -username test -pwd test -alias vss  -workdir c:\projects\new  -prj $/123/new -tempdir D:\temp

Example 2: Add a file to project
----------------------------------------
This adds a file "test.txt" to "$/123" project.

SAWVcmd AddFile -server 127.0.0.1 -port 8787 -username test -pwd test -alias vss -workdir "c:\projects\test" -file "test.txt" -prj $/123  -tempdir "D:\temp"

Example 3: Get a file
---------------------
This places the latest version of the file "test.txt" into the working folder.

SAWVcmd GetFile -server 127.0.0.1 -port 8787 -username test -pwd test -alias vss -workdir c:\projects\test -prj $/123 -file text.txt  -tempdir D:\temp

Example 4: Get file list
------------------------------
This gets the list of files in the "$/123" project.

SAWVcmd GetFileList -server 127.0.0.1 -port 8787 -username test -pwd test -alias vss -prj $/123 -tempdir D:\temp

Example 5: Check in a file
---------------------------
This checks in the previously checked out file "test.txt", located on the working folder at "c:\projects\test".

SAWVcmd CheckInFile -server 127.0.0.1 -port 8787 -username test -pwd test -alias vss -workdir c:\projects\test -prj $/123 -file test.txt -tempdir D:\temp  -comment "Added function HelloWorld"

Example 6: Check out a file
---------------------------
This checks out the latest version of the file "test.txt" and places it into the working folder.

SAWVcmd CheckOutFile -server 127.0.0.1 -port 8787 -username test -pwd test -alias vss -workdir c:\projects\test -prj $/123 -file test.txt -tempdir D:\temp

Example 7: Label a project
--------------------------
This applies the label "Version 3" to project "$/123" in the VSS database.

SAWVcmd AddLabel -server 127.0.0.1 -port 8787 -username test -pwd test -alias vss -prj $/123 -label "Version 3" 

Example 8: Retrieve all files in a project tree by a label
----------------------------------------------------------
This gets a previous version of a project from a label. It retrieves all of the files in the project associated with that label, placing them in the directory specified by -workdir. It will create directories as needed.

SAWVcmd GetProject -server 127.0.0.1 -port 8787 -username test -pwd test -alias vss -workdir c:\projects\test -prj $/123 -label "version 1" -tempdir D:\temp

Example 9: Share a project with another project
-----------------------------------------------
This shares the current version of the project "$/123" with the project "$/projects/saw" in the VSS database.

SAWVcmd ShareProject -server 127.0.0.1 -port 8787 -username test -pwd test -alias vss -prj $/123 -shareto $/projects/saw -comment "Sharing project 123 into project saw"

Example 10: Branch a shared file

----------------------------------
This branches files "test.txt" which was previously shared with another files in the VSS database.

SAWVcmd BranchFile -server 127.0.0.1 -port 8787 -username test -pwd test -alias vss -prj $/123 -file test.txt

Example 11: Delete a project permanently
----------------------------------------
This deletes project "$/123" permanently from the VSS database.

SAWVcmd Delete -server 127.0.0.1 -port 8787 -username test -pwd test -alias vss -prj $/123 -permanent

Example 12: Put the Command Line Client in an interactive shell

----------------------------------------

This puts the Command Line Client in an interactive shell.

SAWVcmd Interactive -server 127.0.0.1 -port 8787 -username test -pwd test -alias vss -tempdir D:\temp

Example 13: Add a file to project in an interactive shell
----------------------------------------

This adds a file to project in an interactive shell.

AddFile -file "test.txt" -prj $/123

Note:

These examples are for the Windows Command Line. For Java Command Line, the commands should begin with "java -jar SAWVcmd.jar" instead of "SAWVcmd" in these examples.