下面以我们自己,(最早由杨致伟封装,后经 Johnson 改写),封装的 Starteam 命令行 Wrapper 为例作以介绍:
用 st config 进行配置
# cd /home/jiangxin/work/src/project # mkdir branch1 # cd branch1 # pwd /home/jiangxin/work/src/project/branch1 # st config StarTeam Configuration Original starteam server is 10.0.0.60 new server:[10.0.0.60] Original starteam server port is 49201 new server port:[49201] original username is new username:[]jiangxin Password:[********] Confirm :[********] Original checkout project is project Project you want to checkout:[project] Original checkout view is ("/" means root view) View you want to checkout:[]branch_2_4 Original checkout folder is ("/" means root folder) Folder you want to checkout:[]Development Working dir is /usr/home/jiangxin/work/src/project/branch1 Your working directory:[/usr/home/jiangxin/work/src/project/branch1] Sticky tag base on date : ("/" means not exist) Date:[] Sticky tag base on label : ("/" means not exist) Label:[] Sticky tag base on promotion-state : ("/" means not exist) Promotion-state:[] # cat .starteam.ini # StarTeam Configuration: /usr/home/jiangxin/work/src/project/branch1/.starteam.ini # /usr/home/jiangxin/work/src/project/branch1/.starteam.ini STUSER="jiangxin" STSERVER="10.0.0.60" STPORT="49201" STPROJECT="project" STVIEW="branch_2_4" STFOLDER="Development" STCFGD="" STCFGL="" STCFGP="" STWORKROOT="/usr/home/jiangxin/work/src/project/branch1"
用户登录口令保存在用户主目录下
用 st config 配置完成,或者用命令 st login 登录后,用户口令自动保存在 $HOME/.stpass 中
# cat $HOME/.stpass releng:10.1.1.60:49201:xxxxxxxxxxxxxxxx jiangxin:10.1.1.60:49201:xxxxxxx jiangxin:10.0.0.6:49201:xxxxxxxx
将代码 Checkout 到本地
# pwd /home/jiangxin/work/src/project/branch1 # st co Folder: Development (working dir: /usr/home/jiangxin/work/src/project/branch1) Makefile: checked out .......
将配置文件 .starteam.ini 文件指定的视图下的文件,Checkout 到本地
如果不想将全部模块 Checkout 到本地,可先运行命令 st cd ,将整个目录结构 Checkout 到 本地,然后再运行 st co directory,只 checkout 该目录。 |
本地配置文件
STARTEAM 不是像 CVS 那样,在本地源码目录同时保存配置信息(CVS目录)来记录源文件的版本等, 而是直接保存在服务器的数据库中。而该数据库通过主机ID,来区分不同/相同用户在同一/不同主机 中 CHECKOUT 文件的路径等信息。
命令行用 $HOME/.starteam 保存主机ID等配置信息。图形界面类似。
starteam cli wrapper 另外需要配置文件: .starteam.ini,因为命令行没有提供简单的读取服务器端 数据库的方法。
Copyright © 2006 WorldHello 开放文档之源 计划 |