Amir Rachum
Amir Rachum

Reputation: 79615

Find moved files in ClearCase activities

I'm writing a script which converts a project in my workplace from ClearCase to Mercurial + Jira. I'm having problems with moved files. I'm using 'lsact -long' to get files changed in an activity. The problem is that when, for instance, a directory was renamed, the change is only apparent in its parent directory and it's listed with 'describe' like so:

Added directory element "new_name". Uncataloged directory element "old_name

Trouble is, it doesn't specify explicitly that a directory moved, so it might be that someone deleted an old directory and created a new one.

How do I know whether files were moved in a directory changeset?

Upvotes: 1

Views: 544

Answers (1)

VonC
VonC

Reputation: 1323653

For any migration to Mercurial or Git, I never bothered with that information.

I simply select a coherent revision from ClearCase (an UCM baseline, or a full label), and add it to the repository (Hg or git).
I repeat the process revision after revision.

Hg or Git will detect the renames (files or directories) automatically.

In other words, any metadata recorded by a VCS won't be translated as is in Git or Mercurial.
Regarding renames, those DVCS will analyze their respective revisions and deduces the renames if you ask them to, after having imported everything, and while using your repo (like a git diff -M for instance, or an hg log --follow.

That being said, if you want to tell Hg that an element is moved (as in "How to rename a directory in Mercurial and continue to track all file changes"), you can check (if not already pruned) the event history of that parent directory, or the one of the "new_name":

cleartool lshist -long ...

Those events could have recorded the rename or move operation.

Upvotes: 1

Related Questions