preserving history when using mercurial ontop of clearcase

不问归期 提交于 2019-12-10 16:55:49

问题


I work in a ClearCase shop and CC does a good job of integrating the team's work though our code review process prevents me from using it to track my daily changes. Creating an hg repository on top of my CC view works really well. I can track my changes and easily make backups on the file server, produce diffs for people etc.

This is all well and good until I move to a new CC view and have to leave my history behind. I would love to be able to ?pull? my previous history in and have everything that's different in the new view show up as the latest change set.


回答1:


We use Git inside a ClearCase static view, for pretty much the same reason you described - finer grained control.

In CC, when we start working on a newer (labelled) release and the config spec changes appropriately, Git picks that up as a regular changeset.

The magic works precicely because Git knows nothing about config specs, and CC knows nothing about the .git directory. When the config spec changes, it reloads whatever files have changed but doesn't touch the .git dir, so Git still sees the repo.

I don't have any experience with Mercurial, but I just fired it up then and added a few dirs and files, and it appears that it works the same way.




回答2:


I've never used ClearCase, so I'm not exactly sure what a CC view is, but there's a general technique for vendor drops that might be appropriate here: Check in the upstream (CC) version as, say, revision 0, on hg branch vendor or whatever you want. Change back to the default branch and hack away. Then when you want to move to the latest upstream version, check out vendor in your hg repo again, replace the working directory with the new upstream, run hg addremove (possibly with the --similarity option to detect renames), commit, and merge with your current tip, then switch back to the default branch.




回答3:


To complete brendan's answer, since each ClearCase views will be in their own path (for dynamic views) or local directories (for snapshot views), you will have to:

  • move your hg repo
  • checkout a new branch in the hg repo in order to isolate the changes introduced by the new config spec of the new CC view (if you are using UCM, you can mirror the name of the CC Stream into a hg branch, for instance)
  • Syncing the CC view with your Mercurial Repository


来源:https://stackoverflow.com/questions/1146224/preserving-history-when-using-mercurial-ontop-of-clearcase

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