ClearCase eclipsed files hoo-ha - file

I'm having a tough time with ClearCase. I'm working with a dynamic view.
Somehow, I got two files that are eclipsed. I compared the folder in my version (with the eclipsed files) with every version on my branch and every version on the main branch. The original files are nowhere to be found.
I searched for the files in Windows Explorer and found them in the lost+found directory (with a 32 character extension). This directory appears to be invisible because I can't see it in either Windows Explorer or ClearCase.
I opened a DOS window and ran cleartool. I removed the files (I had fun typing it all, plus the 32 character extension at the DOS prompt). I could not find a way to delete them from either Clearcase Home Base or ClearCase Explorer.
I thought this would solve my problem, since there are no more files with the same names anywhere on my computer.
I deleted the eclipsed files and created them again in Qt Creator. But when I opened ClearCase Explorer again, there they were - eclipsed! I cannot figure out where the evil twins are. I tried finding the eclipsed files by using cleartool. Nothing. I've tried many approaches I've found online - none work.
I tried stopping and starting the view. I deleted the eclipsed files again, closed Qt Creator and then opened Qt Creator again and recreated them. I tried many other things suggested - none made any difference.
If I'm eclipsing existing files, where are they? I'm starting to think that the real evil one here is the parent - ClearCase!

Eclipsed doesn't mean evil twins (the fact that you add multiple times a file does though).
When you add to source control a file, ClearCase will:
checkout the parent directory
access the file in order to create a temporary one (called 'afile.mkelem')
create the file in the ClearCase vob
check in the parent directory
I usually see repeated eclipsed file when ClearCase isn't able to access the content of a file, because another process prevents it.
Try adding those files after closing the Qt editor.
The OP Rob Moore mentions having solved the issue with:
I changed the view to main/LATEST, and the file showed up.
I went to the tree view of that file and noticed that I had a branch there with one version.
I compared my branch version with the main/LATEST and they were the same, so I deleted my branch and put my label on the main/LATEST version
So it is possible that, as soon as the element was added, it wasn't properly selected by the config spec (being a new version on a branch which wasn't part of the config spec), and its state reverted to "eclipsed".

Related

Why project structure files and directories not show in PyCharm [duplicate]

I'm working with PyCharm 2019 and Django, in Windows 10 in a project that I haven't opened in a year. The Project files window is showing up as yellow, which seems new. What does this mean and how to I get the files to appear as white.
What the yellow background usually means is that the files are excluded form the project (it can also mean the files are "read-only").
This might happen for several reasons, the .idea folder might have broken and you need to delete it and recreate the project. If your project is installed in a venv sometimes the source files are marked read-only (which means the source files being edited are the versions installed in the venv).
So here it gets complicated because it can depend on the specifics of the project itself.
My usual steps for this problem are:
Close and reopen the project.
See if marking one of the directories as sources root changes the file color in the project tree. (Files might have been marked as excluded from the project for whatever reason.)
Just to help diagnosing the issue, open a search and go to costum scopes, see what scope those directories are associated with.
Check if file permissions are read-only. This can happen if you logged into PyCharm (or the OS) with a user account that doesn't have editing permissions on those files.
Delete the .idea folder (so the IDE recreates it) and create a new project with those files. (Remember to make a backup copy.)

Changing Directory of STM32CubeIDE Projects

When I create a new STM32CubeIDE project, it default saves it to my /Documents directory. This isn't too bad except I like to have a folder for each application so that it isn't just a bunch of files. I tried creating a folder called "STM32CubeIDE" to save new projects to, put it gives me an error: "overlaps the location of another project".
I've done some googling and found that this issue also exists in Eclipse (which makes sense) but couldn't solve my problem from those solutions.
I was also wondering if there is a way to move all of my existing projects to this newly created folder? Last time I tried, the IDE flipped out on me and couldn't find my stuff.
First of all, do not call your folder "STM32CubeIDE" if this already exists. Use a different name, because this is normally used by default and it may cause issues (probably the reason why you are getting that error).
When you install or update STM32CubeIDE it gives you the option to choose where you want your default folder to be. For example, my default folder is
C:\Users\%USERPROFILE%\STM32CubeIDE\workspace_1.6.0\
Now if you want to use different folders for different projects, there are two options:
You can Export your project (application) to a desired folder and then Import it using the File tab. This is a good method if you want to make backups, or just want to make sure that all relevant files are transferred correctly to avoid "missing file" issues.
The other method (my favourite) is to simply copy you project folders and paste them to a different folder, wherever you want to put them. Then you simply open STM32CubeIDE, go to File > Open Projects from File System... and chose your project. You might get a pop-up about software compatibility issues (if you made an update), etc. but this should open up your project and show it in the Project Explorer.

How to add all the files in a folder to source control via cleartool command?

