What is the command to get the list of branches created by a specific user in Clearcase ?
Moreover, is there a command to get the list of branches by name using regular expressions ?
There is no support for regular expression.
You can list branches with a cleartool lstype -fmt "%n %u\n" -kind brtype, but you would still need to parse the result to get the one created by you.
Using the fmt_ccase options, you can display the creator and name of the branch, for you to parse.
Related
Is there any command which will display all the information associated with a particular activity branch. Like:
On which label it was created?
On which label currently it is?
What are the files are checked in the branch. What are there latest versions?
Who created this branch?
Is there any single command for all those which will display these information (not in graphical view)
The only two commands are:
cleartool lsact
cleartool descr -l activity:anActivity#/apvob
You can get that way the list of versions for each file.
See also "Cleartool command to list all files part of a changeset"
You can combine the second command (descr) with a -fmt (fmt_ccase) directive in order to get other activity attributes, like its associated view (from which you can deduce the stream)
But that won't give you from which label the activity started. For that, you can list the foundation baseline of the stream.
And that won't give you "On which label currently it is?": the activity list versions. The fact that those versions are or are not labelled is not relevant for the activity. You would need to describe the version in order to see if it has a label attached to it.
If this is UCM, and by "activity branch" you mean the stream it is on, you can get the information about the stream by using cleartool lsstream -long -cview while in the view in question. The output will look something like this:
stream "brian_testrep1_2"
2017-08-17T17:50:15-04:00 by Brian.None#DESKTOP-LQ0QA86
owner: DESKTOP-LQ0QA86\Brian
group: DESKTOP-LQ0QA86\None
project: testrep1#\testproject (development stream)
default deliver stream: testrep1_Int#\testproject
development streams:
contains activities:
foundation baselines:
test_2#\testproject (testcomp1#\testproject) (modifiable)
recommended baselines:
views:
Brian_testrep1_2
policies:
...
I have checked in some files in a branch but unfortunately I forgot the branch name but I remember my view name to which my branch is associated. I also checked my config spec but the branch which is written in the config spec is not the branch that I want.
Actually I created two branches in a view but one branch name I forgot and as I said in config spec also only one branch name is written. Is there any way where I can list all branches associated with a particular view?
No: only an UCM view has an associated branch (through its stream).
See "How to obtain UCM stream and baseline with cleartool?" or "How to get ClearCase stream name by a given view path?"
cleartool lsstream -fmt "%n" -cview
A non-UCM view would have any selection rules you want in its config spec.
You need to do a cleartool lsvtree /path/to/a/file (add --graph for the graphical view) in order to see its versions and the branches involved.
I need to get a list of user names for every version listed in the version tree of an element, and then repeat for every element in the directory.
So far, I have come up with the following:
> cd M:\path\to\folder
> cleartool find . -version "created_since(01-January-1979.00:00:00)" -exec "cleartool describe -fmt ""%Lu\t%Fu\t%n\n"" %CLEARCASE_XPN%"
I chose a really old date thinking our VOB is younger than that date.
This gives me the same information for every version of an element because it's looking at the element owner, not the individual that contributed a specific version.
I'm using the following pages for reference:
http://www.ipnom.com/ClearCase-Commands/describe.html
http://www.ipnom.com/ClearCase-Commands/fmt_ccase.html
http://www.ipnom.com/ClearCase-Commands/find.html
http://www.ipnom.com/ClearCase-Commands/query_language.html
This might be a simple case of RTFM. Any help is appreciated.
You need to check if %n (used in the -fmt_case directive) returns the element name of the version name:
if it is the element name (without any extended path information, as in ##/main/.../x), then it would be normal for the cleartool describe to return always the same information.
if it is the extended path, as I would expect with %CLEARCASE_XPN%, then %u should be the user associated with the event (the version), and not the "element owner)
%u
Login name of the user associated with the event.
Small note, I always prefer using double-quotes around %CLEARCASE_XPN%, in case the path filename has a space in it.
-exec "cleartool describe -fmt ""%Lu\t%Fu\t%n\n"" \"%CLEARCASE_XPN%\""
Upon closer inspection, it looks like the command I posted above is sufficient. I saw a bunch of user names that were the same and thought they were all the same, but that's not true. I'm seeing different user names for different versions of the same element as I originally wanted.
If you work on a multisited VOB, do not forget that the owner of an object created on another site will be the VOB owner on your site. Therefore, if an object was created and modified only in a remote site, all of its tree and version would be owned by the VOB owner.
Of course, I assume you are in non preserving mode for identities for your replica synchronization (see the Changing preservation mode for mode infos). In most cases, you would not want replication to preserve identities, because each site has its own set of users.
I am a beginner with CleaCase.
The view i was working in is now deleted, post delivery of the code changes. Only thing that is accessible now is activities.
I can get the list of activities by issuing "ct lsact " on the Integration Stream SDS
I have the following info from which i want to know which activity has my changes
--12-24T20:13 user create version "/vob/abc/xyz/mno/src/hello.c##/main/abc_1.0_integration/ver_2.0_integration/Mars_plm_1.0_SDS/**7**" (VER_2.0_BL21_09_01_2014_13_43.9104, Mars_abc1.0_mysqldb_07_01_2014_15_01.5788, VER_2.0_BL21_27_12_2013_19_07.4516, VER_2.0_BL21_24_12_2013_20_13.4521)
I want to find out which activity has the below version of the checked in file.
/vob/abc/xyz/mno/src/hello.c##/main/abc_1.0_integration/ver_2.0_integration/Mars_plm_1.0_SDS/7
Thanks in Advance
You can try and use cleartool describe to see if the activity is displayed:
cleartool describe -l hello.c##/main/...
Using fmt_ccase options, you can display the activity directly:
cleartool describe -fmt "%[activity]p" hello.c##/main/...
When I execute a "cleartool ls filename##specificVersion", I see
filename [not loaded]
What does this mean?
For background information, I was trying to also execute a cleartool mkbranch, and was a "Element not found" error. So, for a sanity check, I tried a cleartool ls.
"not loaded" means the file:
is selected (by the selection rules element * ...) but:
not loaded by the load rules (load /xx/yy...)
You can see both sets of rules by doing a cleartool catcs anywhere within your view (or cleartool edcs to edit said rules)
This is typical of a snapshot view, which is the only one having "load rules" (as opposed to a dynamic view)
See:
"Before accessing files not loaded into snapshot views":
A snapshot view contains only the set of elements that you specify in the load rules of your view. (In UCM, by default, your view loads all of your project source files.)
When you restrict the scope of a view, it contains only a subset of elements in the VOB. During the course of a development cycle, you may need to see a version of an element that is not loaded into your snapshot view.
You can view nonloaded files or copy them into your view for build purposes, but you cannot check them out. Only file elements that are loaded into your view can be checked out.
"To copy a nonloaded element into a snapshot view"
cleartool get -to filename path
cleartool get -to prog.c.previous.version prog.c##/main/v3.1_fix/10