2

We've been running out of a Mercurial repo from within a CC snapshot view successfully for some time now. We have the source repo on the view, and the team's base repo is a clone from that one. That keeps a layer of separation to make checkout-checkins in CC easier to manage.

Now, for reasons internal to where I work, we need to switch to a new view. How can we do this? There are other teams within the company checking in files directly to CC (hopefully we'll convince them away soon), so that should be a consideration.

How can I overlay our existing repo into a new view (and then I can rebase the team's base repo no problem)?

ale
  • 519
  • 2
  • 11

1 Answers1

1

The problem is the delta that might exist between your current Mercurial repo and the new snapshot view (especially with a different config spec).

Since the OP mentions in the comments that the config spec of the new view won't change, he suggest a simpler method than the one below:

  • Load the new snapshot view content
  • remove all its files from the disk (not from ClearCase)
  • copy the .hg directory of the original Mercurial repo in the new (empty) view
  • update the working tree of said Mercurial repo (all the files are back in their original place, but detected by ClearCase as hijacked)
  • cleartool update -overwrite in order to force ClearCase to erase those files by the versions from ClearCase. (see man cleartool update)

Mercurial would then detect any change between the files restored by ClearCase and the ones managed in the repo.


(Original answer)

I would:

  • create a branch dedicated for that migration in Mercurial,
  • compare its content with the snapshot view (without putting yet any Mercurial repo in it)
  • import and resolve the differences from the ClearCase view to the Mercurial repo
  • and then, once the content is identical, clone the Mercurial repo directly within the snapshot view.

The rest would be about:

  • fetching that dedicated migration branch to the team's base repo
  • merging that branch to the main development branch within team's base repo
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Thanks VonC. The config spec will be identical. What do you mean by "clone the Mercurial repo directly WITHIN the snapshot view"? I think I understand the rest... – ale Feb 01 '12 at 15:32
  • @ale: cloning the Mercurial repo in the CC view would be one way to get the Mercurial repo back in the ClearCase view. But you could also copy the `.hg` directory itself directly in the CC view, that would work too. – VonC Feb 01 '12 at 15:35
  • I think I understand. I can just move off all the files from the view, and run the clone. It might think they are hijacked but contents should be fine because the previous step dealt with that. Next view update will deal with any new changes in CC that occurred while cloning. – ale Feb 01 '12 at 15:38
  • @ale: that's one idea, yes. And then: http://stackoverflow.com/questions/5740826/clearcase-working-offline-hijacking-files-then-checking-out-merging/5741062#5741062 – VonC Feb 01 '12 at 15:40
  • @ale: I have included your option in a revised edition of my answer. – VonC Feb 01 '12 at 15:52