we have created a component in UCM. Many files were changed since but few files were not at all changed after version 1.
We can find the list of files using createdsince. but in this case we need to specify the date. Is there any way to find the list of files which are modified since creation.
In other words find list of files which has version greater than 1 in version tree.
You need to compare current versions with the stream/1 versions, and that isn't always the initial baseline of a component.
Actually, if you didn't imported an initial non-UCM label as a baseline, then the initial baseline is empty (no version in it).
The trick is, when using the query language, you cannot use version selector and a query
So, what you can do is apply a label to all version 1, and then look for all elements which have at least one version without that label (see find examples).
cleartool find . –version 'version(.../streamName/1)' –exec "cleartool mklabel V1 \"%CLEARCASE_XPN%\""
cleartool find . -version '{!lbtype(REL1)}'
Related
Is there anyone who knows a way to find all added files in a CCE view? just to verify that no file is missing before applying label.
thank you.
No file missing means some files might be still in checkout mode, but even then, applying a label would be applied on that checkout version (you would need to make sure and checkin them later)
You can list files still in checkout here.
A better query would be to list all files with versions more recent than the previous label (assuming base ClearCase here, not UCM)
You can use the date for instance to list all files with version newer than a date
ct find -all -type f -version "{created_since(11-apr-2013) && brtype(branch_name)}" -print
That way, you will know all added files, and can check if there are any missing before applying a label.
The OP Frimus proposes an alternative solution in the comments:
I resolved the issue by creating an other view with the same config spec,
and I compare the two views.
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 had some files in my view few days back and I need to recreate those files. Now I want to see which file changed from that period of time. Is it possible in clearcase to see the history of the view and to check what are the files that were changed from that period of time?
One solution is to make a snapshot view with time-based selection rules, with a config spec similar to:
element /myPath/... .../StreamName/{!created_since(16-Sep-2009)}
element /myPath/... /main/{!created_since(16-Sep-2009)}
element /myPath/... /main/LATEST
To quickly list all modified files since a certain daye, use a cleartool find command:
cleartool find <vobtag> -element "{created_since(target-data-time)}" -print
Not only can you compare it with your current view, and find what has changed, but you also can copy over the older files in your current view.
See also:
ClearCase : how to revert / get a snapshot view of a specific date/baseline?
Get all versions from a specific time - ClearCase UCM
Find files in Clearcase view newer than a specific date?
How to copy an element or file from Clearcase with a particular label, without applying that label in config specs.
I don't want to change the config spec of my view, but I need to access an older version of one of my selected files, and I would like to do so directly from my existing view (again, without changing anything).
I know the version I want to restore (from instance version 2, even though I am selecting currently version 3 in my view).
What cleartool command would you use in order to access said old version?
You can use the extended pathname, but only using a dynamic view (any existing dynamic view, not particular config spec required).
The article "To open a version not currently in your view from a command prompt using a version-extended path" mentions that you can use a snapshot view too, but you would need for:
the element to be already loaded (obviously not at the version you want)
the old version to be copied into the view (as a private file): cleartool get -to prog.old.c prog.c##/main/r1_fix/1
Note that the contextual menu of a version tree includes a "Send To" entry which would effectively do the cleartool get (i.e. the copy) for you.
But in a dynamic view, you don't need to copy anything, you can directly reference any old version:
cp foo.c##/RLS4.3
cp include.h##/main/bugfix/REL2
See also version selector:
If a version label was defined to be one-per-element, an additional link/file system object appears at the top level of an element's directory tree.
For example, if BL3 is a one-per-element label, these version-extended pathnames are both unambiguous references to the same version:
hello.c##/BL3
hello.c##/main/bugfix/patch2/BL3
In effect, this feature allows you to reference a version without knowing its exact location in the version tree.
In a dynamic view, when you see hello.c in your view (and that can be any selected version, not the one you want with the label), you actually can do:
cd hello.c##
dir
That will list all the unique labels for you to choose from.
I need to list the latest baseline for each component in a clearcase UCM stream one by one. I am aware of the "%[latest_bls]p" option used with -fmt . The problem is that it lists all the latest baselines for all components together.
What I need is, given component name C and stream name S, display the latest baseline for component C in the stream S.
Thanks for your help.
If you consider the fmt_ccase options, %[latest_bls]CXp will always list the latest baseline for all components of a given Stream.
So it is best to parse the result, and for each baseline name, to display its component name:
cleartool describe -fmt "%[component]Xp" aBaselineName#/aPVob
Also:
%[latest_bls]CXp seems to be the only way to get directly the latest baseline, and it is always for all components.
What you can also do is list all baselines for a given component and stream:
cleartool lsbl -comp C -stream S
, and select the last one.
That should be more in line with what you want (ie use only your 6 component names instead of all that parsing/grep'ing)
Check this:
cleartool lsbl -fmt "%[latest_bls]p" -component C -stream S
Further more, do you know "R&D Reporter"? It helps you generate a report which is based on all changes made between latest baseline and previous to latest baseline, for each component. More than that, it enables you to define what your "latest baseline" is: you can use regular expressions , streams or promotion levels to filter out unimportant baselines. If you have further questions, let me know.