Bug 6892 - [FAQ] Support for local CVS repositories
Summary: [FAQ] Support for local CVS repositories
Status: RESOLVED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Team (show other bugs)
Version: 2.0   Edit
Hardware: All All
: P5 enhancement with 6 votes (vote)
Target Milestone: ---   Edit
Assignee: Platform Team Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: faq
: 22835 64403 82112 83911 114354 137720 149100 281719 (view as bug list)
Depends on:
Blocks:
 
Reported: 2001-12-13 10:17 EST by Birgit Guder CLA
Modified: 2009-08-30 02:32 EDT (History)
13 users (show)

See Also:


Attachments
:ext: wrapper works around bugs 6892, 35142, 35304 (1.71 KB, text/plain)
2003-03-19 14:18 EST, Chapman Flack CLA
no flags Details
wrapper using Windows' built-in cmd.exe (68 bytes, text/plain)
2005-08-17 22:30 EDT, Nitin Dahyabhai CLA
no flags Details
Bash shell script for wrapping local/remote CVS execution (562 bytes, text/plain)
2007-05-14 10:29 EDT, Roland Kaufmann CLA
no flags Details
DOS batch script for wrapping local/remote CVS execution (784 bytes, text/plain)
2007-05-14 10:30 EDT, Roland Kaufmann CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Birgit Guder CLA 2001-12-13 10:17:02 EST
The CVS Plugin currently only supports the connection types pserver , extssh and ext. These 
require an accessible CVS server running either on a UNIX/LINUX machine or a Windows NT machine. 
It is not possible to set up a CVS server on Windows 98, only local repositories are supported here. 

So on a standalone Windows 98 machine, the whole CVS integration cannot be used.

So, please 
provide also access to local repositories.

Additionally, it would be nice if local 
repositories could be created from within eclipse, so a separate cvs client would not be needed.
Comment 1 Kevin McGuire CLA 2002-03-01 17:36:44 EST
Not in 2.0
Comment 2 Michael Valenta CLA 2002-09-08 19:53:20 EDT
It is very unlikely that Eclipse will ever support the local connection method 
since this method requires the client to also contain an implementation of the 
server (the cvs command line client executable is the same exectutable that is 
used on the server). The only way this would be possible is if someone 
implemented a cvs server in Java and made it available as an Eclipse plugin.
Comment 3 Chapman Flack CLA 2003-03-19 13:15:27 EST
I think maybe the implementation-complexity issue is simply that Eclipse
currently expects to manipulate CVS by exchanging commands with a "cvs server"
instance (whether that is running here or remotely) and it would be extra work
to achieve local-repository support by directly invoking individual CVS commands
instead.

But that shouldn't be necessary; I don't know Windows 98, but does its CVS
implementation not even have a "server" command?  If it does, then you support a
local repository just by configuring the "ext command" to do nothing but run
"cvs server" directly and talk to it.  Doesn't require setting it up as an
actual server with an IP port or anything like that.  (I'm assuming Win 98 can
do a basic subprocess and pipes.)

For instance, on a posixlike OS, you can get local access to a repository just
by setting up the Ext Connection Method preference as:

CVS_RSH:  /bin/sh
Parameters: -c 'exec "$@"'
CVS_SERVER: cvs

(In real life it's harder because of bug 35304; I'll attach a script I wrote
that works for the posixlike case.)

Of course it's a little hackish to get "local" access as a special-case
configuration of :ext: and it would be nice to be able to specify a "local"
connection method explicitly.  Implementation oughtn't be hard.

In the meantime, seeing that the :ext: connection mechanism can be used for
different types of connections by different configuration choices partly answers
the question (bug 5184) of why anybody would want the ext method preferences to
be per-connection.
Comment 4 Chapman Flack CLA 2003-03-19 14:18:12 EST
Created attachment 4247 [details]
:ext: wrapper works around bugs 6892, 35142, 35304
Comment 5 Chapman Flack CLA 2003-03-19 14:19:57 EST
Apologize that my attachment is written for Bourne shell and so will not address
the original Windows 98 need - but it should illustrate the technique.
Comment 6 Michael Valenta CLA 2003-10-09 10:39:08 EDT
*** Bug 22835 has been marked as a duplicate of this bug. ***
Comment 7 Michael Valenta CLA 2004-05-27 13:58:34 EDT
*** Bug 64403 has been marked as a duplicate of this bug. ***
Comment 8 scott comer CLA 2004-10-25 17:41:15 EDT
of course, standard windows has no cvs command. but, using
the cygwin utilities, you can get one. and, using the same utils
you can have various shells. knock yourself out.

