IBM®Rational Team Concert™软件以高效且功能强大的图形用户界面提供了更改,配置,构建管理和项目计划。 大多数用户选择Web界面,而不是Eclipse界面,因为它易于使用,安装占用量为零,并且与Rational软件解决方案中用于需求管理,设计管理和测试管理的其他元素的连接性。 许多开发人员还使用集成到Eclipse或基于Eclipse的产品(例如IBM®Rational®Application Developer)和Microsoft Visual Studio .NET开发环境中的Rational Team Concert的软件配置管理功能。

本指南说明了可从命令行访问的Rational Team Concert支持用户界面。 命令行界面(CLI)提供对Rational Team Concert的源代码管理(SCM)方面的丰富功能的访问。 许多用户已经熟悉诸如Rational®ClearCase®或CVS之类的产品的命令行界面,对于这些产品,命令行通常用于生成包含重复执行的命令序列的脚本。

第一部分研究开发人员在首次开始使用命令行界面时最常用的命令。 这涵盖了登录过程,创建工作区和加载内容。 所有命令都包含用于说明特定方案的示例。 第二部分描述了用于更高级方案的命令的使用以及一些仅偶尔使用的命令。 最后一部分显示了一个示例,该示例结合了许多命令以生成提供特定功能的脚本。 所提供的信息适用于Microsoft Windows和UNIX系统,并在必要时偶尔突出显示差异。

第1节。常用命令

本节介绍最常用的命令及其结果。

命令行界面

对命令行界面的访问由两个命令之一提供,可以将其视为命令行界面。 特定的产品功能由interface命令的子命令提供。 接口命令将在随后的小节中介绍。

SCM可执行文件

scm命令位于Rational Team Concert客户端安装的以下缺省目录中:

  • Windows: TeamConcert \ SCMTools \ Eclipse \ scm.exe
  • UNIX: teamconcert / scmtools / eclipse / scm

scm命令在每次调用时都会调用一个新的命令行进程守护程序。 上述路径在安装过程中不会添加到系统搜索路径中,因此您需要手动执行此操作。

最小二乘

lscm命令(在Microsoft Windows系统上为lscm.bat)与前面描述的scm命令位于同一目录中。 两者的区别在于lscm缓存了进程守护程序,因此它运行得更快。

在大多数情况下,最好尽可能使用lscm。

执行子命令

通常,命令以以下方式执行:

lscm {options} [subcommands] {subcommand options}

{}括号中显示的参数是可选的,并且[]括号中显示的参数是命令正常工作所必需的。 重复使用了某些选项,例如存储库连接和用户标识信息。

在所有示例中,必须在命令行上键入的实际文本以固定宽度的Courier New字体显示:

This is text that the user types at the command line.

子命令摘要

表1是子命令的摘要。 在本文的后续部分和本系列的后续两篇文章中,将显示常用命令及其常用参数和选项的详细信息。 表1指出了包含每个命令的文章。

表1.带有简短描述的子命令
命令 描述
接受 将更改集接受到远程工作区中并下载更改。
注释 用更改历史记录注释文本文件的行,例如作者,时间戳和注释。
变更权限 修改文件和文件夹的读取访问权限。
变更集 操纵变更集(子命令:关联,注释,完成,当前,解除关联,丢弃,提取,重定位,恢复,暂停)。
报到 将更改签入当前工作空间,并将其添加到活动更改集中。
比较 比较工作空间,流,基线或快照的内容。
创造 创建一个项目(子命令:基线,变更集,组件,快照,工作空间)
删除 删除存储库项目。
交付 将签入的更改从远程工作区传递到另一个工作区或流。
差异 显示对文件所做的更改。
提取 从存储库中提取文件的特定版本。
救命 列出可用的子命令并提供有关每个命令的详细帮助。
历史 显示文件或组件的历史记录。
Lastmod 返回文件夹子树的最新修改时间。
清单 列出存储库项目(子命令:基线,变更集,组件,凭据,守护程序,锁,项目区域,属性,远程文件,快照,状态,流,团队区域,用户,工作空间)。
加载 将存储库工作空间加载到本地文件系统上。
获取或释放流中的锁(子命令:获取,列出,释放)。
登录 存储存储库连接的凭据。
登出 删除存储的凭据。
属性 查看和更新​​文件的属性(子命令:获取,列出,删除,设置)。
解决 解决冲突。
分享 共享一个或多个目录。
快照 将快照从一个流提升到另一个。 (子命令:promote)。
状态 显示状态和未决更改。
撤消 撤消对文件的更改。
显示版本信息。
工作区 更改工作空间的属性(子命令:添加组件,更改目标,删除,删除组件,替换组件,卸载,未设置)。

用户访问控制

用户需要使用每个命令登录到SCM命令行界面。 为了使Rational Team Concert能够维护所有操作的完整审计跟踪,这是必需的。 为了简化此过程,可以在登录过程中创建一个昵称。 它用于在后续命令期间标识用户和所需的存储库连接。

登录

登录命令使用表2中所示的参数。

表2.登录命令选项
lscm login [options]
论据 描述
-c [--cache] 在提示时缓存密码
-n [--nickname] arg 将来标识存储库的昵称
-P [--password] arg 存储库的密码。
-r [--repository-uri] arg 指定存储库位置的URI
-u [--username] arg 存储库的用户名
lscm login -r https://rational-srv-06:9443/ccm -u mark -n SRV6 -c

此命令使用指示的服务器存储库地址和mark的用户名登录用户。 为了保护隐私,未在命令行上提供密码,并提示用户提供密码。 密码不显示在屏幕上。 存储库地址,用户名和密码的组合存储在昵称SRV6下,该别名可与后续命令中的–r选项一起使用,如以下部分所述。

登出

要注销Rational Team Concert命令行,请使用以下命令:

lscm logout –r <repository location or nickname>

例如,要注销使用前面显示的login命令建立的会话,可以使用以下命令之一:

lscm logout –r https://rational-srv-03:9443/ccm

要么

lscm logout –r SRV6

常用命令的详细信息

本节中包含常用特定命令的更多详细信息。 每个子节都包含一个示例以及有关上下文的更多信息(如果适用)。 所有命令均假定先前显示的登录命令与昵称SRV6一起使用。

创造

创建一个由子命令指定的项目,如表3所示。

表3. create命令的子命令
子指令 描述
基准线 在组件中创建基线
变更集 创建一个新的变更集
请注意,这可以通过签入操作自动完成。
零件 在指定的工作空间或流中创建一个新组件
快照 创建与工作空间或流关联的新快照
工作区 创建一个远程存储库工作区

要创建一个名为MyWorkspace的新用户工作区,该工作区会将更改流到称为BRM Stream的流中:

lscm create workspace -r SRV6 -d "Command line workspace" --stream "BRM Stream"
MyWorkspace

请注意,上面的一些参数前面有一个连字符,有些在前面有两个连字符。

要使用名为MRCL的工作区在Banking组件上创建一个名为Baseline 3的新基线,请使用以下命令:

lscm create baseline MRCL "Baseline 3" Banking

然后需要使用以下部分中描述的deliver命令来交付新创建的基准。

要在项目的上下文中创建一个名为Investment的新组件,该组件将与BRM流相关联,请使用以下命令:

lscm create component -r SRV6 Investment "BRM Stream"

注意:
如果整个组件名称都用引号引起来,则组件名称可以包含空格。

工作区

使用表4中描述的子命令来更改工作空间的属性。

表4.工作空间命令的子命令
子命令 描述
添加组件 将组件添加到工作空间
注意:在此命令之后使用load命令可以实际加载内容。
变更目标 更改工作空间的流目标。
删除 删除工作区或流
删除组件 从工作区中删除组件
替换组件 替换工作区中的组件
卸下 卸载工作空间,组件或根路径

添加组件

要将名为“ C#Samples”的组件添加到名为MyWorkspace的工作区中,请使用以下命令:

lscm workspace add-components -r SRV6 MyWorkspace "C# Samples"

显示屏将显示以下结果:

Following components successfully added: (1017) "C# Samples"

变更目标

要将名为MRCL的工作空间的流目标更改为称为Integration Stream的流,这将导致将来的交货被发送到新的目标流:

lscm change-target workspace MRCL "Integration Stream"-r SRV6

显示屏将显示以下结果:

Target changed.

加载

将存储库工作空间加载到本地文件系统上。

在UNIX上,将名为MyWorkspace的工作区的配置加载到用户主目录中的MyWorkspace目录中:

lscm load -d ~/MyWorkspace -i MyWorkspace -r SRV6

在Windows上,将名为MyWorkspace的工作区的配置加载到c:\ workspace目录中:

lscm load -d c:\workspace -i MyWorkspace -r SRV6

状态

显示工作区的状态以及所有未完成的更改。

以下示例显示了一个工作区,其中没有任何挂起的更改:

lscm status

执行此命令的结果如下所示:

