Command line tool

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

Moderator: SourceGear

Post Reply
Chris Leslie
Posts: 10
Joined: Tue Mar 09, 2004 5:38 pm
Location: Canada

Command line tool

Post by Chris Leslie » Wed Mar 10, 2004 10:57 am

"C:\Program Files\SourceGear\Vault Client\vault.exe" -host server:81 -user chris -password chris listrepositories
<vault>
<error>
The connection to the server failed: server cannot be contacted or uses a protocol that is not supported by this client. Invalid URI: The hostname could not be parsed.
</error>
<exception>
System.Exception: The connection to the server failed: server cannot be contacted or uses a protocol that is not supported by this client. Invalid URI: The hostname could not be parsed.
at VaultCmdLineClient.VaultCmdLineClient.Login(Boolean bAllowAuto, Boolean bSaveSession)
at VaultCmdLineClient.VaultCmdLineClient.ProcessCommandListRepositories()
at VaultCmdLineClient.VaultCmdLineClient.ProcessCommand(Args curArg)
at VaultCmdLineClient.VaultCmdLineClient.Main(String[] args)
</exception>
<result success="no" />
</vault>


Does the Command line tool (2.0.1) only work on port 80?

Chris

dan
Posts: 2448
Joined: Wed Dec 17, 2003 5:03 pm
Location: SourceGear
Contact:

Post by dan » Wed Mar 10, 2004 11:48 am

Apparently so. :oops:

This should be a simple fix that we'll include in a 2.0.2. Email me and I can get you temporary CLC before then if you need it.

Chris Leslie
Posts: 10
Joined: Tue Mar 09, 2004 5:38 pm
Location: Canada

Command Line - Commit

Post by Chris Leslie » Fri Mar 12, 2004 3:21 pm

Vault 2.0.1
Is it possible to do a recursive Commit, I keep getting this error

"C:\Program Files\SourceGear\Vault Client\vault.exe" -host cpdev03 -user chris -password chris -repository "Default Repository" commit $/test -comment "Changes from 'C:\Program Files\VisBuildPro\Samples\Vault\VaultTest.bld' build on 3/12/2004 3:59:32 PM"
<vault>
<changeset>
<DeleteFolder id="0" repospath="$/test" />
</changeset>
<!-- Preparing data to begin transaction -->
<!-- Beginning transaction -->
<!-- Item $/test caused the transaction to fail: The object could not be modified because it or one of its children is checked out. -->
<!-- Transaction failed -->
<result success="no" />
</vault>


However when I specify a file to commit it works.

"C:\Program Files\SourceGear\Vault Client\vault.exe" -host cpdev03 -user chris -password chris -repository "Default Repository" commit $/test/VaultTest/test.txt -comment "Changes from 'C:\Program Files\VisBuildPro\Samples\Vault\VaultTest.bld' build on 3/12/2004 4:04:30 PM"
<vault>
<changeset>
<ModifyFile id="0" repospath="$/test/VaultTest/test.txt" localpath="c:\Vault\VaultTest\test.txt" />
</changeset>
<!-- Preparing data to begin transaction -->
<!-- Beginning transaction -->
<!-- Check in $/test/VaultTest/test.txt -->
<!-- Ending the transaction -->
<!-- Transaction completed successfully -->
<result success="yes" />
</vault>

PS Is there a document that outlines the Commandline options and examples?


Thanks
Chris

If I do a listchangeset, this is what I get.

"C:\Program Files\SourceGear\Vault Client\vault.exe" -host cpdev03 -user chris -password chris -repository "Default Repository" listchangeset
<vault>
<changeset>
<DeleteFolder id="0" repospath="$/test" />
<AddFolder id="1" reposfolder="$/test/VaultTest" localfolder="c:\Vault\VaultTest" />
<DeleteFolder id="2" repospath="$/test" />
<DeleteFolder id="3" repospath="$/test" />
<CreateFolder id="4" repospath="$/test" />
<ModifyFile id="5" repospath="$/test/VaultTest/test.txt" localpath="c:\Vault\VaultTest\test.txt" />
</changeset>
<result success="yes" />
</vault>

