Create project specific files in Clearcase - clearcase

I'm wondering if it is possible to create project-specific files in Clearcase. What I want to do is create files in one project, use Clearcase to source control the files, but I don't want those files to leave that porject because they don't have applicability in any other project.
For example:
I want to manage database changes in Clearcase. I plan on having 3 folders in each project (projects are created for each release of the software). The folders are "install", "update", and "backout". The install folder contains the scripts needed to build a database from scratch for the stream that I'm working in, let's say the stream is in project "13.03". The "update" and "backout" folders contain scripts needed to update and backout the changes to bring the database from 13.02 to 13.03, and vice versa.
In the 13.04 project, I'll have the same folder structure, but I don't want the contents of the "update" and "backout" folders in my 13.04 because I'll have other files that will bring the database from 13.03 to 13.04.
So what I'm looking to do is essentially create "project-specific" files/folders in Clearcase.
I'd gladly take any other recommendation for managing database changes in Clearcase. Keep in mind that the 13.03 and 13.04 (for example) baselines could be being developed at the same time.

It seems you are referring to the same project, with different versions (13.02, 13.03, ...).
If that is the case:
simply update your 3 folder according to the current version
put a baseline (if we are talking about ClearCase UCM) on the component representing your project
if evolutions needs to be done on any file of a specific version, make a child Stream called, for instance, "13.03", and update your "13.03" folders there. They will evolve in complete isolation in their own dedicated "13.03" branch.
If you have to create a new directory for each project version (which means you don't need a source control system at all, just a simple backup system), then you have no choice but to recreate each of those folders with their appropriate files in them, making new "add to source control".

Related

Visual Studio 2017 Folders in Project

I am using Visual Studio 2017 to write some stuff in C. When I open a new project, I have some default filters and in "add" option for the project there's only filter and no folder/directory.
I want my project to have a folder structure, but can't add folders to the project in Visual Studio. Looking online I can only find solutions for adding an existing folder to a project and not adding a new one.
How can I add new folders to a Visual Studio C project?
How can I disable filters?
The way that I think of Visual Studio 2017 (earlier versions of the IDE as well) and its presentation of files in File View is as a kind of virtual file organizing system. File View allows you to logically organize files, presenting the actual file system in a more helpful manner.
The icons that look like folders in the File View are not really folders but are instead labels, called filters, which allow you to group your files however you like regardless of how they are physically stored in your persistent storage area such as a hard drive.
Filters are more flexible by not corresponding to the physical file folder hierarchy as they allow you to organize files that are all in a single folder into logical groups. Filters allow this to be done at a finer grain than is typically used by grouping files in folders. Filters also allow you to group files that are in multiple folders together into a single logical folder within File View.
However filters can be confusing because most of us are so accustomed to file folder hierarchies that the filter methodology can disconnect the logical file as represented in a Filter from the physical file location located in a folder.
My typical methods of adding files
Typically what I do is to create the physical folders through Windows or doing a clone of an existing Git or Subversion or VS Team Services source tree. With something new I may use the New Solution or New Project wizard to create my initial starting point and then organize and add files and folders physically through Windows and then go into the Visual Studio IDE to create the Filters and then Add existing files to the Filters. In some cases I will create sub-filters within a Filter in order to better organize the files within a physical Folder.
For new files I will just use the Add New Item menu option to add the item to the proper project. If you right click on a filter name, the new file will automatically be added to the filter. In some cases when I have added additional filters to the project to organize files, I will drag the newly created item to the proper filter and drop it there.
This drag and drop is not changing the physical location of the file but is changing its logical position by moving it from one filter to another. To move the file physically from one folder to another, I will usually do that with Windows. Just remember that if you do physically move a file with Windows you must also modify the file's entry in the Visual Studio 2017 filter to which it has been assigned, I usually do a Remove on the file followed by Add Existing Item and browse to its new location.
It appears you can not have the same file in multiple filters within the same project.
In some cases when I Add New item, I will change from the suggested folder displayed in the Add New Item dialog to a different folder using the Browse button. And if I need a different extension to the file then I will make that change as well, a common action when adding a new C source file to a project which requires changing the .cpp extension to .c.
You can also use the Browse button to navigate to a folder where you can then create a new folder if you like using the right click menu that displays when you do a right click in the displayed list of files and folders.
Unfortunately, the Add New Item dialog always wants to put a file into the project directory with all the other files. The Add Class wizard doesn't give you the opportunity to specify anything other than the default project folder. I have in some cases created C++ classes using the Visual Studio IDE, removed them from the project, moved the physical files to where I want them to be and then added them back to the project.
The filter approach seems to work well because the total solution is divided up into multiple projects and each project has its own physical folder. The multiple projects may correspond to particular DLLs or static libraries or other components that are used by the solution.
See also Can I configure Visual Studio to use real folders instead of filters in C++ projects?
Example screenshots of folder and filters
Here is a Windows folder view of a small project of the resources being used:
And this is how I have the filters set up. Normally the list of resource files can be quite long however I have created two sub-filters to logically separate out bitmap files from icon files though they both share the same physical resource folder.
Also the filter named PepIncludes corresponds with an actual physical folder named the same while the filters named "Header Files" and "Source Files" are groups of files that all reside in the same physical folder which is named the same as the project folder.
The following screen shot shows how filters can provide flexibility. I have a folder with include files, PepIncludes, and I have the same collection of files in two different projects within this Visual Studio 2017 solution. In a solution with 30 or 40 projects, this can make it a lot easier to manage files. For instance you can see that after modifying the file "ECR.h" the fact that it has been modified shows in both of the filter file listings (the small red check mark next to the name).

sonarlint ruleset files when working with version control

We are using TFS and the added .ruleset files now participates in the check-in process. However, does not make sense to check-in those files. Just ignore the file on the source control does not solve the problem because those files are added in the csproj structure as well. Is there a plan to keep those files in a folder outside the project structure? Why, when connected to the SonarQube server, the plugin just download those files at the analysis time?
Thanks
There is no way to keep .ruleset files outside the project structure, as the rule set is to meet specific project needs associated with code analysis. It sits in a project properties.

Merge code from several folders

Good Morning,
I am working on legacy code. This legacy code consists of multiple projects (language C with NI LabWindows CVI) and was never manged in a source control System but only in on folders. Over time it got a little messy and copies of this folder were created and changes were made to all folders depending the project that was built.
The result is, that there are 5 folders each containing different codes bases for what once was the same code. Also many files were modified in all folders because they are used in several projects. Each project was only build from 1 of the 5 folder (so project A was only build in folder 1, project b in Folder 4 etc.). It is not only raw code, but also user interface files.
I hope that was clear so far.
My task is to merge all the code into one one codes base (as it started of originally). And I would like to get some suggestions.
Here is the plan:
1. create baseline version of one folder that is supposedly that one with the most changes.
2. create GIT repository to store the code and all changes
3. go through all folders and merge files into baseline version using file diff software. (Folder 1 is baseline, merge folder 2 to baseline, merge folder 3 to baseline etc.)
Do you have any comments on this plan? What is good? Bad? Are there tools I can use?
This seems like as good of a plan as any. You have a mess on your hands either way.
If there are many changes to the user interface panels, that could be a headache. The UIR files are binaries, which will make git merges and diffs useless.
Go into each project and under Options->Preferences select the box to save .UIR files as .TUI files and save the project. This will give you a text file output describing the user interface and allow you to use diff tools properly.
EDIT
When the User Interface is active, you can directly select Options->Save in Text Format to do this as a one-off.
Good Luck!
It might also be worthwhile to use the UI to Code converter under CVI's Tools menu to convert all your UIRs to code. This should make them more compatible with text-based source control (like the save in text format approach), but may also ease the process of merging UIs.

ClearCase "locking" files -- How to refactor?

While at home for personal projects i use Mercurial, at work we're using ClearCase.
I am attempting to run a few horizontal (touching lots of source files) refactorings in Visual Studio for the code base, however, for since each file is locked by ClearCase, it has to be unlocked and prompts for the actual activity that the check out is for.
In Mercurial, there's no such concept as far as i'm aware of: files are not being locked at all at any point of time!
Is there a way of doing such a refactoring, or any other operation that acts on multiple files, without having to check out each and every one manually?
In a DVCS (distributed VCS like Git or Mercurial), you simply cannot "lock" a file, since all the other repos wouldn't be aware of such a "status".
But with ClearCase and its locking mechanism (optimist with "unreserved checkout" or pessimist with "reserved checkout"), you need to make a checkout to tell ClearCase you will modify some files.
However, you could also, for large refactoring:
make and update a snapshot view
set all the files as writable (through an OS-based command, not through ClearCase "checkout")
perform your changes
search for all hijacked files and checkout/checkin those files then

ClearCase: Versioning at file level

I have a perculier problem about how to maintain a clearcase project.
This project is a xml schema repository where each schema has a version. This repository is common and is used by all the apps in the enterprise. From clearcase prespective the project has a single component.
Now the apps can be using different versions of the schema(s). So we are trying to figureout a way to setup the project in such way that a project can have a baseline of what versions of these files are included in a build.
The only way we know of how to do this is to create a component for each schema or group of schemas and create a stream for each app to include the components they use. But that would result in too many components.
Has anyone dealth with something like this before? We are prepared to restructre the whole project if necessary, so we are open to any idea. Thans for the help.
The idea behind a UCM component is to reference a coherent group of file, i.e all files within a UCM component are labeled (baselined) even if only one of them if modified.
The life-cycle of those files is common, and they are used as a whole.
In your case:
each file (xml schema) can evolve on its own
the granularity is at file level (and not group of files)
You can group those files in one component, but each of your project will then need to extract its own version of the relevant file, through extended path names.
That means:
your project reference the latest baseline of the "XML schema repo" UCM component
it extract from that component the relevant version of the various xlm files it needs
and copy those version in a private (non-versioned) directory

Resources