Clearcase: checkout and modify but forbid checkin

荒凉一梦 提交于 2019-11-26 18:38:01

问题


Is it possible in clearcase to checkout a file for modification such that it is impossible to check it back in? I’m going to be hacking some files on a private branch, only some of which I want to ever check in. I want to eliminate the possibility of accidentally checking in unwanted changes. (I know we can write a trigger to check for magic keywords in the checkout comment; I'm look for something built-in to CC.)


回答1:


"Hacking some files" is spelled in ClearCase lingo: hijacked files in a snapshot view.

All you have to do is to:

  • lock those files (except for the few developers you know are likely to checkout/checkin the files: cleartool lock -nusers userA,userB,... aFile)
  • create a snapshot view
  • change the read/write right (at the OS level, nothing to do with ClearCase here)
  • modify them directly (without checkout them first, hence the "hijacked" state)

The OP Kevin Little adds in the comment:

Alas, we only use dynamic views

Easy enough:

"Hacking some files" is also spelled in ClearCase lingo: eclipsed files in a dynamic view.

All you have to do is to:

  • lock those files (except for the few developers you know are likely to checkout/checkin the files: cleartool lock -nusers userA,userB,... aFile)
  • create a dynamic view
  • copy the files you need to modify as aFile.tmp
  • modify the config spec to not select them
  • copy them back to their original name (they became "eclipsed" as their private version override their official versioned counterpart)
  • remove the "none" selection rules from the config spec
  • modify them directly

To not select them, add to the config spec (ct edcs) before the other rules:

element /a/path/to/aFile1 -none
element /a/path/to/aFile2 -none
...

To restore them, all you have to do is move or remove those files.
They will be dynamically be replaced by their original and still versioned element.




回答2:


I don't know about the administration. From a user standpoint, you could have 2 views. In one view, checkout the files you don't want to check in. In the other view (your view), check them out unreserved. Then, if you try to check them in, you'll get an error because they're checked out to the other view.



来源:https://stackoverflow.com/questions/2165155/clearcase-checkout-and-modify-but-forbid-checkin

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!