Workspace: (1006) "BRM Stream Workspace" <-> (1007) "BRM Stream"Component: (1008) "Banking Logic" <-> (1007) "BRM Stream"Baseline: (1009) 4 "Sprint 1 (Release 1.0)"Component: (1010) "Build" <-> (1007) "BRM Stream"Baseline: (1011) 2 "Week 1 (Sprint 1, Release 1.0)"Component: (1012) "C# UI" <-> (1007) "BRM Stream"Baseline: (1013) 4 "Sprint 1 (Release 1.0)"

该信息表明,对于银行逻辑,构建和C#UI组件,称为BRM Stream Workspace的工作区是相对于称为BRM Stream的流的状态而言是最新的。 它还显示了每个组件所引用的基线。

status命令通常用于在工作空间中查找挂起的更改。 以下示例显示了在其中进行了几处更改的工作空间。 该示例显示了工作区正在等待交付和接受的未决更改。 传出变更集1033与ID 1317和“更新银行业逻辑代码”标题所标识的任务相关联:

Workspace: (1006) "BRM Stream Workspace" <-> (1007) "BRM Stream"Component: (1008) "Banking Logic" <-> (1007) "BRM Stream"Baseline: (1009) 4 "Sprint 1 (Release 1.0)"Outgoing:Change sets:(1033)  *--@  1317 "Update the banking logic code" - <No comment>Incoming:Change sets:(1034)  ---$ Marco 1318 "Extend the transaction processing logic for

上面显示的传入更改集被标识为Marco创建的。 变更集ID为1034,用于收集有关变更集的信息,例如其内容。 稍后将在list命令中将其与changesets子命令一起使用。

状态标志

表5的表中详细描述了图1中突出显示的更改集状态标志。

图1.更改集描述标志
表5.描述变更集特征的字符。
描述
* 更改集是当前的。
@ 更改集处于活动状态。
传入的资源与沙箱中的资源版本冲突。
传入资源与沙箱中的资源有潜在冲突。
$ 变更集已完成。

分享

共享一个或多个目录。

使用此命令将新内容共享到Rational Team Concert源代码管理中。 不要使用它来添加单个文件和目录。 为此,请使用checkin命令。

下面的示例使用MyWorkspace工作区将c:\Release\Attributes目录的内容共享到名为C#Samples的组件的根目录中。

lscm share -r SRV6 MyWorkspace "C# Samples" c:\Release\Attributes

显示屏显示:

Shared successfully.

报到

此命令用于检入当前工作空间中所做的更改。 签入项目将添加到活动更改集中。 要检入的文件将显示在status命令的报告的“未解决”部分中,如下所示:

C:\workspace>lscm status
Workspace: (1000) "MyWorkspace" <-> (1001) "BRM Stream"Component: (1005) "Build"Baseline: (1006) 3 "Iteration 1"Unresolved:-c- /Build/JKEBuildScripts/start/jke.client.windows.bat

例如:

lscm checkin Build/JKEBuildScripts/start/jke.client.windows.bat

结果如下所示。 它指示已创建由ID 1018标识的新更改集。

Workspace: (1000) "MyWorkspace" <-> (1001) "BRM Stream"Component: (1005) "Build"Baseline: (1006) 3 "Iteration 1"Outgoing:Change sets:(1018) *--@  "<No comment>" 24-Jul-2012 11:21 AMChanges:---c- \JKEBuildScripts\start\jke.client.windows.bat

处理已删除的文件内容

如果已从工作空间中删除文件,则无法将更改签入文件中,因为针对丢失的文件发出的任何命令均不起作用。 相反,需要使用以下命令来检入包含已删除文件的目录(假设已从当前工作目录中删除了该文件):

lscm checkin .

处理新文件内容

无需将新文件作为显式操作添加到源代码管理。 而是使用以下命令简单地检入新文件:

lscm checkin jke.client.linux.sh

这些命令的结果如下所示:

Committing...
Workspace: (1000) "MyWorkspace" <-> (1001) "BRM Stream"Component: (1005) "Build"Baseline: (1006) 3 "Iteration 1"Outgoing:Change sets:(1018) *--@  "<No comment>" 24-Jul-2012 11:21 AMChanges:--a-- /JKEBuildScripts/start/jke.client.linux.sh

表6说明了上面显示的更改信息。

表6.描述资源特征的字符
描述
一个 资源已添加。
C 文件内容已被修改。
p 文件的属性已被修改或目录的属性已被更改。
d 资源已被删除。
资源已被重命名或移动。

变更集

处理变更集。

有几个子命令可用于更改集的操作。 它们在表7中列出。

表7. Changeset子命令
子指令 描述
关联 创建与工作项的关联。
评论 为工作项创建一个新注释(通常使用而不是工作项关联)。
完成 关闭更改集,并防止进一步的更改。
当前 将更改集默认为与新签入文件的关联。
解除联系 删除工作项关联。
丢弃 删除与更改集关联的更改。
提取 从变更集中以变更集引用的版本中提取特定文件。
搬迁 将更改从一个更改集移动到另一更改集。
恢复 恢复在暂停的变更集上工作。
暂停 保留更改集内容,并删除更改集中列出的更改。 挂起时更改集中存在的所有更改可以在以后恢复。

评论

要将“对客户端目录中文件的更改”注释添加到ID为1019的更改集,请使用以下命令:

lscm changeset comment -r SRV6 1018 "Changes to files in the client directory"

然后使用status命令时,注释如下所示:

Workspace: (1000) "MyWorkspace" <-> (1001) "BRM Stream"Component: (1005) "Build"Baseline: (1006) 3 "Iteration 1"Outgoing:Change sets:(1018) *--@  "Changes to files in the client directory" 24-Jul-2012 11:>

关联

要将ID为1018的变更集与ID为117的工作项相关联,请使用以下命令:

lscm changeset associate -r SRV6 1018 117

结果显示“链接已创建”。

使用status命令时,注释如下所示:

Workspace: (1000) "MyWorkspace" <-> (1001) "BRM Stream"Component: (1005) "Build"Baseline: (1006) 3 "Iteration 1"Outgoing:Change sets:(1018) *--@  117 "Donors should have the ability to choose allocation o>

暂停

要挂起1018更改集,请输入以下命令:

lscm changeset suspend -r SRV6 1018

结果报告:

Change sets successfully suspended.

然后使用status命令时,注释如下所示:

Workspace: (1000) "MyWorkspace" <-> (1001) "BRM Stream"Component: (1005) "Build"Baseline: (1006) 3 "Iteration 1"Suspended:Change sets:(1018) ---@  117 "Donors should have the ability to choose allocation o>

恢复

挂起更改集后,可以使用以下命令将其恢复:

lscm changeset resume -r SRV6 1018

执行resume命令的结果如下所示,其中更改集的内容与相关的工作项一起显示:

Resuming change sets:
Repository: https://rational-srv-06:9443/ccm/
Workspace: (1000) "MyWorkspace"Component: (1005) "Build"Change sets:(1018) ---@  "Changes to files in …." 24-Jul-2012 11:21 AMChanges:---c- \Build\JKEBuildScripts\start\jke.client.windows.batWork items:(1019) 117 "Donors should have the ability to choose..."

提取

此命令从更改集中提取文件特定版本的内容,并将提取的内容加载到指定的磁盘路径上。 表8描述了该命令的参数,表9描述了命令选项。

lscm changeset extract [options] <change set> <path-to-item> <path-on-disk>

表8. changeset extract命令的参数

论据 描述
[options] 参见表9。
<change set> 变更集。 要指定更改集,请使用其别名或UUID [@repo]。
<path-to-item> 要提取的项目的路径或UUID。 如果指定了路径,并且更改集在本地存在,请使用当前工作目录中文件的相对路径。 如果指定了路径且更改集已传入,请使用沙箱根目录中文件的相对路径。
<path-on-disk> 提取的内容必须加载的路径。 该路径可以是当前工作目录的绝对路径或相对路径。
表9. changeset extract命令的选项
论据 描述
-d [--directory] arg 指定共享文件系统的根。
-o [--overwrite] 覆盖现有磁盘文件。

差异

这显示了在编辑过程中对文件所做的更改(斜体=变量):

lscm diff [options] aftertype afterselector [beforetype] [beforeselector]

表10中描述了该命令的参数,表11中描述了命令选项。

表10. diff命令的参数
论据 描述
aftertype 后状态要使用的项目类型(文件,工作空间,流,变更集)
afterselector 后状态项目的选择器
beforetype 用于之前状态的项目类型(工作区,流,基线,变更集)
beforeselector 之前状态的项目选择器
表11. diff命令的选项
论据 描述
-d [--directory] arg 指定共享文件系统的根目录。
-p [--fullpatch] 产生完整的Jazz补丁。
-w [--workspace] arg 显示历史记录的工作空间或流(名称,别名或UUID)。 如果省略此选项,则从本地文件系统推断工作空间。

例:

lscm diff file Build\JKEBuildScripts\start\jke.client.windows.bat baseline "Iteration 1"

与基线3中的文件状态相比,对文件进行上述本地比较更改的结果如下所示:

lscm diff -u -N Build/JKEBuildScripts
/start/jke.client.windows.bat Build/JKEBuildScripts/start/jke.client.windows.bat
--- Build/JKEBuildScripts/start/jke.client.windows.bat  2012-06-13 16:33:14.000000769+0100
+++ Build/JKEBuildScripts/start/jke.client.windows.bat  2012-07-24 10:58:50.000000343+0100
@@ -1,9 +1,10 @@
-@rem ***************************************************************************
+@rem **********************************************************************

注意:
连字符(-)显示已删除的行,加号(+)显示替换它的新行。

第二节高级命令

本节中提供的某些命令仅在用户使用产品一段时间后可能会遇到的特定情况下使用。 所有命令都包含用于说明特定方案的示例。 在上一部分中,Perl脚本提供了几个附加命令,该命令显示了如何满足客户将一组文件更改提取到临时位置的需求。 所提供的信息适用于Microsoft Windows和UNIX系统,并在必要时偶尔突出显示差异。

子命令摘要

表12的表中概述了本节中提供的子命令。后续部分中将显示常用命令及其常用参数和选项的详细信息。

表12.简短说明的子命令
命令 描述
接受 将更改集接受到远程工作空间中,然后下载更改。
注释 用更改历史记录注释文本文件的行,例如作者,时间戳,注释等。
变更权限 修改文件和文件夹的读取访问权限。
比较 比较工作空间,流,基线或快照的内容。
删除 删除存储库项目。
交付 将签入的更改从远程工作区传递到另一个工作区或流。
提取 从存储库中提取文件的特定版本。
救命 列出可用的子命令,并在每个子命令上提供详细的帮助。
历史 显示文件或组件的历史记录。
清单 列出存储库项目。 子命令:基线变更集组件凭证守护程序锁定projectareas属性remotefiles快照状态流teamarea用户工作区
撤消 撤消对文件的更改。

常用子命令的详细信息

本节中包含常用特定命令的更多详细信息。 每个子节都包含一个示例以及有关上下文的更多信息(如果适用)。

比较

比较工作空间,流,基线或快照的内容。

错误:未找到参考源中描述了命令的参数,错误:未找到参考源中描述了命令选项。

用:

lscm compare [options] <new-type> <new> <old-type> <old>

表13.比较命令参数

论据 描述
new-type, old-type 要从以下选项进行比较的新项目的类型:工作空间,流,基准或快照
new 比较新项目
old 旧项目与新项目进行比较
表14.比较命令选项
论据 描述
-c [--component] arg 基线比较的组件。 如果使用别名或UUID以外的其他参数指定基线,则为必填项。
-C [--format-contributor] arg 贡献者的格式。
{userid}扩展为用户的存储库ID
{name}扩展为用户名
{email}扩展到用户的电子邮件地址
{itemid}扩展为用户的存储库项目ID
-D [--format-date] arg 日期格式。 合法值可以在Java SimpleDateFormat规范中找到。
-f [--flow-directions] arg 仅显示给定方向的变化。 必须为以下之一:

  • 我来了
  • 传出
  • b均为两者(默认)
-I [--include-types] arg 字母组合,指示要显示的项目:

  • d for-流向
  • c为组件
  • b为基线
  • w为工作项
  • s为变更集
  • f用于文件系统(默认值:dcbsw)
-P [--password] arg 存储库的密码。
-p [--prune] arg 修剪未更改或为空的项目。 可能包括:

  • d为空方向
  • c表示未更改的组件
-r [--repository-uri] arg 指定存储库位置的URI。
-S [--show] arg 指示应显示哪些可选值。

  • c导致显示贡献者字段
  • d导致显示日期字段
  • 我使工作项显示在变更集下
-u [--username] arg 存储库的用户名。
-w [--reroot] arg 特定节点类型下的根工作项。 必须是以下指标之一:

  • r表示根
  • d表示方向
  • c为组件
  • b为基线

在下面的示例中,比较了两个流,并列出了来自两个流的更改:

lscm compare -c "Banking Logic" -f b -r SRV6 stream "BRM Stream" stream "BRM Code
Coverage Stream"

结果是:

Outgoing ChangesComponent (1002) "Banking Logic"Component (1005) "Build"Component (1017) "C# Samples" (added)Component (1007) "C# UI"Component (1009) "Database"Component (1011) "Java UI"Component (1013) "Prerequisites"Component (1015) "Web UI"
Incoming ChangesComponent (1002) "Banking Logic"(1020) Mark Roberts <mark@rational.com> 121: Add support ... analysis Component (1005) "Build"(1021) Mark Roberts <mark@rational.com> 121 Add support ... analysisComponent (1007) "C# UI"Component (1009) "Database"(1022) Mark Roberts <mark@rational.com> 121: Add support ... analysisComponent (1011) "Java UI"(1023) Mark Roberts <mark@rational.com> 121: Add support ... analysisComponent (1013) "Prerequisites"(1024) Mark Roberts <mark@rational.com> 121: Add support ... analysisComponent (1015) "Web UI"(1025) Mark Roberts <mark@rational.com> 121: Add support ... analysis

注意:

使用–f选项可以将显示限制为仅传入或传出更改。 变化流的方向是这样的:“传入”是指从旧流到新流的变化。

在以下示例中,将比较两个流。 列出了需要发送到每个流的更改。 限制仅用于显示变更集,过滤器用于显示交付变更集的人的全名。

lscm compare -c "Banking Logic" -f b -I s -C {name} -r SRV6 stream "BRM Stream" stream
"BRM Code Coverage Stream"

结果如下所示:

(1024) Mark Roberts <No comment> 2012/07/25
(1022) Mark Roberts <No comment> 2012/07/25
(1023) Mark Roberts <No comment> 2012/07/25
(1025) Mark Roberts <No comment> 2012/07/25
(1021) Mark Roberts <No comment> 2012/07/25
(1020) Mark Roberts <No comment> 2012/07/25

也可以将流与工作空间进行比较。

接受

将更改集接受到工作空间中,然后下载更改。

默认行为是接受所有组件中的所有更改。 但是,可以使用更改集ID或工作项编号来选择更改的子集,如下面的选项部分所述。 表15中描述了命令选项。

表15. accept命令选项
论据 描述
-b [--baseline] 指示应接受给定的基准。
-C [--components] 接受指定组件中的所有更改。
-c [--changes] 指示要接受的特定更改集。
-o [--overwrite-uncommitted] 即使存在未提交的本地更改,也请运行接受 。 可能导致内容覆盖。
-s [--source] arg 选择要从中进行更改的源工作区。
-t [--target] arg 选择更改将流入的目标工作空间或流。

这是accept命令的示例,用于接受与当前目录关联的工作空间中的所有传入更改:

lscm accept -r SRV6

accept命令的结果如下所示,其中显示了接受的变更集的内容:

Repository: https://rational-srv-06:9443/ccm/
Workspace: (1000) "MyWorkspace"Component: (1002) "Banking Logic"Change sets:(1004) ---$  "<No comment>" 19-Jul-2012 04:07 PMChanges:---c- \Banking Logic\...\AccountBean.java---c- \Banking Logic\JKEBusinessData\...\ContributionBean.javaWork items:(1027) 52 "Implement - Donor Dividend Allocation Criteria"

交付

从源工作区到目标流提供更改。

默认行为是交付所有组件中的所有更改。 但是,可以使用更改集ID或工作项编号来选择更改的子集,如以下选项部分所述。 表16中描述了命令选项。deliver命令执行已在项目配置中打开的所有过程验证步骤。 例如,如果启用了过程验证的一部分,则该命令将验证适当的工作项已与更改集相关联。

表16.传递命令选项
论据 描述
-C [--components] 应交付更改的组件
-c [--changes] 指示要交付的指定变更集
-s [--source] arg 选择要从中进行更改的源工作区/流
-t [--target] arg 选择更改将流向的目标工作空间/流

在与当前目录关联的工作空间中传递所有传出更改的交付命令示例:

lscm deliver -r SRV6

交付命令的结果如下所示,其中显示了交付的变更集的内容:

Delivering changes:Repository: https://rational-srv-06:9443/ccm/Workspace: (1001) "BRM Stream"Component: (1005) "Build"Change sets:(1018) ---$  "Changes to files in ... directory" 25-Jul-2012 05:51 PMChanges:---c- \Build\JKEBuildScripts\start\jke.client.windows.batWork items:(1019) 117 "Donors should have the ability to choose..."
Deliver command successfully completed.

历史

显示文件或组件的历史记录。

除非指定了特定的文件名,否则默认行为是显示组件的更改集或工作项历史记录。

如果命令是从工作空间的根目录执行的,则它将没有任何组件上下文。 因此,有必要将目录更改为特定组件的加载目标位置。

lscm history

