简体   繁体   English

StarTeam - 使用stcmd的特定修订的签出文件

[英]StarTeam - checkout file of a specific revision using stcmd

Is it possible to checkout file of a specific revision using stcmd? 是否可以使用stcmd签出特定修订的文件?

I want to checkout all (or some) history of a specific file. 我想查看特定文件的所有(或某些)历史记录。

Is it possible to checkout file of a specific revision using stcmd?

You can checkout a specific revision using the label as follows 您可以使用以下标签签出特定修订

"C:\Program Files\Borland\StarTeam Cross-Platform Client 2005 R2\stcmd" co -p "user:pwd@host:port/MyProject/view_r1/" -is -eol on  -o  -rp "D:\LocalDir" -cfgl  "LABELNAME"

The history of a particular file in that label is gotten by 获得该标签中特定文件的历史记录

stcmd hist -p "user:pwd@host:port/MyProject/view_r1/" -cfgl "labelName" -is -rp "D:\LocalDir" FILENAME

stcmd.exe co has a -vn flag that allows you to specify a version number. stcmd.exe co有一个-vn标志,允许您指定版本号。 This is the version number, not the DotNotation, so 1.15 would be version 16. This command: 这是版本号,而不是DotNotation,因此1.15将是版本16.此命令:

stcmd.exe co -vn 1 -fp . -p "user:password@server:port/ProjectName/ViewName/FolderPath" file.ext

would get you the 1.0 of file.ext in the current directory. 会得到当前目录中的file.ext 1.0。 If you want to get the full history, you can parse the output of stcmd hist and figure out the current revision number, or you can just run the above stcmd co command with increasing version numbers from 1 until the result says "file.ext: skipped" instead of "file.ext: checked out" (the current version of stcmd does not error if the version number is too large to be valid). 如果要获取完整历史记录,可以解析stcmd hist的输出并找出当前的修订版号,或者只需运行上面的stcmd co命令,将版本号从1增加到结果为“file.ext:跳过“而不是”file.ext:签出“(如果版本号太大而无效,则当前版本的stcmd不会出错)。 Remember to either delete the local file between calls or add the -o flag to overwrite it. 请记住在调用之间删除本地文件或添加-o标志以覆盖它。 I'd recommend deleting it - there have been issues with stcmd co and overwriting. 我建议删除它 - 有stcmd co和覆盖的问题。

Note this will only get you the versions of the file on the current branch back to the 1.0 - you won't get any versions of the file from other branches. 请注意,这只会将当前分支上的文件版本返回到1.0 - 您将无法从其他分支获取该文件的任何版本。 So if the current version is 1.5.2.1, you would be able to get 1.5.2.1, 1.5.2.0, 1.5, 1.4, 1.3, 1.2, 1.1, 1.0, but not 1.5.1.0. 因此,如果当前版本是1.5.2.1,您将能够获得1.5.2.1,1.5.2.0,1.5,1.4,1.3,1.2,1.1,1.0,但不是1.5.1.0。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM