[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: different CVS_SERVER for different hosts

From: Mark D. Baushke
Subject: Re: different CVS_SERVER for different hosts
Date: Tue, 28 Oct 2003 23:28:18 -0800

Hash: SHA1

Mihai Bazon <address@hidden> writes:

> Hi all,
> I think it's frustrating, impractical and frankly I always forget to set
> the CVS_SERVER by hand before running cvs for each particular host, not
> to mention I use to call cvs from emacs which makes things even worse.

You must live in a very chaotic world to have so many choices for
CVS_SERVER. In the past, I have just created a wrapper script for
the odd-ball machine and used a 'cvs2' command that did something like:

        : # sh wrapper script
        export CVS_SERVER
        exec cvs ${1+"$@"}

and then all I needed to do was remember to use 'cvs2' instead of 'cvs'
for the commands to do the right thing... Granted, using pcl-cvs mode
inside of emacs would have been harder in this case. However, something
similar could have been done

        (defun use-cvs2 ()
         "Switch to cvs2 settings."
         (setenv "CVS_SERVER" "/path/to/cvs.exe"))
        (defun use-cvs ()
         "Switch to default cvs settings."
         (setenv "CVS_SERVER" nil))

Then, I could use M-x use-cvs2 RET to switch to the other CVS_SERVER
and M-x use-cvs RET to return to the default setting.

I had been known to do something similar for the CVS_RSH environment
variable before CVS_RSH worked everywhere for me.

> So because I started looking after an implementation and found none I
> thought it's time to code one myself.  So I was writing to ask if
> anyone's interested in the patch.  Right now I just hacked on
> "src/rsh-client.c" from the latest stable version (1.12.2) and the patch
> simply looks up a file named ".cvsserver" in the cwd and parents until
> one of the following is met:
>      1. .cvsserver found ;-) in which case it'll take the content of
>         it's first line and use it as if it was in $CVS_SERVER
>      2. we're exiting from a directory which doesn't contain an
>         accessible CVS subdir.
>      3. we reached root dir.
> Of course, all of the above applies only if CVS_SERVER is not defined.

I am not sure that is the best design path to follow.

> Please let me know if anyone's interested in a patch and if so I'll
> create one against the development code.  Otherwise I'll just use it
> myself :-p

Feel free to post it, someone may google for your patch in the future
and thank you later.

        -- Mark
Version: GnuPG v1.2.3 (FreeBSD)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]