i too want local repository, and i'm on a unix machine (mac os x).
my quick fix was to turn on ssh and pretend to be a remote
repository. sigh.
Comment 9 Craig Tataryn CLA 2004-11-30 13:24:24 EST
I too wanted to setup Eclipse to use a repository I setup via cygwin.  I 
followed the workaround directions listed in this bug, but could not get 
Eclipse under Windows to access the repository properly.  

What I had to do was use the ":ext: wrapper" script attached to this bug by 
Chapman (thanks btw!).  I then did the following:

1) Install cygwin and make sure to install the cvs module under the Devel node 
during setup
2) Make sure your "PATH" environment variable in Windows points to 
c:\cygwin\bin so Eclipse knows where cvs is.
3) Download the attached script. For some reason the file contained duplicate 
text in the script (i.e. the script, followed by "Content-Type: text/plain" 
and then a duplicate of the script), so delete everything from the line that 
states "Content-Type: text/plain" (including that line) and save the file.
4) Rename the script from cvswrap to cvswrap.sh
5) In Eclipse goto "Window->Preferences->Team->CVS->Ext Connection Method" and 
use the following settings:
CVS_RSH: C:\cygwin\bin\sh.exe
Parameters: C:\cygwin\bin\cvswrap.sh
CVS_SERVER: cvs
*Of course replace C:\cygwin with where ever you have cygwin installed
6) In the CVS Repo Perspective create a new repository and enter the following:
Host: <type a space>
Repository path: <cygwin'ized directory pointing to your cvsroot. 
i.e. /cygdrive/c/cvsroot>
User: <type a space>
Password: <leave it blank>
Connection Type: ext

That should be it, you should now be able to navigate through your repository 
via the CVS Repo Perspective and checkout your projects from you local 
repository.
Comment 10 Michael Valenta CLA 2005-01-03 20:57:23 EST
*** Bug 82112 has been marked as a duplicate of this bug. ***
Comment 11 Michael Valenta CLA 2005-01-28 09:13:35 EST
*** Bug 83911 has been marked as a duplicate of this bug. ***
Comment 12 Oyvind Harboe CLA 2005-01-28 09:19:10 EST
It would also be nice to simply be able to type/paste in a complete CVS
repository string, i.e. "/foo/bar" from:

cvs -d/foo/bar co xxx


This is handy even for pserver when e.g. connecting to a repository on the web.
The entire repository string is frequently available on the web-page.
Comment 13 Oleg Goldshmidt CLA 2005-05-17 09:58:01 EDT
I would say that providing local CVS repository access is absolutely essential.

It is very common on UNIX/Linux/cygwin machines to have local CVS repositories,
even personal ones under /home/<user> etc. Another very common setup is having a
repository on a distributed / networked filesystem that is mounted locally. 

Possible workarounds by running local pserver/sshd are not acceptable, since on
a workstation this means running services that would not run otherwise, with the
related security implications.

From a design point of view I would say that a proper solution would use an
external CVS mechanism where available (which would solve all sorts of problems,
including, e.g., the ability to copy/paste CVS commands provided as a part of
documentation by many projects), and only if none is available or configured use
a built-in facility, which may reasonably be limited.

My platform: 
Eclipse Version: 3.0.0 Build id: 200406251208 
on Red Hat Enterprise Linux WS release 3 (Taroon Update 3)
Comment 14 Oleg Goldshmidt CLA 2005-05-17 10:31:07 EDT
Some comments on the wrapper script (Attachment 4247 [details]):

1) It worked for me once I followed the instructions in Comment 9 (with the
appropriate changes as I am on Linux, not Windows - paths etc), and specified
localhost and my username (not spaces as suggested in Comment 9).

2) It is not a good solution though, since as I switch between repositories I
need to reconfigure the ext method settings. If I don't, and if I try to access
a remote repository while the ext method has the "local" settings, eclipse
freezes and stops reacting to anything.

My platform: 
Eclipse Version: 3.0.0 Build id: 200406251208 
on Red Hat Enterprise Linux WS release 3 (Taroon Update 3)



Comment 15 Michael Valenta CLA 2005-05-31 14:24:52 EDT
There is currently no plan to address this item
Comment 16 Nitin Dahyabhai CLA 2005-08-17 22:30:49 EDT
Created attachment 26218 [details]
wrapper using Windows' built-in cmd.exe

