The Open Source Swiss Army Knife

/programmingToolBox/
/programmingToolBox/ + sub-categories
http://www.sirfsup.com/
web directory content
    
      

Not logged in
Chat Register Login
return to:  http:/www.sirfsup.com      /programmingToolBox 
Permalink: cvs.htm
Title: pserver auto login
article options : please login   |  print view

cvs -- opensource concurrent versioning system, notes

  1. introduction
  2. links
  3. what is a module and how is it created?
  4. logging to anonymous cvs
  5. logging to non-anonymous cvs
  6. .cvspass
  7. sourceforge anonymous cvs woes
  8. commands: checkout (co), checkin (ci), update ... detailed reference
  9. tagging
  10. tags useful for branching and merging
  11. CVSserver setup (anonymous and password), logging in, monitoring

introduction

My motivation to learn cvs was that I had up to a certain point just copied directories and renamed them with a date and time to recover lost work after fubarring some project inadvertently. Well, cvs was a way to (when I got to writing a package I thought was big enough) distribute it, too. Because another advantage is versioning. I'm tending right now to confuse cvs with auto{make | conf }.

The FreeBSD alternative is CVSup.

links

  1. follow the link on google. http://www.tldp.org/HOWTO/CVS-RCS-HOWTO-3.html.
  2. http://hibiki.miyagi-ct.ac.jp/~suzuki/comp/cvs.html and it's local copy, and in english version
  3. www.cvshome.org/docs: actual documentation which is excellent and clear. clear enough?

what is a module and how is it created?

this cvs -d:pserver:joesp@gborg.postgresql.org:/usr/local/cvsroot/mysql2psql checkout -c should list my modules on the server, but it returns empty. Why wasn't this module created? can I create it myself? Well, yes, you use the import command. That worked.

non-anonymous cvs

non-anonymous cvs means logging in as a developer with upload rights. See http://www.durak.org/cvswebsites/doc/cvs_31.php#SEC31

