views:

215

answers:

3

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  A: 

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.

brendan
+1  A: 

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
VonC
could you be more specific on the first step?
Arthur Ulfeldt
move your hg repo: the idea is not to *directly* sync your original hg repo located in your first CC view: it should be cloned outside any CC views, set to the right branch, then creating a new branch from there in order to isolate the files introduced by your new CC view. You can then sync that new view with the external repo. finally you can clone that external repo into your new CC view.
VonC
"set to the right branch": I mean the branch from the first CC view, where you first created your hg repo on top on the first view. That way, when you will sync that hg repo with the new content, you will have the previous history plus the new CC view content in the same hg repo.
VonC
+1  A: 

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.

Matt Curtis
We have a few more bizarre reasons for using it, most notably that the whole team shares the same static view - WTF. Anyway.
Matt Curtis