Chris Leslie
Posts: 10
Joined: Tue Mar 09, 2004 5:38 pm
Location: Canada

Re: Command Line - Checkout

Post by Chris Leslie » Fri Mar 12, 2004 4:43 pm

Is is also possible to do a recursive checkout?
I.e. I want to check out all the DLL files in a folder hierarchy.


"C:\Program Files\SourceGear\Vault Client\vault.exe" -host cpdev03 -user chris -password chris -repository "Default Repository" checkout $/test/VaultTest/*.txt
<vault>
<error>
$/test/VaultTest/*.txt does not exist.
</error>
<exception>
System.Exception: $/test/VaultTest/*.txt does not exist.
at VaultCmdLineClient.VaultCmdLineClient.ProcessCommandCheckout(ArrayList strItemArray)
at VaultCmdLineClient.VaultCmdLineClient.ProcessCommand(Args curArg)
at VaultCmdLineClient.VaultCmdLineClient.Main(String[] args)
</exception>
<result success="no" />
</vault>
ChrisL

dan
Posts: 2448
Joined: Wed Dec 17, 2003 5:03 pm
Location: SourceGear
Contact:

Post by dan » Fri Mar 12, 2004 5:04 pm

Commit doesn't currently allow recursive checkin from a particular folder, but it does allow you to checkin the entire change set (just don't specify any repository folders, and it will checkin the whole change set. Recursive checkin from a folder is something we'll need to add.

Also, there isn't currenly a way to recursivley checkout items either - this has also been requested, and been in a future release.

The specific problem you were having above though is that you were trying to delete a folder that had files checked out within in it. Vault doesn't allow this - you need to undo all checkouts before deleting a folder. (You can find all the checked out files in the status search pane).

Chris Leslie
Posts: 10
Joined: Tue Mar 09, 2004 5:38 pm
Location: Canada

Post by Chris Leslie » Fri Mar 12, 2004 9:50 pm

Actually I was not trying to delete the folder ;-), Yes the folder gets deleted in the script but it does not fail at that point.

Remember it works if I specify the actual filename, it is just the wildcard it does not understand, and fails on.

I will post again on Monday with the exact sequence of events.
PS It is a sample script that ships with VisualBuild, that does not work.
dan wrote: The specific problem you were having above though is that you were trying to delete a folder that had files checked out within in it.
ChrisL

Chris Leslie
Posts: 10
Joined: Tue Mar 09, 2004 5:38 pm
Location: Canada

Post by Chris Leslie » Mon Mar 15, 2004 8:38 am

dan wrote:just don't specify any repository folders, and it will checkin the whole change set. Recursive checkin from a folder is something we'll need to add.

I tried that and I get the same error?
Unless I need to exclude the repository as well?

"C:\Program Files\SourceGear\Vault Client\vault.exe" -host cpdev03 -user chris -password chris -repository "Default Repository" commit -comment "Changes from 'C:\Program Files\VisBuildPro\Samples\Vault\VaultTest.bld' build on 3/15/2004 9:35:30 AM"

<vault>
<changeset>
<DeleteFolder id="0" repospath="$/test" />
<AddFolder id="1" reposfolder="$/test/VaultTest" localfolder="c:\Vault\VaultTest" />
<DeleteFolder id="2" repospath="$/test" />
<DeleteFolder id="3" repospath="$/test" />
<CreateFolder id="4" repospath="$/test" />
<DeleteFolder id="5" repospath="$/test" />
<CreateFolder id="6" repospath="$/test" />
<ModifyFile id="7" repospath="$/test/VaultTest/test.txt" localpath="c:\Vault\VaultTest\test.txt" />
</changeset>
<!-- Preparing data to begin transaction -->
<!-- Beginning transaction -->
<!-- Item $/test caused the transaction to fail: The object could not be modified because it or one of its children is checked out. -->
<!-- Transaction failed -->
<result success="no" />
</vault>
ChrisL

Chris Leslie
Posts: 10
Joined: Tue Mar 09, 2004 5:38 pm
Location: Canada

Post by Chris Leslie » Mon Mar 15, 2004 8:43 am

--------------------Starting Build: 'VaultTest'--------------------
Building project step 'listrepositories'...
"C:\Program Files\SourceGear\Vault Client\vault.exe" -host cpdev03 -user chris -password chris listrepositories
<vault>
<listrepositories>
<repository name="Default Repository" files="28" folders="4" dbsize="0" />
<repository name="Everest" files="4213" folders="562" dbsize="0" />
<repository name="Everest2" files="4213" folders="562" dbsize="0" />
</listrepositories>
<result success="yes" />
</vault>
Building project step 'List Changeset'...
"C:\Program Files\SourceGear\Vault Client\vault.exe" -host cpdev03 -user chris -password chris -repository "Default Repository" listchangeset
<vault>
<changeset>
<DeleteFolder id="0" repospath="$/test" />
<AddFolder id="1" reposfolder="$/test/VaultTest" localfolder="c:\Vault\VaultTest" />
<DeleteFolder id="2" repospath="$/test" />
<DeleteFolder id="3" repospath="$/test" />
<CreateFolder id="4" repospath="$/test" />
<DeleteFolder id="5" repospath="$/test" />
<CreateFolder id="6" repospath="$/test" />
<CreateFolder id="7" repospath="$/test" />
<DeleteFolder id="8" repospath="$/test" />
<CreateFolder id="9" repospath="$/test" />
<DeleteFolder id="10" repospath="$/test" />
</changeset>
<result success="yes" />
</vault>
Building project step 'Populate Repository'...
Building project step 'delete dir'...
Building project step 'create dir'...
Building project step 'create file'...
Building project step 'createfolder'...
"C:\Program Files\SourceGear\Vault Client\vault.exe" -host cpdev03 -user chris -password chris -repository "Default Repository" createfolder $/test -commit
<vault>
<changeset>
<CreateFolder id="0" repospath="$/test" />
</changeset>
<!-- Preparing data to begin transaction -->
<!-- Beginning transaction -->
<!-- Create folder $/test -->
<!-- Ending the transaction -->
<!-- Transaction completed successfully -->
<result success="yes" />
</vault>
Building project step 'add'...
"C:\Program Files\SourceGear\Vault Client\vault.exe" -host cpdev03 -user chris -password chris -repository "Default Repository" add $/test c:\Vault\VaultTest -commit
<vault>
<changeset>
<AddFolder id="0" reposfolder="$/test/VaultTest" localfolder="c:\Vault\VaultTest" />
</changeset>
<!-- Preparing data to begin transaction -->
<!-- Beginning transaction -->
<!-- Create folder $/test/VaultTest -->
<!-- Add $/test/VaultTest/test.txt -->
<!-- Ending the transaction -->
<!-- Transaction completed successfully -->
<result success="yes" />
</vault>
Building project step 'Build'...
Building project step 'get'...
"C:\Program Files\SourceGear\Vault Client\vault.exe" -host cpdev03 -user chris -password chris -repository "Default Repository" get $/test -verbose -setfiletime modification -destpath c:\Vault
<vault>
<!-- Fetched $/test/VaultTest/test.txt -->
<result success="yes" />
</vault>
Building project step 'set workfold'...
"C:\Program Files\SourceGear\Vault Client\vault.exe" -host cpdev03 -user chris -password chris -repository "Default Repository" setworkingfolder $/test c:\Vault
<vault>
<listworkingfolders>
<workingfolder reposfolder="$/test" localfolder="c:\Vault" />
<workingfolder reposfolder="$/Don's Test Folder" localfolder="U:\myDocuments" />
</listworkingfolders>
<result success="yes" />
</vault>
Building project step 'checkout - OK'...
"C:\Program Files\SourceGear\Vault Client\vault.exe" -host cpdev03 -user chris -password chris -repository "Default Repository" checkout $/test/VaultTest/test.txt
<vault>
<!-- Checked out: $/test/VaultTest/test.txt -->
<result success="yes" />
</vault>
Building project step 'simulate build'...
Building project step 'List Changeset'...
"C:\Program Files\SourceGear\Vault Client\vault.exe" -host cpdev03 -user chris -password chris -repository "Default Repository" listchangeset
<vault>
<changeset>
<DeleteFolder id="0" repospath="$/test" />
<AddFolder id="1" reposfolder="$/test/VaultTest" localfolder="c:\Vault\VaultTest" />
<DeleteFolder id="2" repospath="$/test" />
<DeleteFolder id="3" repospath="$/test" />
<CreateFolder id="4" repospath="$/test" />
<DeleteFolder id="5" repospath="$/test" />
<CreateFolder id="6" repospath="$/test" />
<CreateFolder id="7" repospath="$/test" />
<DeleteFolder id="8" repospath="$/test" />
<CreateFolder id="9" repospath="$/test" />
<DeleteFolder id="10" repospath="$/test" />
<ModifyFile id="11" repospath="$/test/VaultTest/test.txt" localpath="c:\Vault\VaultTest\test.txt" />
</changeset>
<result success="yes" />
</vault>
Building project step 'commit - OK'...
"C:\Program Files\SourceGear\Vault Client\vault.exe" -host cpdev03 -user chris -password chris -repository "Default Repository" commit $/test/VaultTest/test.txt -comment "Changes from 'C:\Program Files\VisBuildPro\Samples\Vault\VaultTest.bld' build on 3/15/2004 9:40:26 AM"
<vault>
<changeset>
<ModifyFile id="0" repospath="$/test/VaultTest/test.txt" localpath="c:\Vault\VaultTest\test.txt" />
</changeset>
<!-- Preparing data to begin transaction -->
<!-- Beginning transaction -->
<!-- Check in $/test/VaultTest/test.txt -->
<!-- Ending the transaction -->
<!-- Transaction completed successfully -->
<result success="yes" />
</vault>
Building project step 'List Changeset'...
"C:\Program Files\SourceGear\Vault Client\vault.exe" -host cpdev03 -user chris -password chris -repository "Default Repository" listchangeset
<vault>
<changeset>
<DeleteFolder id="0" repospath="$/test" />
<AddFolder id="1" reposfolder="$/test/VaultTest" localfolder="c:\Vault\VaultTest" />
<DeleteFolder id="2" repospath="$/test" />
<DeleteFolder id="3" repospath="$/test" />
<CreateFolder id="4" repospath="$/test" />
<DeleteFolder id="5" repospath="$/test" />
<CreateFolder id="6" repospath="$/test" />
<CreateFolder id="7" repospath="$/test" />
<DeleteFolder id="8" repospath="$/test" />
<CreateFolder id="9" repospath="$/test" />
<DeleteFolder id="10" repospath="$/test" />
</changeset>
<result success="yes" />
</vault>
Building project step 'label'...
"C:\Program Files\SourceGear\Vault Client\vault.exe" -host cpdev03 -user chris -password chris -repository "Default Repository" label $/test 9.00.105 -commit
<vault>
<!-- Label $/test "9.00.105" -->
<result success="yes" />
</vault>
Building project step 'history'...
"C:\Program Files\SourceGear\Vault Client\vault.exe" -host cpdev03 -user chris -password chris -repository "Default Repository" history $/test -commit
<vault>
<history>
<item txid="87560" date="3/15/2004 9:40:12 AM" name="test" type="70" version="1" user="chris" />
<item txid="87561" date="3/15/2004 9:40:14 AM" name="test" type="10" version="2" user="chris" />
<item txid="87561" date="3/15/2004 9:40:14 AM" name="test/VaultTest" type="70" version="1" user="chris" />
<item txid="87561" date="3/15/2004 9:40:14 AM" name="test/VaultTest" type="10" version="1" user="chris" />
<item txid="87561" date="3/15/2004 9:40:14 AM" name="test/VaultTest/test.txt" type="70" version="1" user="chris" />
<item txid="87562" date="3/15/2004 9:40:25 AM" name="test/VaultTest/test.txt" type="60" version="2" user="chris" comment="Changes from 'C:\Program Files\VisBuildPro\Samples\Vault\VaultTest.bld' build on 3/15/2004 9:40:26 AM" />
<item txid="0" date="3/15/2004 9:40:48 AM" name="test" type="90" version="3" user="chris" />
</history>
<result success="yes" />
</vault>
Building project step 'Cleanup Repository'...
Building project step 'delete'...
"C:\Program Files\SourceGear\Vault Client\vault.exe" -host cpdev03 -user chris -password chris -repository "Default Repository" delete $/test -commit
<vault>
<changeset>
<DeleteFolder id="0" repospath="$/test" />
</changeset>
<!-- Preparing data to begin transaction -->
<!-- Beginning transaction -->
<!-- Delete $/test -->
<!-- Ending the transaction -->
<!-- Transaction completed successfully -->
<result success="yes" />
</vault>
Build successfully completed.

dan
Posts: 2448
Joined: Wed Dec 17, 2003 5:03 pm
Location: SourceGear
Contact:

Post by dan » Mon Mar 15, 2004 8:50 am

It looks like the current problem is the contents of change set, rather than the command line. Note that the command line *is* trying to apply all the changes in the change set - it is just that it can't, because the change set contains a deletion of a folder that contains a checked out file, which the Vault server doesn't accept.

It also looks like the change set contains some duplicate deletion and creations of the same folder, which would also fail, since everything in the change set would get applied in one transaction.

The easiest way to clear this out is to invoke the GUI client and remove these items from your change set. If this is happening in a script, you'll want to make sure that the Vault user the script logs into Vault as is not used for anything else on the local machine, as a change set is created for a user on a machine, and is not limited to one session of a vault client invocation.

Chris Leslie
Posts: 10
Joined: Tue Mar 09, 2004 5:38 pm
Location: Canada

Post by Chris Leslie » Mon Mar 15, 2004 11:32 am

It is just strange that it worked when I specified the actual filename?
dan wrote:It looks like the current problem is the contents of change set, rather than the command line. Note that the command line *is* trying to apply all the changes in the change set - it is just that it can't, because the change set contains a deletion of a folder that contains a checked out file, which the Vault server doesn't accept.

It also looks like the change set contains some duplicate deletion and creations of the same folder, which would also fail, since everything in the change set would get applied in one transaction.

The easiest way to clear this out is to invoke the GUI client and remove these items from your change set. If this is happening in a script, you'll want to make sure that the Vault user the script logs into Vault as is not used for anything else on the local machine, as a change set is created for a user on a machine, and is not limited to one session of a vault client invocation.
ChrisL

dan
Posts: 2448
Joined: Wed Dec 17, 2003 5:03 pm
Location: SourceGear
Contact:

Post by dan » Mon Mar 15, 2004 3:51 pm

Chris Leslie wrote:It is just strange that it worked when I specified the actual filename?
If you specify just a specific filename, it will ignore anything in the change set that isn't that filename, so all the other duplicate entries would have been ignored, and thus, no problems when committing.

matt@spam.com

recursive checkouts from the CLC

Post by matt@spam.com » Tue Aug 24, 2004 2:20 pm

When / how soon do you think recursive checkouts from the CLC will be included?

dan
Posts: 2448
Joined: Wed Dec 17, 2003 5:03 pm
Location: SourceGear
Contact:

Post by dan » Tue Aug 24, 2004 2:43 pm

It is borderline for 2.1 right now. If it doesn't make 2.1, it will make the next release after that.

Post Reply