This cannot use :pserver: as that is only for anonymous access. Instead, copying this from the cvs sheet of numerous sourceforge websites, the command would be "cvs -z3 -d:ext:developername@cvs.sourceforge.net:/ cvsroot/pyxml co modulename". There is ext not pserver.

  1. export CVS_RSH=ssh
  2. cvs -d:ext:username@cvs.sf.net:/cvsroot/myproject import -m "Initial import." modulename vendor start (for the use of ext see above.

anonymous cvs

"To run a CVS command on a remote repository via the password-authenticating server, one specifies the pserver protocol"
source = http://www.durak.org/cvswebsites/doc/cvs_31.php#SEC31

"In order for a developer to obtain write access to their repository, they will need to have a CVS client and a SSH client. While authentication via pserver is supported natively by all CVS clients, most also provide the means to call an external program to use in authenticating to the CVS repository; this is often referred to as "ext authentication".
By using ext authentication in your CVS client, and directing it to use SSH, all of your communications to the project CVS servers are automatically encrypted; protecting your SourceForge.net user password, and the continuity of the data you transmit to the repository using CVS. Use of SSH in authentication is the only supported way for a developer to obtain write access to their repository."
source=https://sourceforge.net/docman/display_doc.php?docid=768&group_id=1#top

  1. httpd.apache.org:
    • % cvs -d :pserver:anoncvs@cvs.apache.org:/home/cvspublic login
    •     CVS password: anonymous
    • % cvs -d :pserver:anoncvs@cvs.apache.org:/home/cvspublic co httpd-apreq
    • % cvs -d :pserver:anoncvs@cvs.apache.org:/home/cvspublic co httpd-apreq-2
  2. from postgresql.org:
    • $ cvs -d :pserver:anoncvs@anoncvs.postgresql.org:/projects/cvsroot login
      just type enter for password. It will then be stored in ~/.cvs***
    • cvs -z3 -d :pserver:anoncvs@anoncvs.postgresql.org:/projects/cvsroot co -P pgsql
      retrieves complete source tree
  3. sourceforge
    • cvs -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/cgiutils2

.cvspass

This file by default resides in the home directory. It is generated from using the 'login' command to the cvs. It needs only be run once, after which it is stored in this file.

On Fri, Aug 31, 2001 at 08:25:51PM -0700, Donald MacDougall wrote:
>
> > I'm new to using cvs, but I just tried to get the horde source tree
> > from the horde repository following the instructions in the horde
> > web site, but when I tried to login I got an error message telling me
> >
> > "cvs login: failed to open /root/.cvspass for reading: No such file or
> > directory"
> > "cvs [login aborted]: fatal error: exiting"
>
> Try checking out the sources from a non-root account.
>
Thanks. That didn't work at first either, but it put me on the right track.
I had not read anything about this .cvspass file and didn't know I was
supposed to have one. So when I got the same error message as a normal
user, but looking for the file in the normal user home directory, I just
touched the file in that directory and tried again and then it worked fine.
Seems like maybe something isn't quite right there, somehow, but it works
now so thanks for pointing me right.

sourceforge anonymous cvs woes

??????????????????????????????

[joe@www tmp]$ cvs -d :pserver:joesp@cvs.sf.net:/cvsroot/cgiutils2 login
Logging in to :pserver:joesp@cvs.sf.net:2401/cvsroot/cgiutils2
CVS password:
[joe@www tmp]$ cvs -d :pserver:joesp@cvs.sf.net:/cvsroot/cgiutils2 checkout cgiutils2
cvs [checkout aborted]: end of file from server (consult above messages if any)
[joe@www tmp]$

??????????????????????????????

wait, see if it shows up on the backup CVS repository, as per the "browse cvs repository" link to web, and resulting error

commands

the addition -z3 offers compression on the updating. Good supposedly when doing over dial-up.

checkout

the -r flag lets you check out a certain revision of a module. For example, cvs checkout -r REL6_4 tc. using the -D option checks out a module at a given date. See update for this.

from the postgresql-7.x docs, here's how to keep separate sources for RELEASE and CURRENT:

  • cd RELEASE
  • cvs checkout -P -r REL6_4 pgsql
  • cd ../CURRENT
  • cvs checkout -P pgsql

add

I already know to use this to add a file to the repository after you have creaeted it in the editor.

However, to add a binary file, do cvs add -kb filename

find . ! -name CVS -type d -exec cvs add {} \;
cvs ci
find . ! -path '*/CVS/*' ! -type d -exec cvs add {} \;

remove

the CVS faq acknowledges that one can't remove a whole directory. CVS also will not give any errors but will obviously not complete the task. The faq says that to delete the directory, do the following:

  1. cvs remove individual_files
  2. cvs remove dirName
  3. cvs commit
  4. cd $CVSROOT
  5. rm -rf dirName

the OpenSource Development with CVS book says instead to do update -P after removing all the files from within the directory.

update

this merges differences between the repository and the working copy, unlike checkout which does no merging

to just update the changes as opposed to all the source files, the command should be "update -d -P" (source: postgresql-7.3.4 docs)

cvs update -p -r 1.13 hello.c > hello.c sends files to stdout (to see what the version is), this retrieves revision 1.13. Using -p solely first to check output, then check -r to update using that revision. File redirection redirects from stdout; see first with -p then do a separate commit.

the fast way to do an update is to use the -j flag which does a join with different revisions. cvs update -j 1.13 -j 1.14 hello.c. A patched hello.c results.

cvs update -P deletes empty directories. I have also seen cvs -q update -dP. The -d should mean ...

cvs update -D "2001-4-19 23:59:59 GMT" updates according to date (allowing retrieving of a complete version by date if I don't know the tag or revision number). the GMT says "not universal time" this time.To update you will need to pass the update -A -A flag to update.

commit

the recursive flag doesn't work on commit. I made changes outside the source tree and then copied them over the originals with midnight commander; in order to commit I had to issue a 'cvs add file_name' and then a 'cvs commit file_name' for each file (there were about 25 of them, thank God). There must be an easier way!

try modifying the bash lines found in add here.

commit -m 'this is a message'

status

shows if there are revision problems between two developer editing the same file; use this command before doing your commit.

tagging

cvs tag four when in the checked-out directory (that where you unloaded the files from $CVSROOT into). It then tags it as a 'four' tag. According to the link above (http://hibiki.miyagi-ct.ac.jp/~suzuki/comp/cvs.html) to check out that tag's revision, simply do cvs checkout -r tag_name (Repository inside position).

cvs tag -b REL6_4
creates release 6.4 from source tree. I have another example lacking the -b flag.

tags useful for branching and merging

cvs -q checkout -d myproj_old_release -r Release-2001_01_05 myproj
creates directory myproj_old_release and puts that release into it
cd myproj_old_release
cvs -q tag -b Release-2001_01_05-bugfixes
tags the old as new bugfix tag
(#39) poster : anonymous (owner)date: 2005-12-03

i hava lot of doubts about cvs update -d and cvs -q up -dp and then cvs ci filename pls give idea to me


Leave a Reply
Your Name:     anonymous
Your Email:
Website:  
Comments:

The author will be notified of your reply.
return to top