tags:

views:

408

answers:

3

Hi, I want to get the code under particular label from StarTeam strictly using command line. I have come to know that I can use "stcmd.exe" for the same. But I am unable to find the particular command to get the labeled code.

Can any one please help?

Thanks.

+1  A: 

Google found this: http://www.foxdata.com/starteam/faq/view_labels_and_how_to_use.htm So it seems the -vl option lets you specify the view label.

Henrik
Thanks for the help.I am bit confused whether to use -cfgl (specified by Dougman) or -vl.As we only want to get the labeled version.We do not want to checkout the labeled verison.I can understand that -co switch is used for check out but I do not understand which particular switch "gets" the version.
I must admit, I'm not a StarTeam expert. We have an older version and there are view labels and revision labels. Don't know, what configuration labes are. We use view labels as build labels.
Henrik
A: 

Documentation for the command line tools are here (page 51 has the checkout options):

http://techpubs.borland.com/starteam/2009/en/ST_CmdTools_Help_en.pdf

The -cfgl switch allows you to specify the configuration label.

Edit with updated syntax

The full syntax to do a checkout to a specified directory based on a configuration label is:

stcmd.exe co -p "<username>:<password>@<starteamServerAndPort>/<project>/<view>/" -rp "<workingDir>" -o -cfgl "<labelName>"

So with the following parameters:

username=test
password=pw
starteamServerAndPort=10.209.30.22:49201
project=MyProject
view=MyView
workingDir=d:\latest
lableName=MyLabel

Our command line call would be:

stcmd.exe co -p "test:[email protected]:49201/MyProject/MyView/" -rp "d:\latest" -o -cfgl "MyLabel"
Dougman
Thanks for the help.But we want to only get the labeled version and strictly do not want to checkout the labeled version.I am bit confused whether to use -cfgl or -vl (specified by Henrik).
@user196614: What do you mean by "only get the labeled version"? Get it and put it somewhere on your local hard drive? Could you explain a bit more?
Dougman
Yes exactly I wnat to get it and put it somewhere on my local computer. By the phrase "only get the labeled version", I wanted to convey that I do not need to update the file. I only want to build the source code and deploy the executables.
Further, I have also tried the following commandstcmd co -p "test:test!\@#@10.209.30.22:49201/Project Repository:Demo/Pilot Project"-fp"D:\Latest"The command first asked for the password for the user who has logged in the system and then gave the "bad port error"bad port specified in: test:test!\@#@10.209.30.22:49201/Project Repository:Demo/Pilot Project-fpD:\Latest
Thans a lot Dougman.I have two questions:1) what if my password contains @ character?2) Do I need to have a view?
@user196614: Good question. I'm not sure how you would escape an @ sign in your password using this syntax. I would probably just change the password to not use that character. If you don't have a specific View created, there is a default view that is the same name as your Project. So /MyProject/MyProject would be the project MyProject with the default View.
Dougman
Actually found the answer about the @ sign in the docs. Haven't tested it though:"If any of the variables used with this option, for example, user names or view names, contain characters that are used as delimiters, please use the percent sign (%) followed by the hex code for each of those characters. For example, if "@" appears as a character in a password, you must replace it with "%40"."
Dougman
thanks dougman...Now when I run the command it says "Project not found".My project name contains space.Can it be the reason?
thanks dougmanI got it..Actually there was a small mistake in cmd..Now solved.Thanks a lot.
@user196614: Fully solved? If so, don't forget to click the Check Mark and mark this answer as correct.
Dougman
I ran the following command which is working fine.stcmd.exe co -p "user1:test!%40#@16.212.37.42:49201/Demo Project/Demo Project/Test" -is -fp "d:\latest" -vl "Label1"
A: 

As a clarification to some of the other comments, the -cfgl flag specifies a View label while the -vl flag specifies a version (Revision) label. Specifying -cfgl is the equivalent of opening the view in the gui and setting the View Configuration to the given View label and is probably what you're looking for, like Dougman said. Specifying -vl is the equivalent of opening the gui and picking that label in the Checkout dialog.

As for specifying passwords with funky characters, either escape them with % as shown above or use the -pwdfile or -epwdfile flags and store the password in a separate file.

Jeremy Murray