I'm attaching an alternate script that can be used on Windows.	For the
repository location, localhost satisfies the requirement that a host be
specified.

In the Ext Connection Method preferences:
	CVS_RSH = path to the attached runner.cmd
	Parameters = a single space character
	CVS_SERVER = full path to cvs.exe (ex.: c:\cygwin\bin\cvs.exe

The obvious drawback is that the cvs.exe still has to support the "server"
command itself, so the binaries from cvshome.org won't work.  Cygwin provides a
newer version and their binary does support the "server" command.
Comment 17 Missing name CLA 2005-10-16 18:33:05 EDT
Ability to access local repository is very important for solo developers and
also for training purpose. In fact JBuilder was the most "CVS user friendly"
IDE. It took just a few mins to be up and using the features thanks to the local
repository functionality. Since they are moving to Eclipse users of JB are going
to be left out. 

Please reconsider implementing access to local repository.

In any case I tried the work arounds being offered here. I tried both the
scripts with Cygwin on WinXP. But, I get an error each time try to access the
repository:

-----------------------------------------------------------------------------
Unknown response received from cvs server:  

org.eclipse.team.internal.ccvs.core.CVSException: Unknown response received from
cvs server:  
	at
org.eclipse.team.internal.ccvs.core.client.Request.executeRequest(Request.java:219)
	at org.eclipse.team.internal.ccvs.core.client.Command.doExecute(Command.java:404)
	at org.eclipse.team.internal.ccvs.core.client.Update.doExecute(Update.java:187)
	at org.eclipse.team.internal.ccvs.core.client.Command$1.run(Command.java:323)
	at
org.eclipse.team.internal.ccvs.core.resources.RemoteFolder.run(RemoteFolder.java:457)
	at org.eclipse.team.internal.ccvs.core.client.Command.execute(Command.java:335)
	at org.eclipse.team.internal.ccvs.core.client.Command.execute(Command.java:785)
	at
org.eclipse.team.internal.ccvs.core.resources.RemoteFolderMemberFetcher.performUpdate(RemoteFolderMemberFetcher.java:102)
	at
org.eclipse.team.internal.ccvs.ui.operations.FetchMembersOperation$InternalRemoteFolderMemberFetcher.performUpdate(FetchMembersOperation.java:69)
	at
org.eclipse.team.internal.ccvs.core.resources.RemoteFolderMemberFetcher.fetchMembers(RemoteFolderMemberFetcher.java:62)
	at
org.eclipse.team.internal.ccvs.core.resources.RemoteFolderMemberFetcher.fetchMembers(RemoteFolderMemberFetcher.java:53)
	at
org.eclipse.team.internal.ccvs.ui.operations.FetchMembersOperation.execute(FetchMembersOperation.java:107)
	at
org.eclipse.team.internal.ccvs.ui.operations.CVSOperation.run(CVSOperation.java:80)
	at
org.eclipse.team.internal.ccvs.ui.model.CVSTagElement.fetchDeferredChildren(CVSTagElement.java:134)
	at
org.eclipse.ui.progress.DeferredTreeContentManager$1.run(DeferredTreeContentManager.java:192)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:76)
-----------------------------------------------------------------------------
eclipse.buildId=I20050923-1000
java.version=1.5.0_05
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_NZ
Command-line arguments:  -os win32 -ws win32 -arch x86

-----------------------------------------------------------------------------

