tags:

views:

916

answers:

3

How to set the CVSROOT environment variable in WinCVS?

+1  A: 

You can set it in the preferences pane at the "General" tab.

akr
addition; see http://www.devdaily.com/wincvs/HowToUseWinCVS/InitialSetup.shtml for an image.
Wimmel
No, you cannot do that with version 2.1.1.1
Lakshmi
+1  A: 

In WinCVS 2.0.2.4 (and presumably similar builds)

Go to Admin->Login The is a ... button that brings up a popup to build CVSROOT. Once you login, the CVSROOT variable should be set.

John Sibly
Yes, I did that. But this only applies to login and when I do import or add it asks me to set the CVSROOT. I observe this when there are 2 or more repositories on the server.
Lakshmi
How about going to "checkout module"? I'd forgotten this but there is a place to enter the CVSROOT there, which I believe applies to the code you go on to check out. Not sure if you can set it retrospectively on already check out code though.
John Sibly
+1  A: 

The simple answer is: You don't need to. The CVSROOT environment variable is terribly overrated. CVS(NT) will only use it if all other methods of determining the repository connection string have been exhausted. People often assume that it is the other way round and then wonder that changes they've made to the CVSROOT environment variable are not effective.

The order in which CVS evaluates possible sources for the repository connection string:

  1. The -d option on the commandline. This is what WinCvs allows you to set via the CVSROOT option on the following dialogs: login, init, import, checkout and rtag. Also note that WinCvs remembers the CVSROOTs you've used in the past: If you revisit one of these dialogs you can simply pick the previous CVSROOTs from the dropdown.

  2. The contents of any ./CVS/Root files if present (they have the hidden attribute set by default in case you don't see them). This means that as soon as you are running a command inside a working copy there is no need to specify the CVSROOT via any other means. WinCvs also displays this in the status bar if available.

  3. Finally, as a last resort, the CVSROOT environment variable. This is useful when you're actually working on the commandline, executing commands outside a checked out sandbox but inside WinCvs there really is no point... either you already are inside a sandbox or you can simply pick the CVSROOT from the dropdown where it is needed.

If you need to change the connection settings of an existing working copy you need to modify the contents of the ./CVS/Root files. WinCvs comes with a macro that will simplify this for you. Just select the root folder of the working copy you want to change the CVSROOT for and go to Macros|CVS|Change CVSROOT...

Also see this FAQ item on the whole issue: http://cvsgui.sf.net/newfaq.htm#CvsrootWizard

Oliver Giesen