在Clearcase中获取当前的工作视图 [英] Getting present working view in Clearcase
问题描述
我需要找到一个命令来从Clearcase获取活动视图名称,因此我可以询问用户是否要将其设置为默认路径。以下无效。
I need to find a command to get the active view name from Clearcase, so I can ask the user if they would like to set that as their default path. The following does not work. Any options besides this?
out, err = subprocess.Popen([r"cleartool", "xxx", "-xxxxx"],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE).communicate()
return out
推荐答案
cleartool pwv
仅会给您视图的名称。
要获取路径:
cleartool pwv
will only give you the name of the view.
To get the path:
cleartool pwv -root
G:\
可能表示快照视图,因为所有默认情况下,动态视图通常在驱动器 M:\
上安装(MVFS)(但它们也可以替换为驱动器号)。
对于快照视图,驱动器号不同于 C:\
表示快照视图的实际路径为 sub st
(Windows命令)到驱动器号以缩短其路径。
G:\
means probably a snapshot view, since all dynamic views are usually mounted (MVFS) on the drive M:\
by default (but they could be subst'ed to a drive letter as well).
For snapshot views, a drive letter different from C:\
means the actual path of the snapshot view has been subst
(Windows command) to a drive letter in order to shorten its path.
请参见 使用 subst
命令访问快照视图(Windows)
See "To use the subst
command to access snapshot views (Windows)"
分配快照用subst命令查看根目录到驱动器盘符的性能比使快照查看共享目录要好一些
Assigning a snapshot view root directory to a drive letter with the subst command provides slightly better performance than making the snapshot view a shared directory
在 G:\norbt5_ed_hil_dev
上,并想在 cleartool pwv
之后输入完整路径,可以:
So if you are on G:\norbt5_ed_hil_dev
and want the full path after a cleartool pwv
, you can:
cleartool pwv -root
如果仅返回 G:\
,则需要调用命令 subst
查看完整的
If that returns you only G:\
, then you need to call the commands subst
to see the full path where G:\
has been assigned.
subst
或者在python中(如在示例中):
Or, in python (as in the example):
os.system('subst')
然后解析结果。
注意:如 Python和ClearCase setview
, pwv
在动态视图从Unix上的 setview
开始(Windows上不存在 setview
),因为它会创建一个子进程。
如果您使用的是动态视图的Unix,请不要使用 setview
(因为在此处说明)。
始终使用 cleartool startview< view_tag>
,然后是动态视图的完整路径:
Note: As explained in "Python and ClearCase setview
", pwv
wouldn't work in a dynamic view started with setview
on Unix (setview
doesn't exist on Windows), because it creates a sub-process.
If you are on Unix working with dynamic view, don't use setview
(as illustrated here).
Always use cleartool startview <view_tag>
, and then the full path of the dynamic view:
/view/AViewName/vobs/aVob/...
A cleartool pwv -root
然后将返回 / view / AViewName
。
在Windows上,如果在动态视图中使用 cleartool pwv
,那么 cleartool pwv -short
返回的视图名称就足够了:
On Windows, if cleartool pwv
is used in a dynamic view, then the name of the view returned by cleartool pwv -short
is enough:
根文件夹的路径Windows上的动态视图始终是:
The path of the root folder of a dynamic view on Windows is always:
m:\view_tag
即使视图已经替换
到另一个驱动器盘符。
您不需要 -root
。
even if the view has been subst
to a different drive letter.
You don't need the -root
.
这篇关于在Clearcase中获取当前的工作视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!