IBM Rational ClearCase is a commercial revision control software, for details refer to http://en.wikipedia.org/wiki/ClearCase.
This article describes how a conversion of a ClearCase VOB to Mercurial could theoretically work. Like SCCS, RCS and CVS, ClearCase handels revisions for each file individually, so that each file has its own revision numbers, assigned labels etc.
When importing a ClearCase VOB, you should decide whether you want to start at a certain point in time or from the very beginning. Depending on this, you can setup a time based ClearCase view specification so that you see either a nearly empty or already filled repository.
If you decide not to start at the beginning, then copy sll files visible with the viewspecification of your choice into a new directory structure and run the usual "hg init; hg add; hg commit" on it to create a new Mercurial repository.
Later, you can use the ClearCase find command in order to detect most of the changes that have been applied later. For example
cleartool find /yourpath -version \"brtype(main) && created_since(yourdate)\" -exec \"echo \\\$CLEARCASE_XPN\"
will list any new elements that have been created later than a certain date (usually you will use the date of your latest Mercurial repository update here). elements here means, new file revisions and new directory revisions as ClearCase does versioning for directories as well.
For new files, typically versions with extensions /main/1 will hold the first usable content while /main/0 versions can mostly be ignored.
Note that the list of files is not sorted in any way yet, so you must order them yourself, e.g. by using a 'stat' on the full path specifications to obtain the modification (and here also creation) date.
Once the elements are sorted by time, you can start to process them and for each element
* create the necessary path in your Mercurial repository, if needed * copy the new file version into the repository * use 'hg add' where needed * commit the new file with the comment, date string and author derived from ClearCase
The comment and the user can be obtained from ClearCase by using commands like 'cleartool describe -fmt '%c or '... %u' respectively. There are certain problems left: * You will not be able to detect symbolic links this way, as symbolic links are not own elements, but just records in the directories * You will not be able to detect file removals or renames, or directory removals or renames For these, you would have to look at the directory elements which you got through the find command earlier in detail. Currently I am not aware of a method to find out what exactly happened between two directory revisions, as several files or subdirectories could have been removed or renamed in between.