Adding files to sourcecontrol on linux using cleartool
Asked Answered
A

2

6

I have a file that i want to add to sourcecontrol on linux using cleartool . I've followed the IBM documentation for this, i've tried this:

cleartool mkelem testScript.sh

I got an error: Can't modify directory "." because it is not checked out. I also would like to know how can i checkout/checkin files or directories and setting activities.

Anyhow answered 28/8, 2014 at 14:39 Comment(0)
A
6

You need to checkout the parent folder first.

cd /path/to/file/
cleartool mkact newfile
cleartool checkout -c "add file" .
cleartool mkelem testScript.sh
cleartool checkin -nc

The cleartool mkact would work if you are in an UCM view.
It will create and set a new activity, which will record the files and folder you will modify.

Here, the new activity newFile will record the new version of the parent folder, as well as the version 0 and 1 of the file.

Adverse answered 28/8, 2014 at 14:57 Comment(5)
How can i change the state of an activity to obsolete ?Anyhow
How can i check the state of activity ?Anyhow
@user3502786 cleartool lslock activity:yourAct@/vobs/yourPVobAdverse
last thing how can i list all the files/folders that are checked outAnyhow
@user3502786 https://mcmap.net/q/1779732/-how-to-find-checked-out-files-in-a-clearcase-windows-snapshot-view or https://mcmap.net/q/672136/-how-to-find-out-all-the-checked-out-files-in-a-branch. Also seen in https://mcmap.net/q/1452033/-recursive-checkin-using-clearcaseAdverse
R
-1

You should create separate questions for .. separate questions...

Going back to the original - the reason why it isn't working is, as VonC has pointed out, you haven't checked out the parent of the file. Remember, when you run "cleartool mkelem", you are about to modify the contents of the parent directory (. in this case) by adding a new "pointer" to the element you're now creating. As with everything else in clearcase, when you want to modify the contents of an element, you have to check it out first.

One of ClearCase's greatest strength (and hardest to wrap one's head around) is the concept of an "element", IMO. "Everything" behaves similarly with an element. Making any change to an "element" (file or directory) means you have to check it out first to make that change.

In the case of a file, that's easy to grasp - you're just editing lines in a file. For a directory, it's almost as easy - you can think of a directory as just a list of pointers to data blobs. We make the name of the blob something convenient we can remember (like foo.java or myapplication.cc or README.md). But we can also change the name of the pointer (even though it points to the same data blob) by renaming a file. We can remove the pointer to the blob without impacting the blob itself by using "rmname". That's essentially what "rmname" does.

In ClearCases' case, the mkelem command is a little bit special - it creates the initial datablob, and adds a pointer to that datablob in the current directory (kind of does 2 things at once).

Redfish answered 15/9, 2014 at 5:36 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.