CLC - Status command in Vault ?

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

Moderator: SourceGear

Post Reply
parentol
Posts: 1
Joined: Wed Jan 04, 2006 9:04 am

CLC - Status command in Vault ?

Post by parentol » Thu Jan 05, 2006 1:54 pm

Hello,

Is there a way I can know if a specific file is checked out with the CLC?
I need something like Status command line option of Source Safe.

Is there a way to output a result with the CLC. Maybe i could do a LISTCHECKOUTS > toto.txt and parse the result ?

I need help here!

Thank you very much

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

Post by lbauer » Thu Jan 05, 2006 3:03 pm

Looks like parsing is the best way to do this with the current version of Vault. You can output to a text file. Output will look something like this:

Code: Select all

<checkoutlist> 
<checkoutitem id="214"> 
<checkoutuser username="linda" version="1" repositorypath="$/addfiles/testfiles/xanadu1.txt" locktype="checkout" comment="" hostname="server/sourcegear.com" localpath="C:\_Vault2\addfiles\testfiles\xanadu1.txt" folderid="213" lockedwhen="12/29/05 4:38:43 PM" miscinfo="" /> 
</checkoutitem> 
<checkoutitem id="215"> 
<checkoutuser username="linda" version="2" repositorypath="$/addfiles/testfiles/xanadu2.txt" locktype="checkout" comment="" hostname="server/sourcegear.com" localpath="C:\_Vault2\addfiles\testfiles\xanadu2.txt" folderid="213" lockedwhen="12/29/05 4:38:43 PM" miscinfo="" /> 
</checkoutitem> 
<checkoutitem id="216"> 
<checkoutuser username="linda" version="1" repositorypath="$/addfiles/testfiles/xanadu3.txt" locktype="checkout" comment="" hostname="server/sourcegear.com" localpath="C:\_Vault2\addfiles\testfiles\xanadu3.txt" folderid="213" lockedwhen="12/29/05 4:38:43 PM" miscinfo="" /> 
</checkoutitem> 
</checkoutlist> 
<result success="yes" />
I took a look at the LISTFOLDER command; it lists folder contents but only the version of files, and not any checkout info. I'll add a feature request for a command to retrieve file status from the working folder information.
Last edited by lbauer on Fri Jan 06, 2006 4:41 pm, edited 1 time in total.
Linda Bauer
SourceGear
Technical Support Manager

mlippert
Posts: 252
Joined: Wed Oct 06, 2004 10:49 am
Location: Cambridge, MA

Post by mlippert » Thu Jan 05, 2006 4:45 pm

Linda,
I've got a question. Is the checkout list that you are getting only the local checkout list, or is it the list of all files checked out in the repository along with all of the users who have each of those files checked out?

I suspected that when you mentioned the working folder. I don't know what parentol wanted, but I am now curious if it's possible to find out (even from a list) all the users that have a particular file checked out (or if a file is checked out exclusively by some user).

Mike

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

Post by lbauer » Fri Jan 06, 2006 10:00 am

LISTCHECKOUTS lists all the checkouts for a particular repository. In the previous example, only one user had any checkouts.

Here's an example with more user checkouts. Also, the results do show whether the checkout was exclusive or not:

Code: Select all

<vault>
<checkoutlist>
 <checkoutitem id="8">
  <checkoutuser username="linda" version="1" repositorypath="$/addfiles/bapp/xan
adu2.txt" locktype="checkout" comment="" hostname="server/sourcegear.com" loc
alpath="C:\_Vault\addfiles\bapp\xanadu2.txt" folderid="4" lockedwhen="1/6/06 9:4
3:55 AM" miscinfo="" />
 </checkoutitem>
 <checkoutitem id="14">
  <checkoutuser username="liza" version="1" repositorypath="$/addfiles/bapp/xana
du8.txt" locktype="exclusive" comment="" hostname="server/sourcegear.com"  loc
alpath="C:\_Vault2\addfiles\bapp\xanadu8.txt" folderid="4" lockedwhen="1/6/06 9:
44:13 AM" miscinfo="" />
 </checkoutitem>
 <checkoutitem id="12">
  <checkoutuser username="admin" version="1" repositorypath="$/addfiles/bapp/xan
adu6.txt" locktype="exclusive" comment="" hostname="server/sourcegear.com"  lo
calpath="C:\_Vault\addfiles\bapp\xanadu6.txt" folderid="4" lockedwhen="1/6/06 9:
44:37 AM" miscinfo="" />
 </checkoutitem>
 <checkoutitem id="268">
  <checkoutuser username="admin" version="1" repositorypath="$/addfiles/bapp/fix
share.sql" locktype="checkout" comment="" hostname="server/sourcegear.com"  lo
calpath="C:\_Vault\addfiles\bapp\fixshare.sql" folderid="4" lockedwhen="1/6/06 9
:44:43 AM" miscinfo="" />
 </checkoutitem>
</checkoutlist>
<result success="yes" />
LISTFOLDER shows the contents of a particular folder in the tree and the working folder association, if any, for the user running the command.
Results look like this:

Code: Select all

<vault>
<folder name="$/addfiles" workingfolder="C:\_Vault\addfiles">
 <file name="Copy of xanadu7.txt" version="1" length="226" objectid="28" objectv
ersionid="28" />
 <file name="audit.gif" version="1" length="19492" objectid="3" objectversionid=
"3" />
 <file name="Created3_30.txt" version="2" length="17" objectid="32" objectversio
nid="433" />
 <file name="xanadu2.txt" version="1" length="264" objectid="228" objectversioni
d="228" />
 <file name="Created3_27.txt" version="1" length="15" objectid="29" objectversio
nid="29" />
 <file name="xanadu6.txt" version="1" length="218" objectid="232" objectversioni
d="232" />
 <file name="xanadu8.txt" version="1" length="363" objectid="234" objectversioni
d="234" />
</vault>
With the html help included with the 3.1 Vault Command Line Client, it's easy to review the commands available and try them yourself. use the command, vault helphtml.
Linda Bauer
SourceGear
Technical Support Manager

mlippert
Posts: 252
Joined: Wed Oct 06, 2004 10:49 am
Location: Cambridge, MA

Post by mlippert » Fri Jan 06, 2006 10:05 am

Thanks Linda,
Mike

Post Reply