Has this workaround broken 3.1 onwards ?
Comment 18 Nitin Dahyabhai CLA 2005-10-16 22:59:10 EDT
(In reply to comment #17)
> Has this workaround broken 3.1 onwards ?
The workaround from comment 16 works fine with 3.1 and 3.1.1, but I haven't
tried it on a 3.2 build yet.  Are you sure you set up the Ext Connection
preferences properly including putting a "space" in the Parameters text field?
Comment 19 Missing name CLA 2005-10-17 02:59:32 EDT
I am sure I followed your instructions correctly.

I subsequently searched the internet for alternatives and I found Subversion
(new and improved CVS) and Subeclipse (Plug-in for Subversion).

Both are installed and working wonderfully with Eclipse 3.2M2.

Subversion supports Local and remote repositories and it much much better than
CVS and CVSNT.

I thought I will note this here for anyone else wanting Local-Repositories.
Cheers
Comment 20 Michael Valenta CLA 2005-10-31 08:44:35 EST
*** Bug 114354 has been marked as a duplicate of this bug. ***
Comment 21 Michael Valenta CLA 2006-04-20 10:03:23 EDT
*** Bug 137720 has been marked as a duplicate of this bug. ***
Comment 22 Onno Garms CLA 2006-04-26 17:08:41 EDT
I also believe that local repositories are essential. comment #13 is exactly my opinion (though I'm already running sshd due to similar problems with another application).

In the meantime, how can the problem be worked around under linux? I tried to set SSH_RSH to /bin/sh or a script with contents "/bin/sh -c $*" but neigther works.

(Btw. Bugzilla's authors say that "resolved later" is discouraged. The recomment to leave bugs open and set a target milestone far in future. I share their opinion)
Comment 23 Michael Valenta CLA 2006-06-29 08:14:06 EDT
*** Bug 149100 has been marked as a duplicate of this bug. ***
Comment 24 bjoern.haase CLA 2006-07-11 04:45:15 EDT
With 3.2 things seem to be worse. There seems to be a new spell checker that
makes the workaround of comment #9 unusable :-(. It is no longer possible to enter a space as a user name.
Comment 25 Paul DeLong CLA 2007-01-11 16:35:28 EST
Please note that there are some CVS repositories which are simply not available via remote CVS (anonymous or otherwise).  The OpenSSL repository is one such example.  They require the user to rsync their CVS repository to a local copy.  The user can then do local CVS operations on it.
Comment 26 Steve White CLA 2007-02-25 07:13:02 EST
The original report contained two proposals, one to permit direct access to CVS repositories on the local machine, the other for Eclipse to perform CVS services itself. 

The latter looks to me like a big undertaking, and it seems to me that most of the objections have been to that.  However, the former strikes me as being fairly easy to implement.  I also would like Eclipse to be able to use my computer's CVS service, without having to set up a pserver.

What is the difficulty with executing CVS system commands from within Java using Runtime.exec?  The form of the system commands would be slightly different, depending on whether the system is DOS or a unix shell.  Apart from that issue, what is there to do besides
    <assemble the CVS command>
    cd <project-directory>
    cvs <cvs-command>
(and report results to user, and handle errors)?

I think that would satisfy my present needs.
Comment 27 Michael Valenta CLA 2007-02-26 08:05:59 EST
What you are suggesting would be possible. However, it would be impractical to add the behavior to the existing CVS plug-ins since a lot of the functionality would not be possible to achieve using the cvs executable (e.g. the repository explorer). What you could do is write an alternate plug-in that delegated CVS operations to the executable.
Comment 28 Roland Kaufmann CLA 2007-05-14 10:29:56 EDT
Created attachment 67062 [details]
Bash shell script for wrapping local/remote CVS execution
Comment 29 Roland Kaufmann CLA 2007-05-14 10:30:49 EDT
Created attachment 67063 [details]
DOS batch script for wrapping local/remote CVS execution
Comment 30 Roland Kaufmann CLA 2007-05-14 10:37:51 EDT
I think that this should be resolved by creating a new 'Local' connection method, which instead of a CVS_RSH parameter would take a SHELL parameter which one can use to specify the shell being executed (e.g. '/bin/sh' under *nix, cmd.exe under Windows); otherwise it should take CVS_SERVER as the 'Ext' method but "of course" no username nor password. When this method is selected, the shell is executed instead of the CVS_RSH command.

As a workaround, I have created two shell scripts that mimics the parameters accepted by the ssh/plink command ("-l {user} {host}"), but which executes in a local shell if the username is the one of the interactive user and hostname is "localhost". Set CVS_RSH to the path of this script.

Thus, it can be used to browse both local and remote repositories without having to switch the Ext connection method everytime one desires to see another repository. It seems to work under my Ubuntu workstation, but I haven't tried Windows (yet).

Caveat emptor!
Comment 31 Bjørn-Ove Heimsund CLA 2007-06-27 15:45:26 EDT
A local CVS repository is easy on Unix systems. If an ssh-server is running (accepting only local connections), and the usual cvs-command line command is installed, then just point Eclipse towards localhost, using extssh as the connection method.

Windows however ... :-/
Comment 32 Bobby CLA 2009-06-29 10:37:07 EDT
*** Bug 281719 has been marked as a duplicate of this bug. ***
Comment 33 Eclipse Webmaster CLA 2009-08-30 02:32:03 EDT
As of now 'LATER' and 'REMIND' resolutions are no longer supported.
Please reopen this bug if it is still valid for you.