如何缩短ClearCase视图的加载目录?

3
在Clearcase中,我有一个VOB,路径如下:
\Department\ProductGroup\Product1\Development

我有一个视图,其配置规范如下:

element * CHECKEDOUT
element * .../mybranch/LATEST
element * /main/LATEST -mkbranch mybranch
load \Department\ProductGroup\Product1

Product1的所有源代码都在Development目录中。 我关心的内容都在这个目录内,没有存在于该目录之外的任何内容。 代码中的所有引用都是相对于此目录的。

我已在目录c:\ dev中创建了上述Clearcase视图

目前,上述设置会创建一个目录:

c:\dev\Department\ProductGroup\Product1\Development

所有的父目录都是空的,直接列出下面这些目录会更好:Development
c:\dev\Product1  

“c:\dev\Product1” 映射到 VOB 路径 “\Department\ProductGroup\Product1\Development”,这是否可行?


根据我的回答,如果“subst”对您无效(因为它有限制),移动您的目录(ct move)是一个很好的解决方法,并且将导致路径长度大大缩短。但是,这可能会干扰一些类路径或其他环境脚本。 - VonC
1个回答

1

1/ 为什么不只加载 \Department\ProductGroup\Product1\Development?

load /Department/ProductGroup/Product1/Development

注意:您可以使用'/',比使用'\'更容易,并且Windows配置规范可以正确解释它。

1bis/ 如果您想保持一般规则,可以使用一些“清理规则

考虑这个配置规范
首先在动态视图中测试,以快速检查 - 即不需要无休止的更新重载步骤 - 是否结果与您需要的相匹配:文件位于Development下,其他地方没有文件)

element * CHECKEDOUT

# read/write selection rule for the directory and sub-directory
# where you need to work
element /Department/ProductGroup/Development/... .../mybranch/LATEST
element /Department/ProductGroup/Development/... /main/LATEST -mkbranch mybranch

# specific selection rule for the parent directories of Development
# those rules do not contain a mkbranch directive
element /Department/ProductGroup  .../mybranch/LATEST
element /Department/ProductGroup /main/LATEST
element /Department  .../mybranch/LATEST
element /Department /main/LATEST

# cleaning rule right there: anything outside /Department/ProductGroup/Development
# will not be selected, hence not loaded
element /Department/* -none

load \Department

这样,您始终保持相同的加载规则load \Department,而您的选择规则会为您进行清理。

2/ 关于您的路径问题,您可以使用符号链接,但最简单的方法是使用subst

subst X: c:\dev\Department\ProductGroup\Product1\Development

你可以继续在 X:\ 中使用你的快照视图

但是这样不起作用,因为 ClearCase 需要:

  • view.dat(指示目录树实际上是快照视图的隐藏文件)
  • vob(在你的情况下是 DepartmentProductGroup\Product1\Development 是 Vob Department 中的路径)

    X:>ct lsview -l -full -pro -cview cleartool: Error: Cannot get view info for current view: not a ClearCase object. X:>ct ls cleartool: Error: Pathname is not within a VOB: "."

出于同样的原因,在 Windows 上使用 Junction 的硬链接也不起作用

c:\dev>junction Product1 Department\ProductGroup\Product1
Junction v1.05 - Windows junction creator and reparse point viewer
Copyright (C) 2000-2007 Mark Russinovich
Systems Internals - http://www.sysinternals.com

Created: C:\dev\Product1
Targetted at: C:\dev\Department\ProductGroup\Product1

C:\cc\xxx>ct ls
cleartool: Error: Pathname is not within a VOB: "."

所以你可以做的是:

subst X: c:\dev

结合1/中的特定加载规则或1bis/中的清理规则,将会得到以下结果:

  • 稍微更短的路径
  • 没有额外的空子目录

2bis/“狡猾”的解决方案:

从ClearCase资源管理器中,将DevelopmentDepartment\ProductGroup\Product1移动到Department!该移动将在“mybranch”版本树中记录,并且对于在/main/LATEST中工作的其他人来说是不可见的。

然后使用上面提到的subst,您将在Department\Development中的“mybranch”中工作。

X:\Department\Development

当你想要上市时,采取相反的行动。


感谢您提供的所有信息,但从您的描述中可以看出,长路径的关键问题似乎只能通过使用subst来“解决”。 - orj
不:将目录移动到开发分支中是一个很好的解决方法。 - VonC

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接