如何在 Clearcase 静态视图上最好地设置 Mercurial? (设置“结账”挂钩?)
我想在 Clearcase 静态视图目录中设置一个 Mercurial 存储库。我的计划是从该目录克隆,在 Mercurial 存储库中完成所有实际工作,然后将我的更改推回共享的 Hg/Clearcase 目录。
我想听听关于如何最好地发挥作用的一般建议,但我预见到一个具体问题:Clearcase 将文件锁定为只读,直到它们被签出。我希望它工作的方式是设置一个 Mercurial hook 在推送完成之前签出文件,并在签出不起作用时回滚推送。
我应该查看 pretxncommit 挂钩吗?还是拉钩?另外,我也不太清楚如何编写实际的钩子。我知道clearcase命令,但我不确定如何构造挂钩来传递变更集中每个文件的文件名。
建议?
I'd like to set up a mercurial repository in a clearcase static view directory. My plan is to clone from that directory, do all my real work in a mercurial repo and then push my changes back to the shared Hg/Clearcase dir.
I'd like to hear general suggestions on how this might work best, but I foresee one specific problem: Clearcase locks files as read-only until they are checked-out. They way I'd like it to work is to set up a mercurial hook to checkout the file before the push is completed and roll-back the push if the checkout doesn't work.
Should I be looking at the pretxncommit hook? Or the pull hook? Also, I'm not quite clear on how to write the actual hooks either. I know the clearcase command, but I'm not sure how to contruct the hook to pass in the filename for each file in the changeset.
Suggestions?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我两天前刚刚回答的问题: 如何将 git 桥接到 ClearCase? 可以为您提供该过程的说明。
我喜欢将 ClearCase 签出/签入步骤与 DVCS 工作分开:
我将在 DVCS 存储库中根据需要解锁文件(直接在快照视图中制作),然后更新快照视图,这将告诉我“被劫持”的文件(我可以轻松地通过cleartool更新GUI签出和签入)。
但是,如果您在其他地方克隆了 DVCS 存储库,并将其推回到不是 ClearCase 快照视图的本地存储库,您可以做的就是简单地复制回您的
view.dat
隐藏文件DVCS 存储库根目录的快照视图。这个简单的文件足以在 ClearCase 快照视图中转换回本地存储库!
然后将所有文件设置为只读(除了在特定日期(即您开始工作的时间)之后修改的文件),以避免 ClearCase 将所有文件视为被劫持。
其余的与第一种方法类似:更新、签出/签入。
The question I just answered 2 days ago: How to bridge git to ClearCase? can gives you an illustration of the process.
I like to take the ClearCase checkout/checkin step separate from the DVCS work:
I will unlock files as I need them within the DVCS repo (made directly within the snapshot view), and then update the snapshot view, which will tells me the "hijacked" files (which I can the easily checkout and checkin through the cleartool update GUI).
But if you have clone you DVCS repo somewhere else, and push it back to a local repo which is not the ClearCase snapshot view, what you could do is simply copy back the
view.dat
hidden file of your snapshot view at the root directory of the DVCS repo.That simple file is enough to transform back the local repo in a ClearCase snashot view!
Then you make all the files read-only (except those modified after a certain date, i.e. the time when you started working), to avoid ClearCase considering all the files as hijacked.
The rest is similar to the first approach: update, checkout/checkin.