在作为特定目录的加载目标的目录中执行时,显示以下结果:

Change sets:(1004) ---$ Mark Roberts “File changes for demonstration" 19-Jul-2012 04:07 PM(1031) ---$ Deb "Add WAR packaging for server, ... " 13-Jun-2012 11:12 AM(1032) ---$ Deb "Donors Can Choose to Support an ..." 11-Jun-2012 02:30 PM(1033) ---$ Deb "Dividend Allocation by ..." 08-Jun-2012 03:36 PM(1034) ---$ Bob "Donors will receive confirmation..." 06-Jun-2012 03:42 AM(1035) ---$ Marco "Donors Can Choose to Support..." 03-Jun-2012 05:51 AM(1036) ---$ Deb "Allocate Dividends by Percentage ..." 01-Jun-2012 11:54 PM
There is additional history available before this point.

上面的最后一行显示可能还有其他更改要报告。 默认行为是最多显示十个更改,但是如果需要更多更改,可以使用–m <n>选项来指定所需的更改,例如:

lscm history -m 2

结果显示:

Change sets:(1004) ---$ Mark Roberts “File changes for demonstration" 19-Jul-2012 04:07 PM(1031) ---$ Deb "Add WAR packaging for server, ... " 13-Jun-2012 11:12 AM
There may be additional history before this point.

使用–v选项进行更详细的输出会导致报告每个更改集中包含的实际文件:

lscm history -v
Change sets:(1033)  ---@ Mark Roberts <No comment>Changes:---c- /.../ClientLoginAccountType.java(1022)  ---$ Mark Roberts "change to client login account type code"Changes:---c- /.../ClientLoginAccountType.java(1031)  ---$ Mark Roberts <No comment>Changes:---c- /.../Adjustments.java---c- /.../GmItemType.java--c- /.../Group.java

当用于报告特定文件时,该命令将显示包含指定文件的更改集,例如:

lscm history java/src/com/client/ClientLoginAccountType.java
Change sets:(1033)  ---@ Mark Roberts <No comment>(1022)  ---$ Mark Roberts "change to client login account type code"(1025)  ---$ Mark Roberts "Share projects"

清单

列出存储库项目。

表17中详细说明的子命令标识了要列出的特定数据。

表17. list命令的子命令
子指令 描述
基线 列出基准
变更集 列出变更集中的变更
组件 列出工作区或流中的组件
证书 列出scm登录存储的凭据
守护程序 列出用户当前正在运行的守护程序
列出流中持有的锁
项目区域 列出项目领域
属性 列出当前在文件或文件夹上设置的属性
远程文件 显示远程工作空间的文件树
快照 列出与工作区或流关联的快照
状态 列出变更集中的变更状态
列出贡献者团队区域的流
团队区域 列出团队区域
使用者 列出用户
工作区 列出远程工作区

基线

列出基准示例:

lscm list baselines -w MRCL

上面的命令列出了特定工作空间引用的所有组件的基准:

Component: (1010) "Comp2"Baseline: (1016) 1 "Initial Baseline"   "Initial Baseline ....
Component: (1013) "Comp3"Baseline: (1017) 1 "Initial Baseline"   "Initial Baseline ....
Component: (1001) "Comp1"Baseline: (1034) 3 "Baseline 3"   Mark Roberts  Dec 25, 2011 12:35:53 AMBaseline: (1012) 2 "Baseline 2"   Mark Roberts  Dec 20, 2011 2:53:41 PMBaseline: (1002) 1 "Initial Baseline"   "Initial Baseline ....

以下命令仅列出指定组件的基准:

lscm list baselines -C "C# UI"

结果如下所示:

Component: (1007) "C# UI"Baseline: (1037) 6 "jke.dev_I20120621-1428"   "Snapshot created by Baseline: (1038) 5 "jke.dev.vs_I20120615-1311"   "Snapshot created byBaseline: (1008) 4 "Sprint 1 (Release 1.0)"   ""  Deb  Jun 13, 2012 4:33:31 PMBaseline: (1039) 3 "Week 2 (Sprint 1, Release 1.0)"   ""  Baseline: (1040) 2 "Week 1 (Sprint 1, Release 1.0)"   Baseline: (1041) 1 "Initial Baseline"   "Initial Baseline of Component C# UI

注意:

上面的某些命令出于可读性而被缩短。

以下命令列出了基线,并包括每个基线的唯一标识符:

lscm --show-uuid y list baseline -C "Banking Logic"

结果是这样的:

Baseline: (1042:_U68PZ9GrEeGtvtbgcxt9lw) 10 "jke.dev_I20120719-1609"   Baseline: (1043:_7X4wssUZEeGQS6A_L8KiKQ) 9 "jke.dev_I20120703-1618"   Baseline: (1044:_wFAXBMHTEeGQS6A_L8KiKQ) 8 "jke.dev_I20120629-1218"   Baseline: (1045:_dHyFErueEeGTsLA1UYI2LA) 7 "jke.dev_I20120621-1441"   Baseline: (1046:_wspLM7VkEeGs1coIrWWWhA) 6 "Week 1 (Sprint 2, Release 1.0)"   Baseline: (1003:_wIIwCLVkEeGs1coIrWWWhA) 5 "Iteration 1"   Baseline: (1047:_v7eM5bVkEeGs1coIrWWWhA) 4 "Sprint 1 (Release 1.0)"  Baseline: (1048:_vgDcX7VkEeGs1coIrWWWhA) 3 "Week 2 (Sprint 1, Release 1.0)"  Baseline: (1049:_vRc_hbVkEeGs1coIrWWWhA) 2 "Week 1 (Sprint 1, Release 1.0)"  Baseline: (1050:_prYH5bVkEeGs1coIrWWWhA) 1 "Initial Baseline"

UUID值是本文档中描述的后续命令所必需的。

远端档案

要列出存储在存储库中的文件,请对list命令使用remotefiles选项。 表18中描述了该命令的参数,表19中描述了命令选项。

lscm list remotefiles [options] <selector> <component> [remotePath]

表18.列出远程文件命令参数

论据 描述
[options] 请参阅表19。
<selector> 要列出其远程文件的工作空间,流,快照或基准(名称[@repo],别名或UUID [@repo])。
-workspace,-snapshot或--baseline。 默认情况下,选择器将引用工作空间。
<component> 列出远程文件的组件。
[remote path] 指定列表根目录的远程路径。
表19.列出远程文件命令选项
论据 描述
-b [--baseline] 指示选择器引用基线。
-s [--snapshot] 指示选择器引用快照。
-w [--workspace] 指示选择器引用工作空间或流。

在Banking Logic组件的指定基准处列出远程文件的完整层次结构。

lscm list remotefiles -r SRV6 --depth - --baseline "jke.dev_I20120719-1609" "BankingLogic"

命令的结果如下所示:

/
/JKEBusinessData/
/JKEBusinessData/src/
/JKEBusinessData/src/com/
/JKEBusinessData/src/com/jke/
/JKEBusinessData/src/com/jke/beans/
/JKEBusinessData/src/com/jke/beans/ContributionBean.java
/JKEBusinessData/src/com/jke/beans/AccountTypeBean.java
/JKEBusinessData/src/com/jke/beans/TransactionBean.java
/JKEBusinessData/src/com/jke/beans/AccountBean.java
/JKEBusinessData/src/com/jke/beans/UserBean.java

要执行与上述相同的命令,但列出每个文件和目录的唯一标识符:

lscm --show-uuid y list remotefiles -r SRV6 --depth - --baseline "jke.dev_I20120719-1609"
"Banking Logic"

命令的结果如下所示:

(_poP7UbVkEeGs1coIrWWWhA:_poP7VLVkEeGs1coIrWWWhA) /
(_tcoL5rVkEeGs1coIrWWWhA:_tj7GsLVkEeGs1coIrWWWhA) /JKEBusinessData/
(_tdE30rVkEeGs1coIrWWWhA:_tj7GxrVkEeGs1coIrWWWhA) /JKEBusinessData/src/
(_tdOBwbVkEeGs1coIrWWWhA:_tj7GybVkEeGs1coIrWWWhA) /JKEBusinessData/src/com/
(_tdXywLVkEeGs1coIrWWWhA:_tj7GzLVkEeGs1coIrWWWhA) /JKEBusinessData/src/com/jke/
(_tdXyw7VkEeGs1coIrWWWhA:_tj7Gz7VkEeGs1coIrWWWhA) /JKEBusinessData/src/com/jke/beans/
(_tdqtsrVkEeGs1coIrWWWhA:_gRyoVNGqEeGtvtbgcxt9lw) /JKEBusinessData/src/com/jke/beans
/ContributionBean.java
(_tdg8tLVkEeGs1coIrWWWhA:_XtUc-7udEeGTsLA1UYI2LA) /JKEBusinessData/src/com/jke/beans
/AccountTypeBean.java
(_td0esLVkEeGs1coIrWWWhA:_vnDcF7VkEeGs1coIrWWWhA) /JKEBusinessData/src/com/jke/beans
/TransactionBean.java
(_tdg8sLVkEeGs1coIrWWWhA:_s8Hl8tGqEeGtvtbgcxt9lw) /JKEBusinessData/src/com/jke/beans
/AccountBean.java
(_td0etLVkEeGs1coIrWWWhA:_tj7G8rVkEeGs1coIrWWWhA) /JKEBusinessData/src/com/jke/beans
/UserBean.jav

