在快照视图中查找文件的本地副本
我在一个工具中使用 ClearCase Automation Library (CAL),它可以帮助我跟踪未集成的更改;现在我想扩展该工具,这样我也可以通过它进行签到。
对于此功能,我需要找到快照视图的本地副本。虽然我可以询问 CC 哪个视图附加到某个目录,但我似乎找不到一个函数来查找给定视图的本地目录;此外,查找本地是否存在快照视图的最可靠方法似乎是将 HostName 属性与本地计算机名称进行比较。
那么:给定 IClearCase 接口,我如何找到存在快照视图的所有目录?
I'm using the ClearCase Automation Library (CAL) in a tool that helps me keep track of unintegrated changes; now I'd like to extend the tool so I can also make checkins through it.
For this feature, I need to find the local copy of a Snapshot View. While I can ask CC which View is attached to a certain directory, I cannot seem to find a function to look up the local directory for a given View; also it appears as if the most reliable method to find out whether a Snapshot View exists locally is to compare the HostName property against the local computer name.
So: Given the IClearCase interface, how can I find all directories in which Snapshot Views exist?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我确认您无法仅知道快照视图的视图标签来找到快照视图的根目录:如果需要,可以将快照视图加载到多个单独的目录中。
快照视图与其根目录之间的唯一链接是
.view.dat
隐藏文件,其中包含视图的 uid。另外,附加到视图的主机名与它是否加载到计算机上无关。它是查看服务器的名称(可以是您自己的桌面,也可以是集中式服务器)。
view.exe
进程正是在该服务器上管理该视图的所有与 ClearCase 相关的操作。因此,使用您的脚本(例如 perl 脚本),您一开始并不需要 CAL 来查找该视图:您首先需要能够查看
view.dat
文件,提取uid,然后检查它是否与查看您正在寻找的 uid (lsview -l -full -pro
)。I confirm that you cannot find the root directory of a snapshot view only knowing its view tag: a snapshot view can be loaded in several separate directories if you want.
The only link between your snapshot view and its root directory is the
.view.dat
hidden file which contains the uid of the view.Plus, the hostname attached to a view has nothing to do with the fact it is loaded or not on a computer. It is the name of the view server (which can be your own desktop, or can be a centralized server). It is on that server that the
view.exe
process managing all ClearCase-related operations for that view.So, with your script (like for instance a perl script), you don't really need CAL at first to find that view: you need first to be able to look the the
view.dat
file, extract the uid, and then check if it is the same than the view uid (lsview -l -full -pro
) you are looking for.