Information for Clearcase/UCM Users
Clearcase/UCM Concepts
Syncing with a Mercurial Repository
It's simple enough to have a stream in Clearcase coexist with a Mercurial repository. All you need is to create a snapshot view on the stream in question. After the files are updated and on a local disk, turn the snapshot view into a Mercurial repository.
hg init hg addremove hg ci -m "Initial checkin"
From there you can push the repository anywhere you like.
Clearcase to Hg
As you pick up updates via rebasing in Clearcase and updating your snapshot view, hg status will tell you what is out of sync with your repository. hg addremove is a wonderful command to keep files in sync with respect to new files and deleted files.
Hg to Clearcase
This is a little tougher.
Clearcase, quite incorrectly, likes to own the mode on files, and keeps them read-only until they're checked-out. To update from Hg, I do the following
# I use cygwin for this on win32 find . -type f | xargs chmod u+w hg pull hg up
From Clearcase's perspective, you've just hijacked some files. If you update from clearcase using the gui, it will prompt you to check them out and check them in again.
ct update -graphical
To batch process this is more difficult, and that doesn't even cover files being renamed, removed, added, etc.