Fred Jand
Fred Jand

Reputation: 699

How can I add bunch in multiple folders to ClearCase source control?

I am working on a C# project, It has a solution which has more than 100 projects and some thousands folder and files, I have added some new files to different projects of this solution in different folders.

Now I want to add them to the source control and check them in, but I don’t know how I can track them as a bunch.
So far I have to track them down one by one to add them!

Note: there are hundreds of private files in those folders that should not be checked in.
I used to use Mercurial and by that I was able to see the modified files and new files and I was able to create ignore list so I was able to pick the files that I wanted to add to the repository and ignore the ones that I do not wanted to add, but I can’t find anything similar in ClearCase.

I found some threads that explains that how to add files as a bunch but only when you want to add whole content of the folders.
I do not want to add all files in those folders to source control, only selected files shall be added and I want clear case to ignore other files. (as I mentioned I know how I can do this in mercurial through the TortoiseHG workbench but I can’t find similar feature for ClearCase!)

How can I do this action by CleareCase?

Upvotes: 1

Views: 1060

Answers (2)

VonC
VonC

Reputation: 1325137

First, there is no .hgignore or .gitignore with ClearCase.
Second, the usual way to add a large number of files is clearfsimport.

So you can make a copy of your projects, and clean the unwanted files, clearfsimport the rest (as described in this thread).
See "How can I use ClearCase to “add to source control …” recursively?"


The solution the OP selected is compliant with this mandatory cleaning you have to do before clearfsimporting the source files into ClearCase:

  • make a local (DVCS: Git or Mercurial) repo within your existing source file
  • build a .gitignore or .hgignore with the files to ignore
  • add everything
  • commit
  • clone that repo elsewhere and you have your "clean" source to clearfsimport.

Once you have your source in ClearCase, one possible way to work your way around that tool is to:

  • create a ClearCase snapshot view
  • Make a Git or Hg repo in it (like in "How to bridge git to ClearCase?"), add and clone like above
  • work with your favorite DVCS (in a separate working tree than the snapshot view)
  • only commit the stable state of the code back in ClearCase, by simply clearfsimport -mirror back those files in ClearCase.

Upvotes: 0

Fred Jand
Fred Jand

Reputation: 699

Ok, it seems that clearcase does not have a feature to display (tracked) files which are not in its repository, unless you want to import them all together (which is an undesired action in my case).it might have something but It won't surprise me if it doesn’t, I have to use this piece of … for the last 2 years and I am always wondering how this .. has survived so far, everybody in my team hate this software but we are not empowered to force the company to switch to another source control.

This is how I fixed (tweak) my issue, I create a copy of the project in a back up folder then I created a local Mercurial repo and push the whole content into repo except the one that I didn’t want( by creating ignore list), then I remove the content of the project folder except the view.dat and then update it through the Mercurial. So I had the whole desired content then used clearfsimport so I checked in desired files, then I copied back content from the back up copy into the project folder.

Thanks to clearcase I will start looking for a new job from now, I am tired of dealing with this.

Upvotes: 1

Related Questions