本指南中描述的后续命令需要UUID值。 通过检查特定示例来解释UUID字段。 上述命令中列出的AccountTypeBean.java文件为:

(_tdg8tLVkEeGs1coIrWWWhA:_XtUc-7udEeGTsLA1UYI2LA) /JKEBusinessData/src/com/jke/beans/
AccountTypeBean.java

UUID的第一部分(_tdg8tLVkEeGs1coIrWWWhA)标识对象。 对于报告此特定文件的所有命令,该命令均保持相同。

UUID的第二部分(_tdg8tLVkEeGs1coIrWWWhA)是版本选择器,它随着文件的发展而变化。

该文件的历史记录显示以下内容:

lscm history -r SRV6 JKEBusinessData/src/com/jke/beans/AccountTypeBean.java

命令的结果如下所示:

Change sets:(1030) ---$ Mark Roberts "<No comment>" 21-Jun-2012 02:37 PM(1051) ---$ Deb "Share projects" 01-Jun-2012 03:51 AM

上面的输出显示该文件在6月1日凌晨03:51共享为一个新对象,然后在6月21日下午2:37对文件进行了后续更改。

组件的基准线创建活动列表显示以下结果:

lscm list baselines -C "Banking Logic"

命令的结果如下所示:

Component: (1002) "Banking Logic"Baseline: (1042) 10 "jke.dev_I20120719-1609"   Jul 19, 2012 4:09:17 PMBaseline: (1043) 9 "jke.dev_I20120703-1618"    Jul 3, 2012 4:18:14 PMBaseline: (1044) 8 "jke.dev_I20120629-1218"     Jun 29, 2012 12:18:20 PMBaseline: (1045) 7 "jke.dev_I20120621-1441"       Jun 21, 2012 2:41:43 PMBaseline: (1046) 6 "Week 1 (Sprint 2 ... ) "       Jun 13, 2012 4:33:36 PMBaseline: (1003) 5 "Iteration 1"               Jun 13, 2012 4:33:32 PMBaseline: (1047) 4 "Sprint 1 (Release 1.0)"    Jun 13, 2012 4:33:31 PMBaseline: (1048) 3 "Week 2 (Sprint 1, ... ) "  Jun 13, 2012 4:33:28 PMBaseline: (1049) 2 "Week 1 (Sprint 1, ... ) "  Jun 13, 2012 4:33:27 PMBaseline: (1050) 1 "Initial Baseline"          Jun 13, 2012 4:32:48 PM

因此,该文件应在所有基准(直到基准7)(jke.dev_I20120621-1441)中报告相同的版本信息,然后在基准7上及其之后报告不同但一致的版本标识符。

基线7之前

lscm --show-uuid y list remotefiles -r SRV6 --depth - --baseline "Sprint 1 (Release 1.0)"
"Banking Logic" JKEBusinessData/src/com/jke/beans/AccountTypeBean.java

命令的结果如下所示:

(_tdg8tLVkEeGs1coIrWWWhA:_tj7G3bVkEeGs1coIrWWWhA)
/JKEBusinessData/src/com/jke/beans/ AccountTypeBean.java

基线7之前

lscm --show-uuid y list remotefiles -r SRV6 --depth - --baseline "Iteration 1" "BankingLogic" JKEBusinessData/src/com/ jke/beans/AccountTypeBean.java

命令的结果如下所示:

(_tdg8tLVkEeGs1coIrWWWhA:_tj7G3bVkEeGs1coIrWWWhA) /JKEBusinessData/src/com/jke/beans/
AccountTypeBean.java

在基线7

lscm --show-uuid y list remotefiles -r SRV6 --depth - --baseline "jke.dev_I20120621-1441""Banking Logic" JKEBusinessData/src/com/jke/beans/AccountTypeBean.java

命令的结果如下所示:

(_tdg8tLVkEeGs1coIrWWWhA:_XtUc-7udEeGTsLA1UYI2LA) /JKEBusinessData/src/com/jke/beans/
AccountTypeBean.java

基线7之后

lscm --show-uuid y list remotefiles -r SRV6 --depth - --baseline "jke.dev_I20120629-1218""Banking Logic" JKEBusinessData/src/com/jke/beans/AccountTypeBean.java

命令的结果如下所示:

(_tdg8tLVkEeGs1coIrWWWhA:_XtUc-7udEeGTsLA1UYI2LA) /JKEBusinessData/src/com/jke/beans/
AccountTypeBean.java

状态

列出更改集中的更改状态。

在许多开发人员活动中,同一文件将在同一变更集的管理下多次签入到存储库中。 典型的开发人员操作通常涉及图2所示的阶段。

图2.一个示例编辑,签入,构建和交付过程

在图2中,有五个单独的签入操作。 在开发人员已打开自动签入的情况下,每个保存操作都会有一个签入 (如果通过图形用户界面Eclipse执行)。 因此,偶尔删除某些历史签入版本可能会很有用。

列出文件的状态是删除版本的第一步。 这是与lscm status命令结合完成的。

lscm status命令将列出已执行签入操作的更改集。

lscm status

命令的结果如下所示:

Workspace: (1000) "MyWorkspace" <-> (1001) "BRM Stream"Component: (1017) "C# Samples"Baseline: (1056) 2 "Baseline 1"Outgoing:Change sets:(1057) *--@  "<No comment>" 26-Jul-2012 08:32 PM

上面列出了更改集ID – 1057。

现在,可以将列表状态命令与更改集ID一起用作参数:

lscm list states 1057

命令的结果如下所示:

(1058) /C# Samples/Attributes/not-needed.html(1059) Initial 26-Jul-2012 07:31 PM(1060) Modified 26-Jul-2012 07:31 PM(1061) Modified 26-Jul-2012 07:32 PM(1062) Current - Modified 26-Jul-2012 07:32 PM

如有必要,现在可以使用本文档后面介绍的lscm delete state-content命令删除中间版本。

撤消

此命令撤消对文件的更改,以取消工作空间中未解决的更改。

在此示例中,undo命令用于撤消对特定文件的更改(缩短路径):

lscm undo "C:\workspace\Banking Logic\........\organization.java"

这导致以下响应:

Changes successfully undone.

提取

从存储库中提取内容。

此命令要求使用唯一标识符,以确保从存储库中提取具有正确版本的正确文件。 上面描述的lscm list remote files命令可以生成此命令所需的信息。 表20中描述了该命令的参数,表21中描述了命令选项。

lscm extract file [options] <item> <state> <path-on-disk>

表20.解压缩文件命令参数

论据 描述
[options] 请参阅表21。
<item> 要提取的项目的项目ID。 仅支持UUID格式。
<state> 要提取的项目的状态ID。 仅支持UUID格式。
<path-on-disk> 提取的内容必须加载的路径。 该路径可以是当前工作目录中的绝对路径或相对路径。
表21.提取文件命令选项
论据 描述
-o [--overwrite] 覆盖现有磁盘文件。

使用下面显示的list remotefiles命令显示UUID信息后,可以将文件的副本提取到新位置。

lscm --show-uuid y list remotefiles -r SRV6 --depth - --baseline "jke.dev_I20120629-1218""Banking Logic" JKEBusinessData/src/com/jke/beans/AccountTypeBean.java

命令的结果如下所示:

(_tdg8tLVkEeGs1coIrWWWhA:_XtUc-7udEeGTsLA1UYI2LA) /JKEBusinessData/src/com/jke/beans/
AccountTypeBean.java

使用以下命令解压缩文件:

lscm extract file -r SRV6 _tdg8tLVkEeGs1coIrWWWhA _XtUc-7udEeGTsLA1UYI2LA c:\temp\
AccountTypeBean.java

命令的结果如下所示:

Successfully extracted file to "C:\temp\AccountTypeBean.java".

注释

此命令注释文本文件的行,例如作者,时间戳和注释。

以下命令显示了如何为Java文件生成带注释的信息:

lscm annotate /JKEBusinessData/src/com/jke/beans/AccountTypeBean.java

命令的结果如下所示:

