Re: CVSRoot

Martin Entlicher <[email protected]> Mon, 15 Sep 2003 15:26:13 +0200
Newsgroups gmane.comp.java.netbeans.modules.javacvs.devel
Organization Sun Microsystems
Message-ID <[email protected]>
O.K., here are some comments to the CVSRoot file:

Ojares Rami EINT wrote:
> 
> public class CVSRoot {
> 
>     /*
>         Martin Entlicher has found somewhere in cvshome.org the syntax of cvsroot
>         [:method:][[user][:password]@]hostname[:[port]]/path/to/repository
>         This would allow urls like
>         cvs.acme.comC:\@progs\cvs\repository
>         This is supposed to represent hostname and repository. Obviously this is not easy/possible to parse correctly
>         Also hostname is in practice optional for local urls that many times have only the repository component.
>         So I have broken down this to two different syntax alternatives
>     */

I've found this form of cvsroot at
http://www.cvshome.org/docs/manual/cvs-1.12.1/cvs_2.html#SEC26
However, IMHO it should be
[:method:][[user][:password]@][hostname:[port]]/path/to/repository
cvs.acme.comC:\@progs\cvs\repository is not correct URL, it would be impossible
to parse this. I've tried :pserver:[email protected]/cvs and the
response (I've cvs 1.11) was:
cvs status: missing hostname in CVSROOT:
:pserver:[email protected]/cvs
cvs [status aborted]: Bad CVSROOT.

[snip]
> 
>     /**
>     Is cvsroot case sensitive or not ??? If not then this constructor needs modification.

On UNIX everything all arguments use to be case sensitive. cvs 1.11 on UNIX
does not recognize PSERVER connection method, so I suppose that everything
should be case sensitive. I'm not sure about Windows, but IMHO it should behave
the same way.

>     There can be some problems parsing local cvsroot eg.
>     :local:c:\@progs\cvs
>     This would be parsed currently
>     user = c
>     password = \
>     repository progs\cvs
>     */

Yes. :local: mode must not allow user name and password. It has no sense there.

>         public CVSRoot(String cvsroot) throws IllegalArgumentException {

looks good

[snip]

>     /*
>         All CVSRoots that have the LOCAL_FORMAT are considered the same if they have the same repository.
>         All CVSRoots that have the SERVER_FORMAT are considered the same if
>         - host is the same
>         - repository is the same
>         This means that
>         :pserver:[email protected]:/data/cvs is the same as
>         :ext:[email protected]:/data/cvs
>         Because they both point to the same cvs repository
> 
>         This interpretation implies that the connection method is only a means to get to a repository and equality is only concerned with the actual location of the repository

Well, it depends on what do you need the equal() method for. You can define the
equal() how do you wish, but it must have sense for the usage. E.g. when you
would use the equal() for searching of the cvsroot in .cvspass file, you need
to take into the account the connection method and user name as well.

> 
>         QUESTION:
>         If I use cvsroot :fork:C:\cvs and the Administrative files have Root
>         C:\cvs does this create problems for javacvs?

I hope not. javacvs should take the cvsroot from the -d option, which will
supercede the CVS/Root file.

>     */
>         public boolean equals(Object o) {
> 

we need to define the purpose of this method. It's not possible to say whether
this is a good or bad implementation unless we have defined the porpose.

Thanks,
Martin