How to use command line client

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

Moderator: SourceGear

Post Reply
michaelbao
Posts: 5
Joined: Thu Mar 09, 2006 12:34 pm

How to use command line client

Post by michaelbao » Fri Mar 17, 2006 4:04 pm

I used command line client to compare 2 file, one is in vault, the other is in working directory. After I ran it, I got following success information. I am sure they are different, the "<result success="yes" />" doesn't make any sense to me.

vault DIFF -server servername -user username -password ***** -repository PROJ $/common/PROJ/live/2.0/Utility.cs -compareto local C:\Website\common\PROJ\live\2.0\Utility.cs
<vault>
<result success="yes" />
</vault>

1. Does anyone have good documents or good examples about how to run client command? Since original document is not helpful.

2. Could anyone explain the result to me? Or maybe I did some thing wrong in my command?

Any help will be appreciated!

Michael

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

Post by lbauer » Fri Mar 17, 2006 4:44 pm

You need to specify the path to the diff tool, for one thing.

For documentation, type vault help diff from a command prompt from the Vault GUI Client directory. Or type vault helphtml for an HTML version.

Here's the Diff Help:
usage: vault.exe DIFF [options] repositorypath

Diff will compare a working file or folder with another file or folder
specified by the -compareto option. The working file or folder is specified
by its repository path.

Server and authentication information is specified by:
-host host

Hostname of the vault 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:

-compareto [current|label|lastget|local|repository] [compareto_object]


Type of comparison to be made against your local working version. For
'label', 'local', and 'repository', specify the compareto_object, which
is a label name, local path or repository path.

current - the current repository item
label - the version found within the given label
lastget - the last version retrieved from the repository
local - any local file system item
repository- any item within the repository
-norecursive

Do not act recursively on folders
-vaultdiff [absolute path to comparison utility]

Use this comparison utility for differences.
-vaultdiff_options "[any options]"

Options for the comparison utility.
Use double quotes for multiple options.
Linda Bauer
SourceGear
Technical Support Manager

michaelbao
Posts: 5
Joined: Thu Mar 09, 2006 12:34 pm

Could you give an example?

Post by michaelbao » Fri Mar 17, 2006 5:01 pm

Thanks for your reply. Could you give an example of how to do it? I already read all help documents as what you said, but I am still confused about it. Could you correct my command?

If you have some examples for other commands, please post it here too.

Thanks lots.

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

Post by lbauer » Mon Mar 20, 2006 4:00 pm

To compare the working folder version to the current version in the repository, use this command:

vault DIFF -server servername -user username -password ***** -repository PROJ $/common/PROJ/live/2.0/Utility.cs -compareto current -vaultdiff "C:\Program Files\SourceGear\Vault Client\sgdm.exe"

Note:

The diff -compareto option compares the file in the working folder to:

current -- the current version of the file in the repository
local -- another file on the local machine
label -- a labeled version of the file
lastget - the last version retrieved from the repository
repository -- any other file in the repository
Linda Bauer
SourceGear
Technical Support Manager

montek
Posts: 107
Joined: Mon Jan 05, 2004 8:46 am

Post by montek » Wed Aug 02, 2006 8:38 am

Is there any way to issue command-line requests to Vault to compare specific versions of files contained within the repository? I see from your example that I can do this to compare my current local version to the latest version in the repository, but what if I want to compare file.cs v2 to file.cs v4? Can I get this to work somehow?

This would be very handy when doing a code review, so I could create a script to open up several comparison windows at once, each one comparing the specific changes from version x to version y.

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

Post by lbauer » Thu Aug 03, 2006 3:14 pm

The command line client doesn't do a diff from history. I can log this as a feature request, though.
Linda Bauer
SourceGear
Technical Support Manager

Post Reply