I have a dA/fC##/main/0 that was created from a new file added to dA##/main/branchA/3. The new file on branchA became dA/fC##/main/branchA/1
Successive changes on dA/fC##/main/branchA/1 eventually end up on last version of dA/fC##/main/branchA/17.
Then dA/fC##/main/branchA/17 were merge from branchA into main creating dA/fC##/main/1.
However dA/fC##/main/1 does not belong to any version of dA##main/*.
I want to add dA/fC##/main/1 to dA##/main/40 so dA##/main/41 will contain dA/fC##/main/1.
What are the ClearCase console commands to run on linux?
Make sure the destination view selects /main/LATEST, and the version created will be the one expected.
Main advice: use a different view for the merge, one which is configure to
element * /main/LATEST
Or create a new one, preferably a dynamic one.
For a single file, once merged, you need to merge its parent folder too (or you won't find a version of that folder listing that file at the right version)
On the destination view, display the version tree of that parent folder, right-click on the version where fC was recorded (dA##/main/branchA/4), select merge to, and click on version 40.
See also "How files and directories are merged".
Each version of a Rational ClearCase directory element contains the names of certain file elements, directory elements, and VOB symbolic links.
Now, if you are sure merging branchA was about fC only, you could have done the merge of the file and its parent folder in one command: cleartool findmerge.
See "ClearCase: findmerge usage"
cd /path/to/view/avob/dA
cleartool findmerge . -nc -fver .../branchA/LATEST -merge
That would have merged fC and dA.
I used the merge GUI to merge the version of dA##/main/branchA/4 where dA/fC was first added into dA##/main/40 check-out.
This added dA/fC to the main view that is configured to get element * main/LATEST
I see now dA/fC##/main/1 on main and can commit.
Related
I an new to ClearCase and started studying the ClearCase documentation.
UseCase : I have two branches - 'Branch_A' and 'Branch_B'.
I need to merge all my changes from 'Branch_A' to 'Branch_B'
I won't be able to use the ClearTeamExplorer, so only option is command line.
I read the documentation and its mentioned that cleartool findmerge command is the option for it.
But there is no direct example given for this.
Could someone please provide an command line example for this please?
Any help on this is appreciated.
Assuming a base ClearCase view/branch (no UCM views/Streams):
cleartool findmerge include a relevant example:
for the current directory subtree, compare versions visible in the current view against versions on another branch and perform any required merges.
cd /path/to/target/Branch_B/view
cleartool findmerge . –fversion /main/Branch_A/LATEST –merge –gmerge.
The idea is to be in the view set on the target branch, with a config spec ready to create new versions.
element * CHECKEDOUT
element * .../Branch_B/LATEST
element * /main/0 -mkbranch Branch_B
element * /main/LATEST -mkbranch Branch_B
The merge is done in the target view, on the target branch.
Now if you are using UCM, then the view done on a Stream has already the right config spec.
The idea remains the same: Execute the findmerge in the target view (after setting a dedicated activity, to record that merge)
In that case, check "How to merge changes from a specific UCM activity from one ClearCase stream to another"
You do not merge branches in UCM, you would merge UCM activities.
I'm new to CC and I'm coming from Git and Mercurial background, probably thats why ClearCase confused me so much. I've been assigned a task to migrate latest CC's revisions to Git. Problem is that I couldn't manage to checkout any branch other than main in CC.
I have a view that displays all VOB's /main/LATEST revision. I assume, main branch's latest revision.
element * CHECKEDOUT
element * /main/LATEST
Now I need to get the list of other branches in a particular VOB. To do that, I navigate from terminal in that folder and run
cleartool lstype -kind brtype -invob /%VOB_NAME%
and I can see the list of branches. Correct me if I'm wrong, but I assume, it displays only the branches relevant to VOB(%VOB_NAME%).
Now I need to checkout the branches. What is the standard way of doing this. I tried updating config spec with something like:
element * /%VOB_NAME%/%BRANCH_NAME%/LATEST but it doesn't seem to work.
Pretty sure I'm not doing it correctly.
Also for migration purpose, I'll need to automate the steps to acquire branches and checkout the branches. I guess updating config spec to switch branch in a view takes some time and probably is an async operation, so is there a way to determine when view finishes updating?
Or maybe there's command line option to switch branch for a particular VOB in a view?
So in short, here's my questions I'm struggling with:
Than
Am I acquiring VOB branches correctly?
How can I checkout a particular branch?
Is there a way to determine when checkout finishes?
thanks
UPDATE
ok I tried #VonC's recommendation so my config spec looks like this:
element * CHECKEDOUT
element * .../heine_1/LATEST
element * /main/LATEST
If I'm guessing correctly, one VOB containing branch named heine_1 should checkout that particular branch, the rest of VOBs will stay on main branch, but this is not the case. When I run cleartool ls inside that VOB, its still on main branch. All folders are postfixed with Rule: /main/LATEST. So I guess it didn't switch the branch.
Thanks
There are a few questions in the original question and the comments.
Addressing the configspec issue first...
The syntax of an element rule is:
element {path} {version rule} {optional clauses}
If you need a VOB-specific rule, you can do something like this:
element \myvob\... ...\myvobbranch\LATEST
element \myvob\... \main\LATEST -mkbranch myvobbranch
The "..." in the path means "this location and everything underneath it."
The "..." in the "version rule" means that the branch name is at the end, so this would match /main/myvobbranch/LATEST, /main/br1/myvobbranch/LATEST, etc.
If you're working on a branch, you generally want new files or work to appear on the branch you are working in, and the second line makes that happen.
Everything in a configspec is case sensitive, so be aware that "LATEST" is not "latest."
Since the view was created for you, I'm reasonably certain that it is a dynamic view. If it is mapped to a drive, it's definitely dynamic. If you need to know for sure, you can CD into the "working area" of your view and run "cleartool lsview -pro -full -cview" and look at the "attributes" line. The line for a dynamic view will look like this:
Properties: dynamic readwrite shareable_dos
On the direct questions:
Yes, you are acquiring the branch list correctly.
By default the checkout is done using the version selected by the view, you can use cleartool checkout -branch {full branch path} {file name} to check out the latest on a branch, or cleartool checkout -version {version id} {file name} to check out a version other than the latest on a branch. I would not recommend either as a normal practice. The -branch will cause checkins to go to the element's parent branch. The -version would require add a requirement to perform a merge to get the checkin to complete, which would also go to the version's parent branch.
Checkout is finished when the command finishes.
A big "new user gotcha" is that directories are also versioned objects. If you're adding files to source control, you need to remember to check the directory in so that they are visible by others with similarly configured views. The ClearCase GUIs have this behavior as a default if you started the process with the directory NOT checked out, but not if you explicitly checked out the directory beforehand.
I have a file in lost+found which is checkedout but I do not see any viewreference. How can i remove the file?
I'm Checking in windows system. When I do a version tree, I see a view that was created in some unix system. I'm not able to get the uuid of the same.
How can I delete such file?
For the checked out state, You should be able to get the view uuid in the same way as in the previous question "How do I delete check-outs from a particular view in clearcase?".
That lost+found folder is part of a vob and a cleartool describe -b vob:\Avob should list the uuid of the unix view.
But if you are not sure which uuid matches the actual name of the old view you see in the version tree, you can check for that name directly in the registry server.
There are different option:
cleartool rgy_check -views
But also, since I have access to the registry server, I can do a simple grep of the name in the var/rgy folder where view_tag is:
<user>#<server> /path/to/ClearCase/var/rgy
$ grep -i <view_name> view_*
view_object:-entry=view_object;-hostname=server;-local_path=path/to/<view_name>.vws;-owner=<name>;-view_uuid=e670fe8a.fb0540e5.83f4.7f:82:a6:s8:e1:1a;-attributes=sumview;
view_tag:-entry=view_tag;-tag=<view_name>;-title=<title_View>;-hostname=server;-global_path=\\server\views\path\to\<view_name>.vws;-region=<region>;-view_uuid=e670fe8a.fb0540e5.83f4.7f:82:a6:s8:e1:1a;
That way, from then name, you get back the uuid and can remove the checked out state from the vob.
Regarding the file itself (in lost+found), see technote "About the lost+found directory", that I mentioned in "How do I retrieve a file if I undid a folder checkout in ClearCase?".
There are two possible ways to remove an object from the root of the lost+found:
The object can be moved to a new location in the VOB using the cleartool mv command
The object can be permanently deleted from the VOB.
Be careful with the second option (which involves rmelem), especially in UCM (where that object could have in previous versions baseline labels attached to them)
we have a branch created , config spec of which looks like this
element * CHECKEDOUT
element * .../project_name/LATEST
element * some_label -mkbranch project_name
element * /main/LATEST -mkbranch project_name
now there is a folder which looks like this
abc\bcd\efg which has certain .xls files, need to move these files to a new folder under efg
i.e abc\bcd\efg\hij\
how do I go about this?
Can someone help? Im very new to clearcase, it would be great if you can tell me any services need to be stopped or any tags need to be untagged or stuff like that
Thanks in advance :)
You can move them through the GUI, but in command line, you need to checkout the source folder and the destination folder.
See more at "To move an element within a VOB"
Check out the parent directory and the destination directory.
Enter the following command:
cleartool mv element-name destination-directory
Check in the new parent directory and the source directory.
This operation changes the location (and optionally, the name) of an element or VOB symbolic link.
For a file element that is checked out to your view, it relocates the checked-out version also. (That is, it moves the view-private file with the same name as the element.)
If the version is checked out to another view, you receive a warning message that you have view-private data that may need to be moved.
We usually use snapshot views and they work just fine.
However, I tried to use a dynamic view recently and doesn't show empty files in the working directory. We use Python so namely, it doesn't show empty __init__.py files, which breaks most of our code. All other files in the same directory, and non-empty __init__.py files exist.
Is this a known issue? What can I do?
Running cleartool ls says about the __init__py file: "no version selected".
My config spec looks something like this:
element * CHECKEDOUT
element * SubComponenet1_VersionX
element * SubComponenet2_VersionY
element * SubComponenet3_VersionZ
element /src_base /main/LATEST
Assuming the empty files are inside src_base and considering the last rule, how can a file not have a selected version?
First, try a cleartool ls in the parent directory of those file, in a shell or a DOS windows.
You can see there status, and see if they are selected by your config spec.
Check also that the config spec of your dynamic view is similar to your snapshot view:
cleartool catcs within your snapshot view
cleartool edcs from your dynamic view
For a non-UCM dynamic view to reflect an UCM snapshot view, it can be pretty complex.
It is best to create a dynamic UCM view on the same Stream.
At the very least, your config spec should end with a stop-rule:
element * /main/LATEST
# or
element /src_base/... /main/LATEST
Your last rule is only for /src_base directory, and not for the sub-elements.