How do I get ClearCase to make an archive of a subdir of snapshot as it was at an earlier revision?
I'm not particularly experienced with ClearCase, so if my terminology is incorrect please let me know.
In Git I can run the command:
git archive -o /tmp/dump.zip $SHA_FROM_THE_PAST path/to/dump
I want to do something similar in ClearCase.
The ClearCase repository contains two branches: main
and snapshot_foo
.
snapshot_foo
branches from main
at some point in the past.
What I want is a dump of all the files as they looked at the time the snapshot was first created.
I u开发者_运维技巧nderstand that there is no 'global' state identifier like there is in Git; in AFAIK, in ClearCase each element is versioned individually, so there will not necessarily be a one-to-one equivalent to that command.
I've thought about creating a new snapshot starting at the same point in time from main, and just copying what I need from that, but I am bewildered and confused as to how I would go about it.
The simplest case would be when you have set a label on main just before creating snapshot.
But if you have no such label, you can get all the files at the time just before the creation of the snapshot_foo branch:
- a/
cleartool descr -l brtype:snapshot_foo@/myVob
to get the date of creation for this branch - b/ make a snapshot view with a time-based selection rule similar to this question
element /myPath/... /main/{!created_since(01-Sep-2008.12:34:56)} element /myPath/... /main/LATEST
(with 12h 34 minutes 56 seconds being the time just before the creation of the brtype snapshot_foo
)
(see the config_spec
man page)
Once the snapshot view is created with the right versions in it, you can zip its content, achieving a similar result to the git archive
you mention in your question.
精彩评论