How do I use cleartool find to search a bare vob? Must I always first define a view?
I typically use CCRC and in this case I am looking for a list of all files of a certain branch type.
EDIT:
This page says:
Typically, you start with all objects in a directory tree as seen in
your view. You can also start with all objects in one or more VOBs,
regardless of they are visible in a particular view.
I'm looking for information on the version of the command that the second sentence describes.
You cannot use cleartool in a CCRC setting.
CCRC (ClearCase Remote Client) is a light-weight ClearCase installation which communicates with a CCRC server (which, in turn, talk to a full ClearCase Vob server).
You can use rcleartool, the CCRC CLI, but it doesn't include a find comnand.
'cleartool find' itself is always used in a view, because it needs a path (to at least a Vob).
You can also start with all objects in one or more VOBs, regardless of they are visible in a particular view.
That doesn't mean you can use cleartool find outside a view.
The two pages giving a lot of examples are:
SAMECS find examples
IBM additional find examples
The SAMECS link and the cleartool man page are clear:
-avobs
By default, find starts with all the elements, branches, and versions in all the VOBs mounted on the local host.
In a snapshot view, find –avobs issues a warning if all mounted VOBs have not been loaded into the view.
This option depends on the MVFS and is ignored on hosts that do not support dynamic views.
You must be in a view context to use find –avobs.
If the CLEARCASE_AVOBS EV is set to a colon-separated list of VOB tags (in UNIX; in Windows, list items must be separated by semicolons), this set of VOBs is used instead.
In short, to access any vob content, they must be loaded (snapshot view) or mounted (dynamic view). In both cases, even though the find is not restricted by the view confi spec (especially in the case of the -avobs option), a view is still needed to run cleartool find.
Related
I am using IBM Rational Clear Case. Due the current world wide health situation, I am forced to work from home.
The best way and may be the only one, when using Visual Studio, is working with a Web View (Please correct me if there is a better way) - I assume this is called CCRC (Clear Case Remote Client). It is similar to a Snapshot View but without constant connection to the Clear Case server at work (This statement is not entirely correct).
When working with a snapshot view or for that matter with a dynamic view, I can change the setting to use Beyond Compare as the tool used for merge and compare in Clear Case.
Now for my questions:
1) Is there a way to do this also for ClearTeam Expolrer, which is where I control and manage my web view?
2) Any other workaround to use Beyond Compare with a web view?
I found the answer on IBM support page: Changing the Diff/merge Type Manager in CCRC 7.1.1 and later. Where it is explained how to change this setting in the ClearTeam Explorer.
The description do not exactly match my version of Clear Case (9.0.1.07) :
In CCRC 7.1, go to the menu
Window > Preferences > ClearCase Remote Client > Integration > Compare Merge > Manage Providers
Should probably be:
In ClearTeam Explorer, go to the menu
Window > Preferences > IBM Rational ClearTeam Explorer > Integration > Compare Merge > Manage
In addition the following is probably valid for kdiff3.exe:
Choose 'Supports Compare Operations'
Fill in the arguments for compare:
%contribs% -fname "%filename1%" -fname "%filename2%"
Choose 'Supports Merge Operations'
Fill in the arguments for merge: %contribs% -o %merge_out%
On Scooter Software site I actually found the correct arguments.
These are the modification for Beyond Compare:
Choose 'Supports Compare Operations'
Fill in the arguments for compare:
%contribs% /vcs1="%filename1%" /vcs2="%filename2%"
Choose 'Supports Merge Operations'
Fill in the arguments for merge:
%contrib1% %contrib2% %base% /mergeoutput="%merge_out%"
My Settings example:
Make sure to write BComp.exe and not BCompare.exe. Because of that, I had a problem opening the compare more than once.
And:
Doing the instruction recommended by IBM and Scooter Software did the trick and I could compare my code:
Using a web view is a good option, unless you can use directly snapshot views, as I explained here (CC8+)
In both cases (web view or snapshot view), the goal is to have the files copied on your local disk, to avoid network latency.
The problem is: ClearTeam Explorer does not come with a mgrs/map file to modify for you to declare your own diff tool (be it Beyond Compare or WinMerge)
So I used to get two web views:
one set to a fixed label
one for working
That way, I could diff between the two separate view folders.
I'm trying to figure out how can I switch between multiple ClearCase regions without going and modifying the ClearCase properties every time.
Any help would be appreciated.
Even in the latest ClearCase 9.0.1, changing the region does involve changing the ClearCase properties: see "Assigning a Rational ClearCase host's registry and region".
What you can do (if you don't want to fully switch region through registry/properties) is take advantage of the -reg/-region option for some command.
See for instance cleartool lsview -reg newtwork-region: you can list views of other regions without changing your current one.
But that remains limited to listing resources (Vobs, Views).
Once you are using commands within a view (lscheckout, checkout, ...), said commands are expected to work within the current region.
You might need to consider registering (cleartool register) a view from another region into the registry of this current region.
The alternative, as mentioned in the comments, is to modify the registry, as with this Javascript program REGION_SWITCHER.js from 2005.
Source code.
It modifies:
HKEY_LOCAL_MACHINE\SOFTWARE\Atria\ClearCase\CurrentVersion\Region
You can have multiple regions and share the views between them. The catch is that if you are in a mixed Unix/Windows environment, Unix can only use Unix views, while Windows can use both.
At my company, we have a Unix region and a Windows region. If I want to be able to use the same view in both regions, I create it on Unix and then use the Region Synchronizer (look for this on the Administration tab of ClearCase Home Base) to make the view available in Windows. The tool will take care of registering the view and creating its tag in the second region with the correct path needed to access it. (We share our Unix view storage locations with Windows using Samba.)
I'm not sure what you need to do to set ClearCase up in the first place so that it's able to see both regions, but as long as you can see both (and you can if the cleartool lsview -reg works), the Region Synchronizer is the tool you want to use to make it so you can easily check in and check out and otherwise use the view as if it were created in your own region.
Tried searching for this a number of ways and have not yet found an answer ...
Background
I am working on a legacy Perl application that has a lot of hard-coded values in it which should be configurable depending on where the app is installed. So, obviously, I am looking to externalize these values into a configuration file that may be located in one of a few "expected" locations. That is, using a traditional approach of checking for the configuration file in:
the current working directory,
the user's home directory (or a sub-folder therein), and
the system configuration directory (or a sub-folder therein)
where the first one found wins.
Where I am at
Perused the CPAN site a bit and found the Config::Any package, which looks promising. I can give it a list of files to use:
use Config::Any;
my $config = Config::Any->load_files(
{
files => [qw(sample.conf /home/william/.config/sample.conf /etc/sample.conf)],
use_ext => 0,
});
This will check for the existence of each of these files, and, if found, load the contents into an array reference of hash references. Not bad, but I still have to hard-code the locations where I search for my sample.conf file. Here, I assume that I am working on a Linux system, and that the location for the configuration file for all users of the application is /etc/. I could always add /usr/local/etc/ as well, but regardless, this is not system agnostic.
I can locate the user home folder using File::HomeDir for searching there, and it works correctly regardless of the system on which the application is running. So is there a similar package that would provide the /etc/ folder (or its equivalent on other platforms)?
Questions
Is there a way to do this without having to know what particular OS I am on? (Perl package or code snippet)
What is the "Perl best practice" way of accomplishing this? I cannot imagine that no one else has run into this previously.
Unless you don't plan to run your code on non unix-based hosts, according to the conventional directory layout and filesystem hierarchy standard, you may rely on a quite large set of well known places.
Anyway, nothing prevents you to dynamically build the file search specification to take account of platform oddities and their specific ways to get them (eg. File::HomeDir::Win32 vs File::HomeDir).
I am trying to copy some files out of ClearCase using PowerShell. I don't need to actually check them out - it's part of a build process, so I just want to be able to grab copies of them.
My guess is that I need to use cleartool, perhaps with "find", but I'm having trouble actually getting to the files that I want. No matter what "paths" I use I always get an error message. For example:
cleartool find My_VOB\A_Folder\A_Subfolder -print
gives me the error message, "No such file or directory."
I'm trying to make this script reusable by everyone in our development group, so I'd prefer not to have it tied to any specific view. Do I need to create a view on the fly to work with ClearCase?
If you want to copy files, you need a view to access them.
(That is what a ClearCase view, either dynamic or snapshot, is for: accessing specific versions of files)
Either that view exists (and its root path is passed as a parameter) or it don't (in which case I strongly recommend a dynamic view for those kind if reading access)
Even though a cleartool find can list versions not visible in the current view, it still needs a view as a starting point.
A lot of other find examples are available in this IBM article "Additional examples of the cleartool find command".
This thread lists some causes for the "no such file or directory" error message.
(like being in a private directory, as in "non-versionned directory")
This case shows an example of Powershell script using CAL (the ClearCase Automation Library)
You definitely need a view, and make sure the VOB is mounted.
Our PowerBuilder application is fairly large and has many objects in several PBLs for organizing our code. We often have 10 or more datawindows on one window, and these datawindows may be spread across two or three PBLs. For version control, we use exclusive check-out to avoid merge conflicts.
The situation is that when you right-click on a datawindow object from the Window painter you get a context-menu with options like "Script" and "Properties" and "Modify Datawindow...". We'd like to add one for "Check-out..." to avoid having to hunt for the datawindow in several PBLs.
Any ideas on how to do this, or something similar, would be greatly appreciated.
I think the best you can do is to create a temporary library at the top of your library list, locate your datawindows by jumping to them via "Modify Datawindow...", then saving them into your temporary library, and finally using the tools in your source control system to locate them by name and lock them.
One other trick that I use is to uncheck the tick box in the source control options that clears down the .srd etc files, then using your operating system's find tools to search on file name for these (since Powerbuilder still doesn't support searching for objects by name...). Of course if you don't have many objects, and if your objects don't have many references, you could always use Powerbuilder's search... but who do you know in the that fortunate position?!!
I think you've hit on a problem that a lot of people run into, which runs right through a loophole in PB that lets you start editing a DataWindow without warning you to check it out. Unfortunately, to the best of my knowledge there is no way to hook into the context menu.
However, you can hook into toolbar items. If that was the way I wanted to go, and I had plenty of time to spare, I'd write an app that I would launch from the toolbar, and here's what it would do:
Find the PowerBuilder window with APIs
Find the current sheet in PB
Get the object name out of the title
Get the current application (registry or PB.INI, depending on the version of PB, and may involve getting the workspace first, then the current target)
Get the library list (PB.INI or target file)
Do a LibraryExport() on the object that's open
Find all DataWindow controls (this may involve looking at ancestors to determine control types)
Identify dataobjects for these controls (again, you may need to look at ancestors)
Use LibraryDirectory() to get a list of all objects in all PBLs
Find the dataobjects' PBLs
Throw up a window listing the dataobjects and their PBLs
OTOH, if I had PBL Peeper (and, yes, this is biased advice), I'd
Launch the "PBL Peeper (Browse current application)" icon on my desktop (OK, that's a lie; I'd already have PBL Peeper open and would just switch to the Browse page)
Ctrl-Q (for QuickFind) and start typing the name of the object (if you pause, it will find a partial match on what you've typed)
Hit [Enter] once to accept QuickFind's selection
Hit [Enter] again to expand the object
Find the DataWindow control in question and RMB on it
Select "Go to Default DataWindow"
If it doesn't show the library and name in the microhelp (it's been a long time since I've released a version, and I can't keep track of what's in the released version), find the Up toolbar item to go up to the PBL
I know this doesn't achieve a checkout, but it does "avoid having to hunt for the datawindow in several PBLs". And, you can probably achieve this faster than my first suggestion.
Good luck,
Terry
The way I do it is to right-click and choose Modify DataWindow. When the painter opens you can just read the PBL from the title of the painter. Then close the DataWindow painter so PB will let you check out the DataWindow. For the more general case of locating an arbitrary user object, use Terry's PBL Peeper method.
You could separate the organization of PBLs used for development from those used for deployment.
As long as the PBL names don't conflict between the two views into the source code. The PBG files registered in source control won't clobber each other.
The downside is that when new objects are added or deleted, you will need to update both locations.
I would create a datawindow only PBL with all the related objects and put them in the same target. When I worked with that sub-system or report i could then check out all the objects in the same library.