1

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?

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
Fred Jand
  • 699
  • 7
  • 25

2 Answers2

1

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.

Fred Jand
  • 699
  • 7
  • 25
  • 1
    I have edited my answer to reflect your conclusion. I share your (strong) feeling towards ClearCase. For what it worth, after having administer ClearCase for many years, my current mission is about helping the teams transitioning from ClearCase to other VCS ;) – VonC Nov 20 '12 at 06:26
  • :) IBM has another "piece of.. " called Rational Synergy which manages to be even more user-unfriendly and slow compared to CC :) – Pulak Agrawal Nov 23 '12 at 07:05
0

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.
Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Note: the only way to ignore files is in a CCRC view in an Eclipse environment (https://publib.boulder.ibm.com/infocenter/cchelp/v7r1m0/index.jsp?topic=/com.ibm.rational.clearcase.ccrc.help.doc/topics/t_ccperspective_ignore.htm), which is not the case here: non-java project, full ClearCase installation. – VonC Nov 19 '12 at 21:03
  • I had seen that thread, that solution doesn’t work for me. As I mentioned the project is huge so clearing unwanted files would take more time (maybe multiple days) than tracking down wanted files and it is a error prone process. Having an ignore list would be nice but is not that important I can handle that if I get the list of files that are not in the repository but you mean that clearecase in not able to track added files either? – Fred Jand Nov 19 '12 at 21:42
  • @FredJand So would you rather add everything and then remove what is in extra? Anyway, that is ClearCase for you. Clearfsimport is it. And I am not sure what you mean by "ClearCase is not able to track added files either". ClearCase will detect non-version-control files (in that they would be private in your view). – VonC Nov 19 '12 at 21:49