2

When I try to checkout/checkin file in Visual Studio it runs CC command and wait for result. This operation completely blocks Visual Studio.

Is it possible to run checkin/checkout command in background from Visual Studio? I know this might lead to inconsistency when operation fails.

i.e. changing variable name causes Visual Studio to checkout a few files and stops me from editing or even reading code which is very annoying ;/

Something like 'checkout/checkin in background' or 'checkout/checkin asynchronously' exists?

user617768
  • 87
  • 7

2 Answers2

3

I disabled ClearCase integration into Visual Studio altogether (Start IBM Install Manager, change ClearCase installation and uncheck the VS integration). Whenever you save a changed file you then get asked if it's okay to overwrite it (hijacking the file), which is a lot faster than checking out every file as soon as you edit it.

Of course you need to periodically check out those hijacked files, but they will be listed whenever you perform an update (or "Find modified files") on your View and can then be all checked out at once. If you see you undid your changes again, you can undo the hijacking as well, and will never have created a version on your private branch, which is a big plus in my opinion ;)

The ClearCase Menu in VS will disappear though, so if you want to open the version tree of a file for example, you need to open it in explorer first. If you don't like this, you can enable the integration again, so it can't hurt to try this way of working.

Oh, there is another possibility: You can use the ClearCase Menu to hijack the file before you edit it (Alt+c, j), this way you retain the benefits of integration without having to check out. Drawback is, that you need to keep in mind which files are checked out before editing ;)

SvenS
  • 795
  • 7
  • 15
  • Seems like the only reasonable way to solve this issue. In that way can I hijack a file from visual studio? I understand that changing behavior of VS plugin to hijack instead of checking out files is impossible, but maybe it's possible to do manually? – user617768 Oct 24 '12 at 07:07
  • Yes, you can hijack from within Visual Studio (see the last paragraph of my answer). But it seems you can't tell it to hijack them by default instead of checking them out when beginning to edit, if that's what you're asking. – SvenS Oct 24 '12 at 13:30
  • I just noticed you're using the IDE to edit multiple files at once to e.g. change a variable name. Here you don't know for sure which files are going to be edited, so you can't use the "Clearcase -> Hijack" command, which only hijacks the current file. You're left with disabling the IDE Plugin, or somehow hijacking all source files from outside the IDE so the Plugin won't try to check them out. – SvenS Oct 24 '12 at 13:46
  • Of course, you could copy the content of the view to another directory, ignore any version control related error messages VS will display when opening the solution there, apply your work, and then robocopy all changed files back into the view, thus hijacking them. You could put that into a script that that also checks out changed files. I don't see any substantial advantages over disabling the Clearcase plugin though ;) – SvenS Oct 24 '12 at 13:51
1

That seems to be the current way this plugin is working, both for ClearCase full client and (even worse) for CCRC (Remote client, with an additional "focus" issue described here)

Using hijacked files as SvensS suggested (upvoted), you will need to find all those files (see "Command to find all view private files in the current directory recursively") and checkout/check them in.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Using the "find view private files" approach you linked (love that command by the way) isn't necessary for hijacked files already under version control. You can "find modified files" in your view (in "clearcase" sub menu of windows explorer context menu) or make an update. All hijacked and checked-out files are listed, which you can then compare with previous, show version tree, check out, undo the hijack etc. This does, however, take nearly as much time as updating the view, so you probably won't do this every evening, but more like once a week instead. – SvenS Oct 24 '12 at 13:37
  • I'm talking about snapshot views, btw. I just checked and can't seem to find the same feature for dynamic views, so I guess that's what you had in mind when writing the answer ;) – SvenS Oct 24 '12 at 13:56
  • 1
    @SvenS: hijacked for dynamic views: http://stackoverflow.com/questions/7798915/clearcase-can-i-hijack-a-file-in-dynamic-view/7799307#7799307 – VonC Oct 24 '12 at 14:03