Rob Ries
2006-03-06 21:41:00 UTC
I'm new to StarTeam. I'm trying to come up with the "right way" to use stcmd - our shop is command-line-centric. Here's the issue [writeup may seem a bit long-winded - it's because I submitted the question to our internal StarTeam folks, who may not be as well-versed with the stcmd options as you are]:
In short, the question is something like: "What is the recommended best practice for getting the most out of this command-line utility?" The longer version goes as follows:
Most of the stcmd actions request that you include the following as one of the options to the command:
-p "userName:***@hostName:endpoint/projectName/viewName/folderHierarchy/"
For example, the checkout, checkin, and list stcmd commands all need that "project identifier" option in order to tell StarTeam who you are and what StarTeam project to access when taking whatever action you are directing it to take (via other parameters on the same line - for example, checkout, checkin, list...).
My immediate reaction was: set an environment variable like "$P" so that you don't have to keep entering this info every time you ran a StarTeam command. So I did (using cygwin here):
export P="myusername:***@100.100.100.200:49201/PointOfSale/prototype"
By doing the above, you can then do things like:
stcmd list -p "$P" "build.properties"
and it'll dump a listing of the status of, say, your "build.properties" file in your top level directory named "prototype".
So that's all fine and dandy. My question arises when I want to perform actions on files that are NOT in that top level directory. For example, down in a src/com/nasd/blah/blah sub-directory, I have a .java file. I want to do stcmd stuff (checkout, checkin, list) THAT file. I certainly do not want to have to reset the "$P" environment variable every time I change directory.
But my experiments have not come up with the right answer here. I have tried:
1. remain in that top "prototype" directory and use a relative path down to the source file:
stcmd list -p "$P" "src/com/nasd/blah/blah/source.java"
...but that gives a "No file matching src/com/nasd/blah/blah/source.java were found..." message.
2. cd down into that directory that holds source.java, and then try:
stcmd list -p "$P" "source.java"
...again - "No file matching source.java were found..." message.
What DOES work, but which I think is unusable, is the following:
cd back up to that top directory (prototype), and use the "-is" (recursive) option:
stcmd list -p "$P" -is "source.java"
That one DOES find the source.java file, but what if I had 2 of them in my tree - the recursive approach does not give me an exact way to refer to a specific instance of a given filename.
Clearly I am missing something here. What is the right way to do this?
In short, the question is something like: "What is the recommended best practice for getting the most out of this command-line utility?" The longer version goes as follows:
Most of the stcmd actions request that you include the following as one of the options to the command:
-p "userName:***@hostName:endpoint/projectName/viewName/folderHierarchy/"
For example, the checkout, checkin, and list stcmd commands all need that "project identifier" option in order to tell StarTeam who you are and what StarTeam project to access when taking whatever action you are directing it to take (via other parameters on the same line - for example, checkout, checkin, list...).
My immediate reaction was: set an environment variable like "$P" so that you don't have to keep entering this info every time you ran a StarTeam command. So I did (using cygwin here):
export P="myusername:***@100.100.100.200:49201/PointOfSale/prototype"
By doing the above, you can then do things like:
stcmd list -p "$P" "build.properties"
and it'll dump a listing of the status of, say, your "build.properties" file in your top level directory named "prototype".
So that's all fine and dandy. My question arises when I want to perform actions on files that are NOT in that top level directory. For example, down in a src/com/nasd/blah/blah sub-directory, I have a .java file. I want to do stcmd stuff (checkout, checkin, list) THAT file. I certainly do not want to have to reset the "$P" environment variable every time I change directory.
But my experiments have not come up with the right answer here. I have tried:
1. remain in that top "prototype" directory and use a relative path down to the source file:
stcmd list -p "$P" "src/com/nasd/blah/blah/source.java"
...but that gives a "No file matching src/com/nasd/blah/blah/source.java were found..." message.
2. cd down into that directory that holds source.java, and then try:
stcmd list -p "$P" "source.java"
...again - "No file matching source.java were found..." message.
What DOES work, but which I think is unusable, is the following:
cd back up to that top directory (prototype), and use the "-is" (recursive) option:
stcmd list -p "$P" -is "source.java"
That one DOES find the source.java file, but what if I had 2 of them in my tree - the recursive approach does not give me an exact way to refer to a specific instance of a given filename.
Clearly I am missing something here. What is the right way to do this?