I am having a folder where lot of files and subfolders , adding it to source control via UI is consuming much time.
How to add all the files (including files inside subfolder) to source control using cleartool?
(I am using clearcase UCM)
As mentioned in "How can I use ClearCase to “add to source control …” recursively?", clearfsimport is the way to go.
However, clearfsimport will take a source an import it in your view, so:
it is best to keep the source outside your view (to avoid confusion when ClearCase tries to add the source file in the destination which is the same directory)
you must "clean out" the source directories first (because the clearfsimport command will import... all the files under the root directory you mention)
See "Creating a new subdirectory structure in ClearCase?" as an example: you can preview the result of an import first.
Please user clearfsimport or if you are working with eclipse or Intellij then there are plugins from sourceforge (eclipse) which has a options to share entire project at once to CLearcase , Below are the plugin details.
https://sourceforge.net/projects/eclipse-ccase/
Note : Clearcase has a limitation that if there is a text file with more than 8000 characters in single line , There is error at run time using clearfimport utility, This can be solved by writing your own bash script to do recursive checkin by handling the exception case . Hope it helps .
I saw another comment from a similar clearcase question that suggested typing in '*' in the topmost directory required, select all, rc->cc->add to source control.

"Access Denied" error trying to delete a ClearCase .mkelem file

Why do I get these .MKELEM files? How do I get rid of them?
I found some docs that said they are temp files created by ClearCase GUI when adding files to source control. But sometimes, they don't go away.
ADDITIONAL INFORMATION: I "get access denied" trying to delete or rename the .MKELEM. They seem to get created when I add new files to clearcase.
As mentioned in the mkelem tip page:
During the element-creation process, the view-private file is renamed to prevent a name collision that would affect other Rational® ClearCase® tools (for example, triggers on the mkelem operation). If this renaming fails, you see a warning message.
If a new element is checked out, mkelem temporarily renames the view-private file, using a .mkelem (or possibly, .mkelem.n) suffix. After the new element is created and checked out, mkelem restores the original name. This action produces the intended effect: the data formerly in a view-private file is now accessible through an element with the same name.
If mkelem does not complete correctly, your view-private file may be left under the .mkelem file name
The fact that a .mkelem stays can be, like LeopardSkinPillBoxHat mentions in his answer, because of a file blocked due to a process.
It can also happens:
in ClearCase view incorrectly protected (where ClearCase can checkout the new element, creating a version 0, but cannot check that element in.
alt text http://publib.boulder.ibm.com/infocenter/cchelp/v7r0m1/topic/com.ibm.rational.clearcase.dev.doc/topics/cc_dev/images/creating_element.gif
when a trigger prevents the checkin part of the new element creation
when the view actually exclude CHECKEDOUT versions! (no 'element * CHECKEDOUT' rule...)
on Solaris 10, due to an incorrect format in one of the ClearCase jvm config file. (ClearCase 7.1)
when add to source control is used on Windows in views mapped to a mount point (Mount points are persistent directories that point to disk volumes), only in old ClearCase 2002 or 2003.
See also the Under the hood: What happens when you add to source control article.
The .mkelem files are temporary files generated by ClearCase when adding a file to source control. If the file gets added succesfully, they are usually deleted. If something goes wrong during the process (e.g. it cannot create the branch specified in your config spec), the .mkelem file may be left behind.
I'm guessing that a process or service somewhere has a lock on the file. Rebooting should fix the problem. Or try using something like Process Explorer to see what may have locked the file.
Also, from this page:
.mkelem
Files being added to source control
from the GUI will use this extension
during an "Add to Source Control"
operation.
If you see this file in your view
during the mkelem process, that is OK.
If you still see the file after the
mkelem operation is complete, that is
not ok. You will likely need to rename
the file (remove the .mkelem
extension) and add it to source
control again. This can be seen when
your antivirus software is scanning
the mvfs. Refer to technote 1149511
Support Policy for Anti-Virus and
ClearCase for further information.
You may try the following from command prompt:
ct ls -l {filename}.mkelem
This will show the links,
then please try the following to link the actual file:
ct ln -c "scm:relink" {link} {actual filename}

Copying a KDevelop project to another directory

What is the best way to copy an existing KDevelop project folder to another directory, so that the new project contains all the correct directory settings and configuration and there is as little manual editing (and thus less room for error) as possible?
There is some information about someone being successful here about copying the project and then editing every reference to the old path, but this is exactly what I'm hoping to avoid.
In fact, the Kdevelop manual specifically recommends against doing this (see manual, chapter 8, "Project Hacking" [would post a link but I'm nerfed for now]).
This project is shared on an SCM and should have as little dependency on a particular user as possible.
Project-files are project-related and therefore contain a lot of absolute paths etc. Its mostly easier to just import the sources again as a new project.
I'm using CMake which means that I just need to reset build-paths and the install-prefix. Sometimes environment variables needs to be added but thats just copy+paste.
I just had the same problem. An answer to a related question brought me to the following approach:
One can keep (and put under version control) the file <project name>.kdev4 in the top directory of the project. (At least in my case, it doesn't contain any absolute paths.)
The hidden directory .kdev4/ in the top directory of the project should be deleted after copying (and excluded from version control) while kdevelop has not loaded the project.
The project can now easily be reopened by kdevelop using Project -> Open / Import. After pointing kdevelop to the top directory of the project, the file <project name>.kdev4 is recognized and can be accepted. kdevelop then asks for the missing options.
This solution should be clean and cause minimal overhead when continuing work on a project in another directory. In my case, when reopening a cmake project, I could simply accept the proposed defaults. The hidden directory .kdev4/ is recreated when closing kdevelop.

Resources