1  Deb          (1051) 2012-06-01 03:51 AM    Share projects /*********
2  Mark Roberts (1030) 2012-06-21 02:37 PM 90
3  Deb          (1051) 2012-06-01 03:51 AM    Share projects  *
4  Deb          (1051) 2012-06-01 03:51 AM    Share projects  ********
5  Deb          (1051) 2012-06-01 03:51 AM    Share projects
6  Deb          (1051) 2012-06-01 03:51 AM    Share projects package com.jke.b
7  Deb          (1051) 2012-06-01 03:51 AM    Share projects
8  Deb          (1051) 2012-06-01 03:51 AM    Share projects public enum Acco
9  Deb          (1051) 2012-06-01 03:51 AM    Share projects    Checking(

在上面提供的数据中,“共享项目”一词是指最初将内容共享到Rational Team Concert中时的变更集标识符。 该文件的实际代码显示在本节的右侧,但是为了避免换行,该文件已被截断。 第2行中的数字90标识与产生变更的变更集相关联的工作项目。 在此示例中,该行已从文件中删除。

删除

此命令删除存储库中的项目。

该命令用于删除中间签入操作的内容,如有关lscm list status命令的部分所述。 表22中描述了该命令的参数,表23中描述了命令选项。

lscm delete state-content [options] <item> <states...>

表22. delete state-content命令参数

论据 描述
[options] 参见表23。
<item> The item for which the specified states are deleted. To specify the item, use its path[@repo], alias, or UUID[@repo]. If you specify the path, it must be within the sandbox.
<state> The states to delete. To specify a state, use its alias or UUID.
Table 23. delete state-content command options
Argument 描述
--force Force deletion even if multiple items reference the content.

Identify the change set number.

lscm status

The result of the command is shown below:

Workspace: (1000) "MyWorkspace" <-> (1001) "BRM Stream"Component: (1017) "C# Samples"Baseline: (1056) 2 "Baseline 1"Outgoing:Change sets:(1057) *--@  "<No comment>" 26-Jul-2012 08:32 PM

The change set ID is listed above – 1057.

The list states command can now be used with the change set ID as an argument:

lscm list states 1057

The result of the command is shown below:

(1058) /C# Samples/Attributes/not-needed.html(1059) Initial 26-Jul-2012 07:31 PM(1060) Modified 26-Jul-2012 07:31 PM(1061) Modified 26-Jul-2012 07:32 PM(1062) Current - Modified 26-Jul-2012 07:32 PM

To remove the intermediate content produced on the 26 July at 7:31 pm, use the command:

lscm delete state-content 1058 1060

The result of the command is shown below:

Successfully deleted content of the item state(s). Now the list states command will showthe removal of the content: lscm list states 1057

The result of the command is shown below:

(1058) /C# Samples/Attributes/not-needed.html(1059) Initial 26-Jul-2012 07:31 PM(1060) Modified [Content deleted by mark on 26-Jul-2012 09:36 PM(1061) Modified 26-Jul-2012 07:32 PM(1062) Current - Modified 26-Jul-2012 07:32 PM

help

Display command help.

例如:

lscm help create

This will result in the subcommands of the create command being displayed:

Help on create
Creates items in the repository. You can create different items, as specified bysubcommands.
Aliases: cr
Usage: lscm create <baseline|changeset|component|loadrules|snapshot|stream|workspace>[subcommand-args]
Subcommands:baseline - Creates a baseline in a component.changeset - Creates a change set.component - Creates a component within the specified workspace or stream.loadrules - Creates load rules.snapshot - Creates a snapshot that is associated with the workspace or stream.stream - Creates a stream.workspace - Creates a remote repository workspace.

To display help on a specific subcommand, use:

lscm help create baseline

changeaccess

This modifies the read access permissions for files and folders.

The read access can also be set to a contributor, team area or project area. Arguments for the command are described in Table 24, and command options are described in Table 25.

lscm changeaccess [options] <item...>

Table 24. changeaccess command arguments

Argument 描述
[options] See Table 25.
<item...> The path of the item for which read access permission is modified. The path might be a file system path to locally loaded items, or it might be a remote path. If you specify a remote path, you must also specify the workspace/stream and the component.
Table 25. changeaccess command options
Argument 描述
--apply-to-child-items Indicates that the modified read access permission must be applied to child files and folders.
--componentaccess Everyone who can access the component has read access.
--contrib arg Only the contributor has read access.
--projectarea arg Everyone who has access to the project area.
--teamarea arg Everyone who has access to the team area.
-C [--component] arg The component to select. Specify the name, alias, or UUID of the component.

To hide a particular file such that it is only visible to a certain team:

lscm changeaccess --teamarea "Energy Efficiency Matters" description\descriptionframe.html

The result of the command is:

Successfully changed read access permissions.

When a new user who is not a member of the Energy Efficiency Matters team loads the workspace, the file is not present.

resolve

Resolve workspace conflicts.

Arguments for the command are described in Table 26.

lscm resolve [options] <path...>

Table 26. resolve arguments

Argument 描述
-c {--checkin] Resolves conflicts by using the currently checked in version.
-p [--proposed] Resolves conflicts by using the proposed version.
-o [--overwrite-uncommitted] Continues with the operation even if uncommitted local changes exist. If you use this option, changes might be overwritten.

To illustrate the use of the resolve command, a conflict situation is required. A change was performed using the Rational Team Concert shell interface, using Workspace A, and the change was delivered. In Workspace B, the main workspace for the examples in this document, a change was also made to the same file in the same lines of code to cause a conflict.

The lscm status command shows the change within the current workspace and the incoming change from Workspace A.

Workspace: (1064) "BRM Stream Workspace" <-> (1001) "BRM Stream"Component: (1002) "Banking Logic"Baseline: (1003) 5 "Iteration 1"Outgoing:Change sets:(1066) *--@  "<No comment>" 09-Aug-2012 04:53 PMIncoming:Change sets:(1065) ---$  128 "Create a conflicted change" - "<No comment>" 09-Aug-2>

When the accept command is issued, the warning concerning the conflict is displayed.

lscm accept

The result of the command is shown below:

Repository: https://rational-srv-06:9443/ccm/
Workspace: (1064) "BRM Stream Workspace"Component: (1002) "Banking Logic"Change sets:(1065) --#$  "<No comment>" 09-Aug-2012 04:50 PMChanges:-#-c- \JKEBusinessLogic\src\com\jke\organization\Organization.javaWork items:(1074) 128 "Create a conflicted change"
Following workspaces still have conflicts after accept:BRM Stream Workspace
Run 'lscm resolve' or 'lscm conflicts' or 'lscm status' for help in resolving theconflicts.

After the accept command, the lscm status command reports the files that have a conflict:

Workspace: (1064) "BRM Stream Workspace" <-> (1001) "BRM Stream"Component: (1002) "Banking Logic"Baseline: (1003) 5 "Iteration 1"Conflicts:Cc- /JKEBusinessLogic/src/com/jke/organization/Organization.java (Modifie>Outgoing:Change sets:(1066) *--@  "<No comment>" 09-Aug-2012 04:53 PM

To resolve the conflict using the checked-in version created in Workspace B, where the changes have been made to the file, use the command:

lscm resolve -c Organization.java

The result of the command is shown below:

Conflicted items have been successfully resolved.

To resolve the conflict by using the accepted change, which will overwrite the changes made within the current workspace, use this command:

lscm resolve -p Organization.java

The result of the command is shown below:

Conflicted items have been successfully resolved.

snapshot

Promote a snapshot to a workspace or stream.

Arguments for the command are described in Table 27.

lscm snapshot promote [options] <workspace> <snapshots...>

Table 27. snapshot promote arguments

Argument 描述
<workspace> The target workspace or stream. To specify the workspace or stream, use its name[@repo], alias, or UUID[@repo].
<snapshots ...> The snapshots to be owned by the workspace or stream. To specify a snapshot, use its name[@repo], alias, or UUID[@repo].

Previously documented, the lscm list snapshot command will be useful in this scenario to list snapshots and the lscm list streams command to list the streams.

To list the snapshots, use:

lscm list snapshot

The result of the command is shown below:

(1078) "jke.dev_I20120802-1328" Aug 2, 2012 1:28 PM
(1079) "jke.dev_I20120723-0849" Jul 23, 2012 8:49 AM
(1080) "jke.dev_CC_I20120722-2020" Jul 22, 2012 8:20 PM
(1081) "jke.dev_I20120721-0908" Jul 21, 2012 9:09 AM
(1082) "jke.dev_I20120719-1609" Jul 19, 2012 4:09 PM
(1083) "jke.dev_I20120719-1407" Jul 19, 2012 2:07 PM

To list possible target streams use the command:

lscm list streams --projectarea "JKE Banking (Change Management)" -r SRV6

The result of the command is shown below:

(1088) "BRM Code Coverage Stream" JKE Banking (Change Management)
(1001) "BRM Stream" Business Recovery Matters
(1089) "EEM Stream" Energy Efficiency Matters
(1090) "JKE Banking Integration Stream" JKE Banking (Change Management)
(1091) "Production Stream" Release Engineering
(1092) "QA Maintenance Stream" Release Engineering
(1093) "QA Stream" Release Engineering
(1094) "RelEng Stream " Release Engineering

To promote two snapshots to a new stream, use:

lscm snapshot promote "JKE Banking Integration Stream" "jke.dev_I20120802-13 28""jke.dev_I20120723-0849"

The result of the command is shown below:

Promoted snapshots: jke.dev_I20120802-1328 jke.dev_I20120723-0849

version

List the version identifier of the currently installed Rational Team Concert command line tools.

lscm version

The result of the command is shown below:

Build Id: (unset)
com.ibm.team.filesystem.cli.client, version 3.1.0.v20120519_2357Subcommands: ...
com.ibm.team.filesystem.cli.tools, version 3.1.0.v20120510_0526Subcommands: tools.verify tools.validate tools.echo.stdin tools.configvalue tools.log
com.ibm.team.filesystem.cli.core, version 3.1.0.v20120519_2357Subcommands: help version

lastmod

Calculates the time of most recent modification, based on the latest baselines that modified the given folders.

Arguments for the command are described in Table 28, and command options are described in Table 29.

lscm lastmod [options] <path...>

Table 28. lastmod command arguments
Argument 描述
[options] See Table 29.
<path...> A list of folders for which to calculate the time of most recent modification.
Table 29. lastmod command options
Argument 描述
-d [--directory] arg Specifies the root of the shared file system.
-f [--format] arg A date formatter that formats the return date. The default is yyyyMMddmm. For example: 200801011131. For details of the date formats, see the Class SimpleDateFormat documentation cited in Related topics .

To list the last modification date, due to a baseline change, use the command below for two top-level directories under a workspace:

lscm lastmod "Banking Logic" "C# Samples"

The result of the command is shown below:

/C# Samples=201207260820
/Banking Logic=201206130433

This is an example of using the format argument described at the web page referenced above:

lscm lastmod -f "dd MMMM yyyy 'at' HH:mm:ss" "Banking Logic" "C# Samples"

The result of the command is shown below:

/Banking Logic=13 June 2012 at 16:33:32
/C# Samples=26 July 2012 at 20:20:28

lock

Acquires or releases the locks in a stream.

A lock prevents other users from delivering changes to the file on the stream for which you hold the lock. Sub-commands for the command are described in Table 30.

lscm lock <acquire|list|release> [subcommand-args]
Table 30. lock subcommands
Argument 描述
acquire Acquires the lock on a specified file in a stream.
list Lists the locks that are held in a stream. It is possible to filter the locks by component and user. If all arguments are omitted, the collaborating stream in the component that is identified by the current working directory is used. The output is formatted by the following information: The path source, which is Local, Remote, or Unknown; the path, which is <unknown> for paths that cannot be resolved; the lock owner's user ID; the component name; and the stream name.
release Releases the lock on a specified file in a stream.

lock list

The lock list command has several options, which are described in Table 31.

Table 31. lock list command options
Argument 描述
-c [--component] arg The component to select. Specify the name, alias, or UUID of the component.
-m [--maximum] arg The maximum number of results that can be returned. The number must be greater than 0. Default is 10.
-o [--owner] arg The user ID of the owner of the lock.
-s [--stream] arg Specifies a stream. To specify a stream, use its name[@repo], alias, or UUID[@repo].
-v [--verbose] Shows more information.
-w [--wide] Does not shorten output. If omitted, the width defaults to the value of the COLUMNS environment variable. If the COLUMNS environment variable is not set, the width defaults to 80 characters.

In the simplest format, the command can be used as shown here:

lscm lock list

The result of the command is shown below:

No locks to list.

lock acquire

The lock acquire command has two options, which are described in Table 32.

Table 32. lock acquire command options
Argument 描述
-R [--remotePath] Indicates that the provided paths are the remote paths in the specified component and specified stream.
-s [--stream] arg Specifies a stream, as indicated by the name[@repo], alias, or UUID[@repo]. If you use the --remotePath option, you must specify a stream.

In the simplest format, the command can be used as shown below to acquire a lock:

lscm lock acquire "C# samples\Attributes\description.html"

This is the result of the command:

Locks successfully acquired.

When the lock list command is used, the result is as shown below:

L (1063) "/C# Samples/Attributes/description.html" mark (1017) "C# Samples" (10>

When used with the –w option for a wide output the result (wrapped in this document), the result is as shown here:

L (1063) "/C# Samples/Attributes/description.html" mark (1017) "C# Samples"(1001) "BRM Stream"

lock release

The lock release command has several options, too, and as described in Table 33.

Table 33. lock release command options
Argument 描述
-f [--force] Forces the file to be unlocked with administrator privileges.
-R [--remotePath] Indicates that the provided paths are the remote paths in the specified component and specified stream.
-s [--stream] arg Specifies a stream, as indicated by the name[@repo], alias, or UUID[@repo]. If you use the --remotePath option, you must specify a stream.
-v [--verbose] Shows more information.
-w [--wide] Does not shorten output. If omitted, the width defaults to the value of the COLUMNS environment variable. If the COLUMNS environment variable is not set, the width defaults to 80 characters.

In the simplest format, the command can be used as shown to release a lock:

lscm lock release "C# samples\Attributes\description.html"

The result of the command is shown below:

Locks successfully released.

Administrator: Unlock a file

It might occasionally be necessary to release a lock held by someone else who has locked a file and then left for a period of absence. This requires administrative privileges and is used in the following way:

  1. Use the lscm lock list –w command to identify the lock and the stream for which the file is locked.
  2. Use the lscm lock release command to release a lock on a file by giving the file location and the stream for which it was locked.
lscm lock list –w

The result of the command is shown below:

L (1063) "/C# Samples/Attributes/description.html" mark (1017) "C# Samples"(1001) "BRM Stream"

The result above lists the full path, which includes a directory name to represent the component, the user who holds the lock, the component in which the file resides, and the stream for which the lock is held.

Therefore, the required unlock command is:

lscm lock release --force --remotePath "/Attributes/description.html" --stream"BRM Stream" --component "C# Samples"

The result of the command is shown below:

Locks successfully released.

property

Modifies the properties of a file or folder.

A number of standard properties are set on a file and additional properties can be set if required. Sub-commands are described in Table 34.

lscm property <sub-command>

Table 34. property subcommands

Subcommand 描述
get Gets the value of the property.
remove Removes the property.
set Sets the property with the specified value.

Four properties are set on all files and one on a directory. They are listed in the table in Table 35.

Table 35. file and directory properties
属性 Applicable to 描述
jazz.executable 文件 Indicates whether the file is executable. Cannot be directly modified.
jazz.mime 文件 The MIME type of the file, which must be of the form major/minor.
jazz.line-delimiter 文件 Indicates the line delimiter. Shall be one of the following types:

  • platform – Indicates that the file should be given the platform-specific line delimiter on the load or accept command.
  • none – Indicates that the file should not have its line delimiters changed on the load or accept command.
  • crlf – Indicates that the file should always have Windows-style line delimiters.
  • lf – Indicates that line feeds should be used as line delimiters.
  • cr – Indicates that carriage returns should be used as line delimiters.
jazz.read-access File and directory Indicates the access permission to a particular item. The access permission could be one of the following:

  • Public – Everyone who can access the component has read access.
  • Contributor – Only the contributor has read access.
  • Team area – Everyone who has access to the team area.
  • Project area – Everyone who has access to the project area.
jazz.encoding 文件 The character encoding of a file.

In addition, any arbitrary property can be set on a file or directory, as the example that follows shows.

The properties shown above can be viewed through the Eclipse user interface for Rational Team Concert by selecting a file or directory in the Project Explorer view, right-clicking a file, and then selecting Properties . Examples of the use of properties for a file are shown in Figures 3 and 4. The directory properties are presented in a similar manner, but there are fewer properties to display.

Figure 3 shows the Executable, MIME, and Line delimiter, and Figure 4 shows the character encoding of the file.

Figure 3. Eclipse view of the properties of a file, Part 1
Figure 4. Eclipse view of the properties of a file, Part 2

property get

The property get command has a number of options detailed in Table 36.

Table 36. property get command options
Argument 描述
<key> The key used to look up the property.
<files...> The files for which the property should be retrieved.

Examples below show the display of the five standard properties associated with a file.

lscm property get jazz.line-delimiter Organization.java

The result of the command is shown below:

C:\Users\...\JKEBusinessLogic\src\com\jke\organization\Organization.javajazz.line-delimiter - LF (Unix) lscm property get jazz.read-access Organization.java

The result of the command is shown below:

C:\Users\...\JKEBusinessLogic\src\com\jke\organization\Organization.javajazz.read-access - Public lscm property get jazz.encoding Organization.java

The result of the command is shown below:

C:\Users\...\JKEBusinessLogic\src\com\jke\organization\Organization.java jazz.encoding -Cp1252 lscm property get jazz.executable Organization.java

The result of the command is shown below:

C:\Users\...\JKEBusinessLogic\src\com\jke\organization\Organization.java jazz.executable -false lscm property get jazz.mime Organization.java

The result of the command is shown below:

C:\Users\...\JKEBusinessLogic\src\com\jke\organization\Organization.javajazz.mime - text/text

property set

The property set command has a number of options detailed in Table 37.

Table 37. property set command options
Argument 描述
<key> The key used to look up the property.
<Value> The value of the property.
<files...> The files for which the property should be retrieved.

An example below shows the setting of a custom property and then a get method of the property, too.

To set the property:

lscm property set Tested 'Yes' Organization.java

The result of the command is shown below:

Tested successfully set to 'Yes'

To validate that the property has been set:

lscm property get Tested Organization.java C:\Users\...\JKEBusinessLogic\src\com\jke\organization\Organization.java Tested - 'Yes'

property remove

Removes the property from the file or folder.

Command arguments are detailed in Table 38.

Table 38. property remove command options
Argument 描述
<key> The key used to look up the property.
<files...> The files for which the property should be removed

An example of the removal of a custom property is shown below:

lscm property remove Tested Organization.java

The result of the command is shown below:

Tested property successfully removed.

Section 3. Script scenario

The scenario presented in this section is based on a customer requirement to perform a specific operation. The customers' question was:

How can we compare two streams and physically download the different files into a temporary location?

Description of the operation

In the example, the streams to be compared are the BRM Stream (a development stream) and the JKE Banking Integration Stream (a protected stream to which changes are delivered when they have been through a phase of unit testing). System integration work is to be undertaken on the integration stream.

To compare the two streams, the lscm compare command is used. This allows a number of arguments to be used to restrict the information presented. It is possible that some work is being performed directly on the integration stream, but for the purpose of this example, only the change sets to flow from the BRM stream to the integration stream will be required. For this reason, the –fo for "outgoing flow" will be used, as shown below. Using the –pc option causes unchanged components to be missed from the report.

lscm compare stream "BRM Stream" stream "JKE Banking Integration Stream" -f o –p c

The result of the command is shown below:

Outgoing ChangesComponent (1002) "Banking Logic"(1030) Mark Roberts <mark@rational.com> 90: Complete ... Test 2012/06/21(1029) Mark Roberts <mark@rational.com> 90: Complete ... Test 2012/06/29(1028) Mark Roberts <mark@rational.com> 71: JKE Charity ... 2012/07/03(1004) Mark Roberts <mark@rational.com> 52: Implement - ... 2012/07/19(1065) Mark Roberts <mark@rational.com> 128: Create ... 2012/08/09(1066) Mark Roberts <mark@rational.com> 129: resolve conflict 2012/08/09(1076) Mark Roberts <mark@rational.com> 128: Create ... 2012/08/09(1077) Mark Roberts <mark@rational.com> 128: Create ... 2012/08/09Component (1005) "Build"(1095) Mark Roberts <mark@rational.com> 90: Complete ... 2012/07/02(1018) Mark Roberts <mark@rational.com> 117: Donors ... 2012/07/25Component (1017) "C# Samples" (added)Component (1007) "C# UI"(1096) Mark Roberts <mark@rational.com> 84: A simple change 2012/06/15(1097) Mark Roberts <mark@rational.com> 84: A simple change... 2012/06/15

Because the change set identifiers are all that are required from the above report, a Perl script is used to extract just that information. This task is a multi-step process; therefore, it is reasonable to wrap all of the commands into a single Perl script. Other scripting languages could be used, or compiled languages, such as Java.

The Perl script

The script collects three arguments from the user. The arguments are described in Table 39.

Table 39. Perl script arguments
Argument 描述
Stream 1 The first stream to use in the comparison. The flow that will be examined is from Stream 1 to Stream 2.
Stream 2 The second stream to use in the comparison.
Location The location in which the directories and files will be created.
Step 1
Create and execute a command to compare the two streams and then store the result in a variable. Split the result into an array that can then be processed.
Step 2
For each line of data from the compare command, the change set ID is extracted. This change set is then examined by using the lscm list changes command, and the results are stored in a variable.
Step 3
The results from the lscm list changes command are split into an array that can be processed, line by line, to extract the work item information and the change set content (the files to be extracted).
Step 4
The work items associated with the change set are displayed.
Step 5
For each file to be extracted, the location and filename are separated and the new location (based on the third argument) is constructed. A function is then used to validate the path, because the Rational Team Concert extract command will not create a full path to the file that is to be extracted.
Step 6
The appropriate extract command is then generated and executed.

The script is available in the Download section.

摘要

The IBM Rational Team Concert SCM command line is extensive and provides opportunities for the creation of repeatable sets of commands in scripts using a variety of scripting techniques.


翻译自: https://www.ibm.com/developerworks/rational/library/rational-team-concert-command-line-reference/index.html

适用于软件开发人员的Rational Team Concert命令行参考相关推荐

  1. 将Rational Software Architect与Rational Team Concert集成

    系统和企业领域中的大多数软件开发组织都意识到了模型驱动开发(MDD)和统一建模语言(UML)的优势,并通过使用IBM®Rational®Software Architect产品家族来利用它们. IBM ...

  2. 适用于Java开发人员的Elasticsearch:命令行中的Elasticsearch

    本文是我们学院课程的一部分,该课程的标题为Java开发人员的Elasticsearch教程 . 在本课程中,我们提供了一系列教程,以便您可以开发自己的基于Elasticsearch的应用程序. 我们涵 ...

  3. tsm linux文件备份命令,tsm 命令行参考

    此部分中的主题包括 Tableau 服务管理器 (TSM) 命令行界面 (CLI) 的参考内容,为 Tableau Server 提供支持. TSM 用于管理 Tableau Server 的安装和配 ...

  4. msbuild 语法_MSBuild 命令行参考

    为文件记录器和分布式文件记录器指定任何额外参数.Specifies any extra parameters for the file logger and the distributed file ...

  5. 惊艳的cygwin——Windows下的Linux命令行环境的配置和使用

    5年前倒腾过一次cygwin,当时体验感觉不好.到现在一直用的是GNU utilities for Win32,在Windows的CMD中使用*nix的命令工具包. GNU utilities for ...

  6. 使用命令行运行 jMeter 测试项目

    jMeter 不建议使用 GUI 模式运行性能测试. GUI 模式仅适用于创建测试项目或者调试. 命令行: jmeter -n -t jerrysandbox.jmx -l 11.txt 其中 -n ...

  7. php 开启命令模式,如何启用PhpStorm中的命令行工具

    本篇文章主要给大家介绍如何使用phpstorm中的命令行工具. PhpStorm下载地址: PhpStorm使用命令行工具,我们可以直接从IDE调用命令!在我们使用任何命令行工具之前,我们必须在设置中 ...

  8. php命令行用法简介

    Php是一个非常流行的web服务端脚本语言.其实,php不仅仅可以在web服务器中充当重要角色.在命令行一样可以执行. 本文中,笔者为各位介绍下php在命令行中的使用方法. 1.  查看php的版本. ...

  9. 服务器操作系统查询命令行,服务器操作系统查看命令行

    服务器操作系统查看命令行 内容精选 换一换 环境准备本手册介绍命令行方式的模型转换,如果用户想通过Mind Studio界面进行模型转换,则请参见Ascend 310 Mind Studio基本操作. ...

最新文章

  1. 算法笔记-图--bfs
  2. Mysql之增加数据_INSERT INTO
  3. Atcoder AGC031C Differ By 1 Bit (构造、二进制)
  4. 云计算时代,数据中心架构三层到大二层的演变
  5. [转]jQuery 读取 xml
  6. android 多线程封装,Android 线程池的封装
  7. python uiautomation_使用python UIAutomation从QQ2017(v8.9)群界面获取所有群成员详细资料,...
  8. PAIP.paip.手机离线ROOT过程总结
  9. 计算机流体仿真,ANSYS FLUENT 计算流体力学软件
  10. 我的世界高亮显示服务器,waila(我的世界高亮显示没了)
  11. 员工管理系统-SpringBoot+Vue入门小项目实战
  12. html编写红头文件
  13. 微信公众号运营实用小技巧分享
  14. 相机去畸变软件OCamCalib的使用方法
  15. 搞清楚php-FPM到底是什么?
  16. Linux rar unrar的安装
  17. 使用浏览器抓包获取API
  18. 美化html表格内容,css Javascript html表格美化
  19. python下载所有股票日交易数据
  20. 最全中国科学技术大学计算机学院课程资源!

热门文章

  1. 使用var、let、const声明变量
  2. 基于java(springboot)酒店民宿客房管理系统源码成品(java毕业设计)
  3. 手把手教你做接口测试
  4. calibrate sensors
  5. tcp timewait过多
  6. cesium 添加纽约城市模型
  7. java入门基础四(方法和数组)
  8. php 织梦模板 防盗,织梦dedecms商业教程 织梦DedeCMS模板防盗的四种方法
  9. 怎么玩转迷恋猫呢?---来源于godapp分析
  10. Kibana数据可视化工具配置与应用