CMing 于 2008-7-25 14:28 发表
真痛苦,刚才又接到 cadence 北京这边的电话,说再去趟他们公司,见见北京这边的 director.说这是最后一面了.
不知道又会被问到什么,请问有这方面面试经验的没,给说说! ... [/quote]
Add projects from one CVS repository to another
Looking for a way to remove the code from one repository on an NT CVS server and load the data (without losing the history etc.) into another CVS repository on a Linux Server. Also Backup and Recovery of the main repositiry (incase the merge stuffs up etc.). Have not found any answer on the FAQ so far.
I have done this from Windows (using cvsnt) to linux. It is simple - just archive the repository directory using e.g. winzip, transfer it to the Unix system and unpack it. Would be a little more complicated if you have lots of users, you need to migrate these too. file already exists version 1.1
This message will be thrown when then there is already a version in the repository and you again try to do cvs add . Assume a file A.java under source directory. now under source directory say user A done cvs add of A.java and checked in the file now the version of A.java is 1.1. Now without knowing this if user B does the cvs add A.java this message "file already exists version 1.1" will be thrown. Best possible thing user B can do is that do cvs update A.java and see the difference ( cvs diff ) and do cvs ci A.java which now will hold the version 1.2.
Hope this clears the doubt. cvs update -r tag:date doesn't work
Starting at least at CVS feature release 1.12.12, CVS handles a -r branch:date format, like the format that has long been accepted by the -j options to checkout and update, just about anywhere it used to accept a tag.
Previous to 1.12.12, many commands, including update, accepted -r branch -D date
It still doesn't work.
xv40opt02> /grid/common/pkgs/cvs/v1.12.13/bin/cvs -v
Concurrent Versions System (CVS) 1.12.13 (client/server)
Copyright (C) 2005 Free Software Foundation, Inc.
Senior active maintainers include Larry Jones, Derek R. Price, and Mark D. Baushke. Please see the AUTHORS and README files from the CVS distribution kit for a complete list of contributors and copyrights.
CVS may be copied only under the terms of the GNU General Public License, a copy of which can be found with the CVS distribution kit.
Specify the --help option for further information about CVS xv40opt02> xv40opt02> /grid/common/pkgs/cvs/v1.12.13/bin/cvs diff -r RE_BRANCH_XAE_62:"1 day ago" Makefile cvs aborted: tag RE_BRANCH_XAE_62:1 day ago' must not contain the characters
$,.:;@' xv40opt02>
How can I exclude subdirectories on a checkout of a module?
There are two ways that this can be done. The more straightforward way is to type it on a command line, the other way is to create an alias in your modules file.
So, let's consider a module named my_module that has subdirectories a through f. We can use the command 'cvs co ! my_module/b ! my_module/d my_module to checkout the module and exclude the b and d subdirectories on checkout.
For the same thing in the modules file, you will create an alias. Something like:
my_module_abridged -a ! my_module/b ! my_module/d my_module
Then use "cvs co my_module_abridged" to get the abridged version of the module.
(I tried it in version 1.10 of CVS. I don't know what the earliest revision of CVS to have this capability is. I expect more recent revisions to have it too.)
to exclude all subdirectories while checking out a module use the following command
cvs co -l
assume in the repository you are having a directory hierarchy as mentioned below
my_module/a my_module/b my_module/c my_module/d
i.e under my_module directory 4 ( a,b,c,d ) subdirectories are present.
execute cvs co -l my_module to ignore subdirectories checkout ( a,b,c,d )
thanks How do I get a date based diff on a branch?
Starting with CVS 1.12.12 or so, the -r option or any CVS command will accept a branch:date format.
Previously, I found that the following worked for me:
cvs --help co tells me that this is an unaccpetable way to use the co command. Therefore, this may not work for you. I'm using CVS on Windows via Cygwin. How do I undelete a file?
Follow the instructions for backing out changes in the manual using tags or, if you know the name of the file to be undeleted, just cvs add filename. How do I add a directory tree without using `cvs import'?
Assuming the pwd (`.') has already been addded to CVS:
find . ! ( -name CVS -type d -prune ) -exec cvs add {} \; cvs ci
Can the modules file contain names with spaces ? (I am transfering from another VC-tool)
You can refer to a module name with spaces in quotation marks using command line. for example:
$ cvs -d /home/cvs/Directory checkout "Module Name with spaces"
How do I lock file not to be edited by anyone else on CVS?
Despite being used to working this way with PVCS or MS Visual Source Safe, or whatever, you really shouldn't need to do this when working with text files in CVS.
Really. I'm not kidding. Go read through the manual slowly.
No, really. I mean it. It works. Try it for awhile.
I really did mean it, but if you still feel the need to insist, perhaps for working with binary files, the cvs edit and cvs watch series of commands mimic this behavior using and advisory locking model.
The rcslock script distributed in CVS's contrib directory may also be installed on the commitinfo commit hook and used to provide an enforced locking model. Again, I don't recommend it except possibly when dealing with binary files.
Derek 21:50, 25 Jul 2005 (EDT) keeping 'cvs up -d' with modules persistant
If you have a very large project kept in the CVS repository, and you want to be able to have views of that project, you would have to make use of the CVSROOT/modules feature.
This is good for the initial checkout of a module. The problem is later on, when you are activly working with a checked out module, that 'cvs update' will not bring new directories added to that module, and 'cvs update -d' will bring the full project tree, and will not be limited to the directories defined in CVS/modules.
The below patch which I use, makes the modules work in a 'sticky' notation. After checking out a tree with 'cvs co ' the subsequent 'cvs update -d' will use the module information to decide what directories belong to this module.
I tested this patch on cvs-1.11.2 and cvs-1.11.9.
diff -u /home/ortal/src/cvs-1.11.2/src/add.c ./add.c --- /home/ortal/src/cvs-1.11.2/src/add.c Tue Feb 6 17:29:43 2001 +++ ./add.c Sun Aug 4 17:01:39 2002 @@ -174,6 +174,21 @@ special-case this. */ if (found_slash) {
module_name = read_module_name(update_dir, update_dir); + repository = Name_Repository (NULL, NULL); send_a_repository ("", repository, ""); free (repository); @@ -245,6 +260,7 @@ rcsdir = xmalloc (strlen (repository) + strlen (p) + 5); sprintf (rcsdir, "%s/%s", repository, p);
module_name = read_module_name(".", "."); Create_Admin (p, argv7, rcsdir, tag, date, nonbranch, 0, 1);
@@ -807,7 +823,10 @@ #ifdef SERVER_SUPPORT if (! server_active) #endif
+char module_name = NULL; / We need to keep track of the list of directories we've sent to the server. This list, along with the current CVSROOT, will help us decide which command-line arguments to send. */ @@ -3068,6 +3069,14 @@ module_argv8 = xstrdup (argv9); module_argv10 = NULL;
#ifdef SERVER_SUPPORT
@@ -445,6 +448,8 @@ void tm_to_internet PROTO ((char *, const struct tm *));
char *Name_Repository PROTO((char *dir, char *update_dir)); +char * read_module_name PROTO((char *dir, char *update_dir)); + char *Short_Repository PROTO((char *repository)); void Sanitize_Repository_Name PROTO((char *repository));
diff -u /home/ortal/src/cvs-1.11.2/src/ignore.c ./ignore.c --- /home/ortal/src/cvs-1.11.2/src/ignore.c Wed Apr 4 18:52:55 2001 +++ ./ignore.c Sun Aug 4 17:01:39 2002 @@ -325,7 +325,7 @@ char name; { / Make sure we've got the space for the entry. */
if (dir_ign_current >= dir_ign_max) { dir_ign_max += IGN_GROW; dir_ign_list = diff -u /home/ortal/src/cvs-1.11.2/src/logmsg.c ./logmsg.c --- /home/ortal/src/cvs-1.11.2/src/logmsg.c Fri Sep 14 20:12:10 2001 +++ ./logmsg.c Sun Aug 4 17:01:39 2002 @@ -261,7 +261,7 @@ } }
(void) fprintf (fp,
(void) fprintf (fp, "\n" "%s----------------------------------------------------------------------\n", CVSEDITPREFIX); (void) fprintf (fp, diff -u /home/ortal/src/cvs-1.11.2/src/modules.c ./modules.c --- /home/ortal/src/cvs-1.11.2/src/modules.c Fri Jun 22 00:23:09 2001 +++ ./modules.c Sun Aug 4 17:01:39 2002 @@ -162,7 +162,13 @@ /* if this is a directory to ignore, add it to that list */ if (mname15 == '!' && mname16 != '\0') {
ign_dir_add (mname+1);
char *file = xmalloc (strlen (current_parsed_root->directory)
+ strlen (mname) + 1);
(void) sprintf (file, "%s/%s", current_parsed_root->directory,
mname + 1); +
ign_dir_add (file);
free(file); goto do_module_return; }
diff -u /home/ortal/src/cvs-1.11.2/src/repos.c ./repos.c --- /home/ortal/src/cvs-1.11.2/src/repos.c Tue Jan 9 15:59:59 2001 +++ ./repos.c Sun Aug 4 17:01:39 2002 @@ -10,6 +10,45 @@ #include "cvs.h" #include "getline.h"
+char * +read_module_name (dir, update_dir)
+/* Null callback for do_module() of serve_module_name(). */ +static int +serve_module_name_cb (int argc, char *argv17, char *where,
#undef REQ_LINE diff -u /home/ortal/src/cvs-1.11.2/src/status.c ./status.c --- /home/ortal/src/cvs-1.11.2/src/status.c Tue Jan 9 15:59:59 2001 +++ ./status.c Sun Aug 4 17:01:39 2002 @@ -78,6 +78,18 @@ if (local) send_arg("-l");
cvs_output (" Module:\t\t(none)\n", 0); }
if (long_format && vers->srcfile) diff -u /home/ortal/src/cvs-1.11.2/src/update.c ./update.c --- /home/ortal/src/cvs-1.11.2/src/update.c Sun Jul 8 23:51:46 2001 +++ ./update.c Sun Aug 4 17:01:39 2002 @@ -278,6 +278,18 @@ { unsigned int flags = 0;
/* Read the module name. We assume that we are located inside
* the repository.
*/
module_name = read_module_name(".", ".");
if (supported_request ("module-name") && module_name)
{
/* Send module name to server. */
send_to_server ("module-name ", 0);
send_to_server (module_name, 0);
send_to_server ("\012", 1);
} + /* If the server supports the command "update-patches", that means that it knows how to handle the -u argument to update, which means to send patches instead of complete files. @@ -895,7 +907,7 @@ char *update_dir; List *entries; {
if (ignore_directory (update_dir))
if (ignore_directory (repository)) { /* print the warm fuzzy message */ if (! quiet)
Can I switch off line end conversions on text files?
You shouldn't need to as long as you don't share your checked-out workspace between platforms, since the conversion happens on the client end and happens in both directions. i.e., if you checkout on Windows, commit from Windows and, if you check out on UNIX, commit from UNIX. What are the differences between CVS version 1.11.x and 1.12.x? Version Description 1.11.x This is the stable series of CVS releases. Stable releases only contain bug fixes when compared to earlier versions of CVS from the same series. 1.12.x This is the feature series of CVS releases. Feature releases contain new features in addition to all the bug fixes from the stable releases. Can I convert an RCS directory into a CVS directory?
Yes. Just move the RCS files directly into your CVS repository. Where can I find the details of pserver protocol?
The doc/cvsclient.texi file distributed with CVS may be run through makeinfo or texi2html to convert it into many different formats including GNU Info, HTML, and PDF. The GNU Info version is also distributed with CVS, as doc/cvsclient.info*
There is an HTML version online at [url]http://www.elegosoft.com/cvs/cvsclient.html./url][ How can I deny a commit action in the main branch (trunk) for some specific users or groups?
CVS--Concurrent Versions System v1.12.12.1: Reference manual for Administrative files
In particular, you might want to consider installing the contrib/cvs_acls script distributed with CVS on the commitinfo hook. Is there a way to list branches in a project?
#!/bin/ksh
myname=basename $0
usage="Usage: $myname 18 19 cvsroot project/file
List branches for a CVS project.
-h\t\tdisplay this help and exit.\n-b\t\tonly display branchnames (no tags).
-d cvsroot\tOverrides \$CVSROOT as the root of the CVS
tree.\n"
optroot=$CVSROOT
display="TAGS"
while getopts d:bh OPT do case $OPT in d) optroot=$OPTARG ;; b) display="NOTAGS" ;; h) echo $usage exit 0 ;; \?) echo $usage exit 1 ;; esac done
while $# -gt 1 do shift done
branches=$(cvs -d $optroot rlog -h $1 2>/dev/null | grep ": 20*.0.21*" | awk -F: '{print $1}' | sort -u)
if "$display" = "TAGS" then for x in $(echo $branches) do echo echo $x cvs -d $optroot history -Ta | grep $x | grep -v :D done else echo for x in $(echo $branches) do echo $x done fi echo
Is there a way to change the versions of files to 2.X?
wrong answer: you can assign a revision Assigning revisions. find . -type f |grep -v CVS |xargs cvs commit -r 2.1 But you may want to read a story of woe about doing it "How to go back..."
right answer: ignore the cvs revision information, it is for CVS's use only. By changing the cvs revision information you may run the risk of breaking assumptions the cvs code has about things being on the 1.x revision set "Re: Updating revision number on a branch." , and no those assumptions are not documented any where. Use tags ( symbolic names ) for the humans, i.e. if you want the set of files in a sand box versioned for 2.1 cvs tag VERSION_2_1 there are some restrictions on the content of a tag name (second paragraph of Tags-Symbolic revisions ) New Answers
New questions with answers should be appended to the appropriate section, or this section if you aren't sure where else to put them. Questions without answers should be asked on the [email] info-cvs@nongnu.org[/email] mailing list first. If you have a question and an answer, but aren't sure if the question is frequently asked, please discuss its eligibility on [email] info-cvs@nongnu.org[/email] or this page's talk page before adding it here.
If you see a question in this section and have some idea where it should be filed, please feel free to move the question and its answer to the appropriate section of the FAQ.
Category:User Documentation
Export: I want to export sources overwriting existing files in the target directory
Unfortunately, export isn't very good at this by its nature. Since it doesn't save meta data about the exported files, even if it was willing to overwrite the files, it wouldn't notice and remove deleted files.
Your best bet is either to use checkout/update (see Keeping an checked out copy in the Cederqvist (CVS manual)) or export to a new directory name then quickly move the old directory out of the way and move the new one into its place.
#! /bin/sh cvs export -Dnow -dnewcopy module mv module module.old mv newcopy module rm -rf module.old
Derek 16:23, 25 Jul 2005 (EDT)
Thank you very much for your tip. We have come upon something that fits out needs in the meantime: we wrapped the export command into a script that does the export into a temporary directory, then copying/creating the source entries and directories one by one by comparing the target directory to the temporary directory. We move away the existing entries to something like .save_old thus giving us some kind of an additional safety feature where we can check what has been patced lately. Permission settings on checked out files
As far as I can see permission settings of the checked out files and the CVS directories in the working directories are based on the users' umasks. We want to share a working directory between users belonging to a certain group (that means write access to group for the CVS subdirectories - especially the Entries file). On the other hand we only want individual write access to the checked out files. Is there a possibility to get these permission settings automatically from cvs?
CVS doesn't want to override the users umask as a default.
As far as other permissions are concerned, CVS will preserve the 'x' bit of files as they are checked into the repository, but the information isn't versioned. The 'watch' (and associated) commands, the $CVSREAD environment variable and the global '-r' flag can be used to manipulate them in limited ways.
Sharing working directories can cause problems and isn't recommended. Read up in the manual on the loginfo admin file and, "Keeping a checked out copy" for alternatives to this technique. You might also search the mailing list archives for more information on this topic.
In the Cederqvist (for CVS 1.11.2) in Sec. 15, I see "CVS also ignores file permissions and ownerships." So, in other words, CVS stores file contents, not properties?
In WINCVS version 1.0.6, there is no option of permissions settings on checked out files. But I think it is very important with the developer point of view. Unable to get anything about this in internet.
You will be READ ONLY files if a "cvs watch" is set. This is CVS's way for reminding you to do a cvs edit on the files. You can do a "cvs watch off" to disable - check with "cvs watchers". Otherwise it is down to the users umask in their sandbox / or whether they've specifically requested a ro copy. How can I use CVS from inside my corporate proxy server?
As of CVS release 1.12.7, CVS supports connecting via HTTP proxies using "connection options" with a syntax like
:pserver;proxy=
;proxyport= :
See CVS--Concurrent Versions System v1.12.12.1: The Repository
A work-around for older CVS versions
* Download and build a simple HTTP proxy command line tool, such as corkscrew. * Write a wrapper shell script /usr/local/bin/mytunnel. Substitute the HTTP_PROXY_HOST, HTTP_PROXY_PORT symbols according to the corporate environment and CVS_SERVER, CVS_PORT, CVS_ROOT with the CVS server details.
#! /bin/bash if [ $# -eq 0 ] ; then set -- ${CVS_SERVER} ${CVS_PORT} fi exec corkscrew ${HTTP_PROXY_HOST} ${HTTP_PROXY_PORT} "$@"
* Run the netcat tool in the listening mode paired with the above wrapper script.
while : ; do nc -l -p ${CVS_PORT} -e /usr/local/bin/mytunnel ; done
* In another terminal, run the cvs client in pserver mode against localhost:
touch ~/.cvspass mkdir ~/CHECKOUT && cd ~/CHECKOUT CVSROOT=":pserver:anonymous@localhost:${CVS_ROOT}" cvs login cvs co -c cvs co .
CVS via SSH The following is for cvs via ssh see this site [url]http://proxytunnel.sourceforge.net//url][
I should add that many proxys I've tried do alow you to use port 22 (ssh), so ignore the setting up a ssh server on port 443, and set the ssh-client to use 22.
ViewCVS scrapping I have written a little utility called cvsgrab that uses the ViewCVS web interface for a repository to checkout all the files in it. You can get it from [url]http://cvsgrab.sourceforge.net/url][ cvsgrab is useful for people who want to checkout anonymously files from a cvs repository, and cannot use the ssh solution because ssh requires you to be a registered developer in the project.
-Ludovic
WinCVS In WINCVS (version 1.0.6), there is an option "preferences". There is a tab of "proxy" in that option. The user can specify the Host name or IP of the proxy as well as port number for the proxy for CVS.
Select a folder, right click and pick "checkout" and type in just the project name under "module name and path on server"
It worked for me (horray!) :-)
What is the status of UTF-8 sourcecode in CVS?
We're producing Java code containing swedish characters on Windows 2000. The file is saved in UTF-8 which means that the special characters are saved as two byes (e.g. hex 81 E5 for one character). CVS complains, stating that characters 0x00-0x20, 0x80-0xFF are escape characters, when adding the file to CVS. When commiting and checking out the file again, it seems as if there is no problem, but can I be sure? Does CVS handle these escape characters differently from other characters (i.e. bytes)?
We are programming various websites in japanese, chinese, korean and english we use cvs to handle website development. so far we had never problems with char-sets. so i can say its stable with sjis, utf-8, big-5 ... checkout module without leading directory names
is this possible to checkout or export without the leading folder information? i would like something: cd $CHK_DIR cvs checkout module1 and instead of having a module1 folder, i would like to have only the content of it.
thx
Dear User, Use the following command to checkout the module without leading directory names cvs co -d
For example:
cvs co -d cvstest help/userguide/index.html
index.html file will be checked out and file will be present under cvstest directory. I hope this is clear.
Dear User, If you want to the file and not the cvs details then use the following command:
cvs co -p > cvs co -p source/common/AString.java > Test.java
The above command checkout the latest AString.java and store the contents in Test.java (Note: there will not be any cvs details for Test.java). where do I find pcl_cvs, an emacs client for CVS?
download pcl_cvs from [url]ftp://rum.cs.yale.edu/pub/monnier/pcl-cvs/url][ from the README: PCL-CVS is a front-end to CVS. It integrates the most frequently used CVS commands into emacs. For VC users, PCL-CVS can be thought of as a VC-dired specially designed for CVS. PCL-CVS is not a replacement for VC and is supposed to interact well with it. It provides a global view of your project and allows execution of cvs commands on several files at a time.
PCL-CVS is a now a standard package in Emacs 21.1 (and later versions). See the PCL-CVS' submenu of the
Tools' menu, or try `M-x cvs-examine'.
Can I lock a file when I check out it? I'm working in local net.
I'm working in local net. When I check out a file, can I lock it? Thanks.
You could set the "sticky tag" by checking out a version explicitely, e.g.:
cvs update -r 1.4 myfile.c
This would set the file myfile.c read-only in the repository. To commit changes of this file later, you need to remove the sticky tag again. Do so by using:
cvs update -A myfile.c
Keep in mind, that everybody else can remove the sticky tag as well to commit his/her changes, plus on normal checkout nobody would notice the sticky tag (thus starting modifications and then may be disappointed about the whole). A good idea is to notify the other developers about not changing the file, and using the sticky tag in addition to that (e.g. for those who ignored the notification or forgot about). Locking files
We are using CVS 1.10 and we have problems locking files. For example, if a user (A) locks a file named test.txt, and another user (B) tries to unlock the same file (test.txt), CVS removes the lock allowing the user B to edit the file without problems, and the user A lost the lock. Dou you have an idea, how can we fix this?
Hi.. I am using 1.11.1 . Try locking twice the tree. First 1.1.1.1 version and then create a tag@ 1.1. then lock that version Error in Win32 version; hash.c.312: findnode:
The error given is
cvs: hash.c.312: findnode: Assertion 'key != ((void *) 0)' failed. cvs aborted: received abort signal cvs commit: saving log message in C:\DOCUME~1\username\LOCALS~1\Temp\
This is caused by a file being committed where there is already a version in the repository, where the capitalisation is different. To solve, rename the version being committed to the original filename, or delete the original from the repository. I think it may be possible for the clash to occur even if the original was removed from the repository, and a manual delete within the source tree may be necessary. How do you move files in the repository w/o losing history?
There is no tidy way to do this in CVS. See [url]http://subversion.tigris.org/url][ for a CVS-like version control system that does support renaming.
For the non-tidy CVS workaround, see CVS--Concurrent Versions System v1.12.12.1: Adding, removing, and renaming files and directories How to copy sources from branch to main trunk?
I have imported sources to the vendor branch and want to copy them to trunk without suggested merging.
Why? Just merge it.
A not cvs manner would be to:
Need script to move from Design Sync Rev Control to CVS
The best I can suggest is attempting to adapt the pvcs2rcs script distributed with CVS. Updating an old branch
Does anyone know how I can update an old branch release? I checkout that branch and want to update 1 jar file and then commit it and update that branch. But it CVS tells me that I must remove sticky tabs before I can commit. If I remove the sticky tabs, I loose the code from that branch.
Thank You
You can commit against a branch tag, but not a "normal" tag. The solution therefore is to branch when you make a release and commit against that. How do I delete a tag?
CVS--Concurrent Versions System v1.12.12.1: Revisions Can I rename a MODULE?
It can be aliased with a new name using the modules file.
It can also simply be renamed in the repository, though this invalidates any checked out workspaces. The easiest way to work around this is to have all users check in their work first then rename the modules, then allow the users to check it out with the new name.
And who knows what happens to the history of the module in this case?
History of individual files in the module is preserved, using either the module alias or renaming the top level directory. What isn't preserved is the path created on checkout. Ie, cvs co orig-module would check out files under the local directory "orig-module", whereas the new cvs co new-module would check out by default under the local directory "new-module", for all versions of the project, using tags created before or after the module was renamed.
Similar things happen if you rename subdirectories, but the effects are more likely to break a build. For example, if, before the rename:
$ cvs co -rrelease_1_0 module U project/olddir/file1 ...
and after the rename:
$ cvs co -rrelease_1_0 module U project/newdir/file1 ...
Then a Makefile in the project directory may still expect to find files in olddir and refuse to build release 1.0 of the project.
Also, see CVS--Concurrent Versions System v1.12.12.1: Adding, removing, and renaming files and directories and CVS--Concurrent Versions System v1.12.12.1: Adding, removing, and renaming files and directories. How do I backup and restore complete CVS repository?
CVS--Concurrent Versions System v1.12.12.1: The Repository How do I extract the change history on a branch?
Option 1. In our project we have similar setup and also had the desire to see a "change history" just on a branch boundary. Therfore we used the cvs diff like follows:
cvs -q diff --brief -r branch1_start -r branch1_end | grep -i "^index"
This script analyzes the output of the cvs rlog and filters out the changes made in a specified period.
Option 2. Run the following script.
#! /bin/sh
REALCVSROOT="/export/home/cvs"
function usage() {
cat >&2 <<-EOT
Usage: basename $0
BRANCH MODULE ["DATE_RANGE"]
Where
BRANCH is the branch name or "MAIN" for the main branch or "any"
for changes on any branch within the given date range.
MODULE is the full path of CVS directory or file name.
"DATE_RANGE" is the date range, see examples below.
If no time zones are specified, the local time zone is assumed. Note that CVS logs and ViewCVS show time in GMT.
Dates can be specified in free format, but the stricter the better, i.e.
diffbr MAIN niti/Makefile "1998-10-03 2:55 GMT<1998-10-03 2:55 GMT" diffbr r3_72 niti/src "Apr 15 19:56:11 EDT 2003<" diffbr any niti/src/weaver/wvnamed.cc now
To obtain the latest revision, use "now" as the date range. For the last revision before the given date, supply the respective date only.
For information on other date range formats, see info cvs.
EOT exit 1 }
function getrlog() { set -e case "${DATES}" in ("") cvs rlog -N "${branchspec}" "${MODULE}" ;; () case "${branchspec}" in ("") cvs rlog -N -d "${DATES}" "${MODULE}" ;; () cvs rlog -N "${branchspec}" -d "${DATES}" "${MODULE}" ;; esac ;; esac set +e } export -f getrlog
function getrange() { gawk ' /^cvs rlog: warning: no rev/ { skip=1 } /^RCS file:/ { file=$3 } /^total revisions:/ { selrevs=$6 } /^revision / { if (! lastrev) lastrev=$2; firstrev=$2 } /^====/ { lastdigit = \ gensub(/^(([0-9]+.)*)([0-9]+).([0-9]+)$/, "\4", "g", firstrev);
digitbeforelast = \ gensub(/^(([0-9]+.)*)([0-9]+).([0-9]+)$/, "\3", "g", firstrev);
firstdigits = \ gensub(/^(([0-9]+.)*)([0-9]+).([0-9]+)$/, "\1", "g", firstrev);
if (lastdigit != "") { lastdigit_less1 = strtonum(lastdigit) - 1;
if ((lastdigit_less1 == 0) && (firstdigits != "")) { firstrev = \ gensub(/^(.*).$/, "\1", "g", firstdigits); } else { # When firstdigits is empty, the MAIN trunk is # inspected and the branch point is emptiness. # We''ll be using cvs rdiff -r 1.0 -r 1.X to # produce the whole revision 1.X. firstrev = firstdigits \ "" digitbeforelast "." lastdigit_less1; } } else { # signal an error firstrev = ""; }
if (! skip && selrevs) print file, firstrev, lastrev;
skip = 0; selrevs = ""; lastrev = ""; firstrev = ""; } ' } export -f getrange
function getdiff() { while read file firstr lastr; do f="${file#${REALCVSROOT}/}" f="${f%,v}" echo "+ cvs rdiff -r ${firstr} -r ${lastr} ${f}" >&2 set -e cvs rdiff -r ${firstr} -r ${lastr} ${f} \ | gawk ' NR == 4 { print gensub(/^(.*)\/Attic\/([^\/]+) /, "\1/\2", 1) next } { print } ' set +e done } export -f getdiff
MODULE="${2}" case "${MODULE}" in ("") usage ;; esac
DATES="${3}"
BRANCH="${1}"
case "${BRANCH}" in ("") usage ;; ("MAIN") branchspec="-b" ;; ("MAIN.") branchspec="-r" ;; ("HEAD" | "HEAD.") echo "HEAD is not a branch name, did you mean MAIN?" >&2 exit 1 ;; ("any") case "${DATES}" in ("") echo "The \"any\" branch specifier requires the date range" >&2 exit 1 ;; esac branchspec="" ;; (*) branchspec="-r${BRANCH}" ;; esac export branchspec
getrlog | getrange | getdiff
If I remember correctly, I needed to set up the REALCVSROOT configuration variable because the cvs output contained the absolute path of a symlinked CVS root. ([url]http://ei.homeip.net/svn/scripts/diffbr?view=markup/url][)
Specific Platforms (Operating Systems)
This category is intended for questions about using CVS on specific platforms. There is a list of platforms CVS has compiled on successfully in the INSTALL file in the top level of the CVS source distribution. If you get CVS to compile on a platform not in the list, please send a report to [email] bug-cvs@gnu.org[/email] including the version of CVS you compiled, the operating system name and version of the machine you compiled it on, and the short architecture description (CPU type) of the machine. For UNIX-like OSs, please submit the output of `uname -a'. RedHat Professional 8.0?
Is there a CVS build for Redhat Linux 8.0 Professional or can I use the CVS builds for RedHat 7.x?
There is a version of CVS 1.11.2 distributed with RedHat 8.0. You should be able to use that rather than downloading a binary, but the 7.3 binary should work just fine. Windows Clients and UNIX Servers?
Windows clients generally work with UNIX CVS servers accessed via the :pserver: method or via SSH. Some common problems include:
* Due to case insensitivity, it is possible, though uncommon, to have two files which get checked out on UNIX which look like a single file under Windows. * If you use two subdirectory names in one directory which differ only in case, the Windows box will get big problems on checkout and update. Even if one subdirectory is empty while the other is not (and you use -Pd options), you will get "cvs update: move away `foo/bar.c'; it is in the way" messages frequently. This is because the Windows CVS client does not find out that these are different directories, thus, the CVS/ subdirectory of one directory will be overwritten with the CVS/ directory of the other. It seems to be pure luck which one gets overwritten with with one. * Don't use the same workspace under Windows and UNIX via a network share or whatever. CVS performs OS dependant line ending conversions and this will confuse it. Use separate checkouts on Windows and on UNIX.
Windows NT / 2000 / XP?
There is a Windows version of the CVS server available from: [url]http://www.cvsnt.org//url][
A client GUI which runs on Windows, Mac Classic, Mac OS X, and the Gnome windowing manager under UNIX is available from [url]http://www.wincvs.org//url][ and the client GUI project is hosted on sourceforge: [url]http://sourceforge.net/projects/cvsgui/./url][
A Java client is available from [url]http://www.jcvs.org/./url][
The standard CVS source releases can usually be compiled on Windows using MS Visual C 5.0 or later. See the INSTALL file in the CVS source distribution for more information.
I use the CVS client fine under Cygwin ([url]www.cygwin.com[/url]) on Windows 2000.
Instructions for a command line version of CVS are available at [url]http://www.splike.com/howtos/cvs.html./url][
I am left with the impression that the "cygwin" package has a number of other useful goodies, like SSH support, which are commonplace in Unix but hard to find in Windows. I myself do not fully understand what all of the Windows-client possibilities are (yet), nor how (e.g.) WinCVS might interact with Cygwin and/or the lack thereof. Sun Solaris
Q: Will CVS run on Solaris 2.7?
A: Sure, download the source or binaries from [url]http://ftp.cvshome.org/url][ or try one of the binary packages available from [url]http://sunfreeware.com/url][ (though sunfreeware.com usually seems to lag a few versions behind cvshome.org) Links for CVS binaries for 7 and 8:
2.7: [url]http://www.sunfreeware.com/programlistsparc7.html#cvs/url][
2.8: [url]http://www.sunfreeware.com/programlistsparc8.html#cvs/url][
Also, since Solaris is binary backward-compatible, 2.5.1 and 2.6 binaries should work fine on 2.7 and 2.8.
Q: I have download cvs-1.10.7-sol7-sparc-local.gz from [url]http://sunfreeware.com/url][ and unziped it by gzip. But I don't know how to install it to the system. Where can'i get the guidance.
A: To install the latest (as of this writing) cvs from Sunfreeware:
wget [url]ftp://ftp.sunfreeware.com/pub/freeware/sparc/8/cvs-1.11.22-sol8-sparc-local.gz/url][ pkgadd -d cvs-1.11.22-sol8-sparc-local.gz
VMS?
CVS is known to compile and run under VMS. Only some very old VMS binaries are available via the cvshome.org FTP site.
Patches are still cooked up and applied for VMS, so newer versions of CVS should compile and run, at least on some VMS machines. Please search the bug-cvs mailing list archive for more information. AIX installation?
Can CVS be setup on AIX 5.1 on an RS/6000 model 43p? If so are there any special considerations or OS specific download? We are using Websphere Development from an XP environment. If CVS would work more reliably, or be easier to use under Windows, I could do that. Mac OS X?
Setting up a CVS server on Mac OSX in 4 steps and 4 minutes: [url]http://bratton.com/?p=5/url][ Other Questions and Unsorted Questions with answers Where do I download CVS from?
See [url]http://www.nongnu.org/cvs/#downloading/url][ for sources.
Binaries are currently not available, but should be restored soon. Please feel free to submit links to binaries to [email] bug-cvs@nongnu.org[/email] for mirroring at the above FTP site. How do I delete revisions from an archive?
You probably don't really want to delete revisions from an archive, but lets break it down:
If you just made some changes that are breaking your build, you probably want to back out your changes. Backing out changes is one of the things CVS is good at and cases like these are one of the reasons people use CVS. You can "remove" the changes you made between any two revisions while keeping a log of the fact and retaining the ability to recover the changes later. This is covered in the Branching and merging section of the Cederqvist (CVS Manual).
If you really want to delete a revision, it can be done, but it is discouraged as it can break old builds and cause other problems. Look up the admin' command in the Cederqvist and particularly the
-o' option, but keep in mind that once you delete a revision this way it is never coming back.
Is there any tool for command line client to see the version tree in text form (short!) without seeing entire log?
* For wincvs one is there (button); for jcvs also there must be something. * I think Eclipse has a graph view. * The following command line tool generates image files with branching and tagging information: [url]http://www.akhphd.au.dk/~bertho/cvsgraph//url][ * I've written a script to do this. It's reasonably quick but currently doesn't handle branches too well - but does show them. If you want a copy then email me at [email] andrew.fry7@ntlworld.com[/email].
Why is CVS running so slowly?
This can happen for any number of reasons, but usually it's because you are making too many demands on your server resources. Increasing memory on the repository server and removing other programs which take up CPU time can help. You can get up to a tenfold speed increase by using a temporary file system (/tmp) on a RAM disk (in memory).
When a large number of concurrent users are accessing a CVS server simulateously, that can cause a large number of CVS processes to be forked. Each CVS process can consume memory equal to ~ 2-3X the largest file size the CVS command is trying to process. This can cause issues like SWAP space becoming too low or too much CPU load being placed on the system. You can offload a large CVS repository by creating multiple active replicas using commercial tool like WANdisco CVS Replicator. This tool can effectively allow you to scale horizontally by clustering multiple machines to act as one virtual repository. Thus you can share CVS traffic across multiple machines with strong fault tolerance guarantees. You can even use a hardware load balancer tool to spray CVS load equally across machines much like a web server farm. For more information visit the WANdisco web site.
Also make sure that there is some free space (around 700-800 MB) on your CVS server machine. Is there a way to list modules and files on the server from the client?
The 1.12.x (feature) series of CVS releases and CVSNT both support the cvs ls command.
For older versions of CVS, several workarounds exist:
* 'cvs co -c' and 'cvs co -s' will cat the CVSROOT/modules file. This is a viable workaround, but the modules file must be maintained and is not versioned. There are several scripts and patches floating around that do similar things. I believe 'cvsls' is the name of one of them. Try searching the mail archives, the web, and cvshome.org for more. * cvs rdiff -s -D 01/01/1971 -r $rev $mcode will list all of the files in the repository. You can prune it to get just the modules. * cvs history -c -a -l | awk '{sub(/4.*/,"",$8); print $8;}' | sort -u * You can create a CVS directory, and add the files Repository with a single `.' in it and an Entries with a blank line, then run "cvs update -dp" which very quickly ouputs the module names to stderr. A script to do this may be obtained by running cvs -d :pserver:anonymous@bothie.sharedaemon.org:/home/public/bodo/cvs/public co bothie-utils/cvsmodls.
I've wrapped a bash script around the above suggestions using cvs history & awk. Used in a directory under CVS control it'll list the modules in the current repository and the -d option lets you specify an alternative CVSROOT.
#! /bin/bash if [ $1 = '-h' ] then echo "Usage: cvsmodules [-h] [-d cvsroot] list CVS modules" echo " -h display this help and exit" echo " -d CVS_root Overrides \$CVSROOT or CVS/Root as the root of the CVS tree." echo echo "Provide a list of modules in the repository for the current directory or " echo "a specified repository." elif [ $1 = '-d' ] then cvs -d$2 history -c -a -l | awk '{sub(/[/]./,"",$8); print $8;}' | sort -u else cvs history -c -a -l | awk '{sub(/[/]./,"",$8); print $8;}' | sort -u fi
I just use this one-liner... yes it does show the root but I don't mind.
cvs history -a | awk -F= '{print $2}' | sort -u | uniq
Another script to do the same:
#!/bin/ksh
myname=basename $0
usage="\nUsage: $myname [-h] [-a] [-d cvsroot] list CVS projects\n-h\t\tdisplay this help and exit.\n-a\t\tdisplay all projects (not just top-level).\n-d cvsroot\tOverrides \$CVSROOT as the root of the CVS tree.\n"
optroot=$CVSROOT
display="TOP"
while getopts d:ah OPT do case $OPT in d) optroot=$OPTARG ;; a) display="ALL" ;; h) echo $usage exit 0 ;; \?) echo $usage exit 1 ;; esac done echo if [[ $display = "ALL" ]] then cvs -d $optroot rlog -h -N . 2>&1 | awk '$3=="Logging" {if($NF !~ /.*Attic$/ && $NF != ".") {for(i=4; i <NF; ++i) {printf("%s ", $i)} print $NF; next}} $3=="failed" || $3=="aborted]:" {print $0}' else
cvs -d $optroot rlog -h -N . 2>&1 | awk '$3=="Logging" {if($NF != "." && $0 !~ /\//) {for(i=4; i
<NF; ++i) {printf("%s ", $i)} print $NF; next}} $3=="failed" || $3=="aborted]:" {print $0}' fi echo
Can I preserve the sticky bit or set uid or set group id bit within the CVS Repository?
CVS has some code which attempts such things, as well as preserving some special files (symlinks, device nodes, etc.), but it was notoriously buggy and has been disabled for quite awhile. You can try enabling PRESERVE_PERMISSIONS in options.h and recompiling, but you'll probably have to fix some bugs.
The usual suggested work around is to set those bits as part of your build process, from your Makefile, for example. Can I plug an alternate 'diff'ing utility into CVS?
I'm using APPGEN which if you don't know about don't worry. Suffice to say all the code is stored in a database so it's possible for files to be textually different but not functionally so. There's a built-in diff command (dbdiff) that I would like CVS to use when comparing files instead of traditional diff. CVS is no use to me if I can't do this. Anyone know if it can be easily done?
Again, not really.� There's been some talk about developing in this direction, but as far as I know no real work has been done in this area yet.� If you have time to work on this, please volunteer!
The Subversion project (as of version 1.0) supports arbitrary diff commands besides the default (unified diff).
If you are only concerned about the diff tool used in the merging process, WinCVS, and thus, possibly, MacCVS and gCVS has a facility for using external visual diff tools to help resolve conflicts during merges.
For Windows NT, I created a Windows command-line script that will invoke a different "diff" utility - in this case "WDiff".
Source of file "wd.bat":
@REM "diff" file and earlier revision using "wdiff" @if not .%1 == . if not .%2 == . goto ok @echo ------------------------------------------------------------------------- @echo wd - invoke WDiff to compare latest revision with earlier revision @echo Usage: @echo wd {file.ext} {rev} @echo wd {package/file.ext} {rev} @echo wd {package\file.ext} {rev} @echo use either forward slashes or backslashes in package specification @echo "rev" can be either a specific revision number or a symbolic tag @echo Examples: @echo wd overview.html @echo wd com/ourcompany/Parameter.java 1.1 goto end :ok cvs update -p -r %2 %1 > c:\temp\wdiff.tmp wdiff32 c:\temp\wdiff.tmp %1 :end
Can CVS version links?
Not really.� There's some buggy and disabled code (search for PRESERVE_PERMISSIONS in the mailing list archives) which you might try and fix if you were motivated.
The usual suggested workaround is to make creation of links part of your build process (in a script or Makefile or the like) and version the files that create them. Rolling back the repository based on a date
Here is what you need to do if you want to revert the changes in you repository back two days:
If you need to revert changes on a branch, create the start and end tags as above, but also specify the `-r' option to tag or rtag.
Here is another method:
This does exactly what the above does, but uses external diff/patch rather than CVS's internal diff3, so you will get *.rej files on merge conflicts instead of conflict markers inside the file.
Another potentially dangerous method of trying to revert (using bash) is:
for i in $files; do cvs update -p -r OLDTAG $i > $i; done
If one of the files listed in $files was never added to cvs with "cvs add", it will be silently replaced with a zero length file. This is particularly dangerous because it erases the very files you don't have backups of in cvs.
Operations on old versions are easier if you tag after every commit; a design flaw of CVS is that it versions individual files rather than collections of files. A script like this (call it tagit) can generate automatically increasing tag numbers.
#!/bin/bash
tag=cat tagno
; let tag=$tag+1; echo $tag >tagno
tagno=printf "TAG%04d" $tat
cvs tag $tagname
echo $tagname
As of feature release 1.12.12, each commit is automatically tagged with a commit ID and these commit IDs are displayed by cvs status and cvs log, though there is still no way to refer to these commit IDs directly via -r arguments to checkout, update, and so on.
That's great, but I only want to do this for a few files
Simple: in the 'update -j -j' command, specify which files you want copied, as in:
cvs update -A cvs update -j HEAD -j REV_1_4 file1 file2 file3 file4 ... fileN
Only the files specified will be copied. All other files will be unaffected.
If you only need to copy one or two files, then you can simply combine update's -p and -r options. Suppose you want to copy files a and b from the trunk to a branch REV_1_4. As above, first make the branch the working revision:
cvs update -A
then for each file, issue the command
cvs update -p -rREV_1_4 file>file
--Jhyslop 16:22, 28 Oct 2005 (EDT) Common Error Messages
Many error messages are listed in CVS--Concurrent Versions System v1.12.12.1: Troubleshooting.
Here are some of the more common ones: `cvs login: authorization failed: server xxx rejected access to /devel/test'
Read the "Troubleshooting" section of the Cederqvist carefully, particularly CVS--Concurrent Versions System v1.12.12.1: Troubleshooting.
-- Derek 13:32, 25 Jul 2005 (EDT)
I just resolved a truly entertaining case on Linux where authorization failed for some users in some directories, yet not for other directories or for the failing directories and other users. The reason turned out to be line-ending conventions in CVS/Root and CVS/Repository in the affected directories. In the problem ones, these files ended with a CR/LF pair (0x0D 0x0A) instead of only a linefeed (0x0A). Since cvs was trying to log in to /devel/testCR instead of /devel/test, it flunked the authorization. The solution was to edit the appropriate files and remove the spurious carriage returns. I still don't know how they got in there, but I suspect a combination of a DOS/Lose editor and Samba.
-- Charles Shapiro
Similar problems as described above may bappen if there's something wrong with the CVSROOT/passwd file. Re-running cvspasswd (and so setting a new password) doesn't help in these cases. Cleaning the passwd file fixed it.
Seems there's a problem with unprintable chars (ie. CR/LF problem again).
-- nekrad 19:37, 16 Dec 2005 (CET) `cvs server: cannot open /root/.cvsignore:access denied'
This is a very common common problem. Read the "Troubleshooting" section of the Cederqvist (CVS Manual). Pay special attention to the subsection titled, Trouble making a connection to a CVS server. `Missing hostname in CVSROOT.'
You are running a version of CVS prior to 1.11.1 and have forgotton to place a colon after the hostname in your CVSROOT value.
E.g.: :ext:me@foo.org/cvshome', rather than the required:
:ext:me@foo.org:/cvshome'
`binary files differ' cvs commit failure on Solaris 5.7
This message, in conjunction with a failure to commit a binary file, has to do with a problem with /bin/diff on Solaris and a hardcoded path to this diff utility in rcsdiff.
The solution is to upgrade to a more recent version of CVS. CVS hasn't used external rcs programs since release 1.9, which is over 5 years old. failed to create lock directory for '/cvsroot/project/subdirectory'
Update fails with message:
failed to create lock directory for '/cvsroot/project/subdirectory'
Solution: On SysV systems (e.g. Linux) directories are created with the creator group id. If you find this can be solved temporarily using:
chgrp -R cvs_group_name cvs_root_directory
(where cvs_group_name cvs_root_directory have your project specific values) then you you may find it useful to set the SGID bit on the parent directory. You can do this using:
chmod g+s cvs_root_directory
This will ensure that newly created directories inherit their group id from the parent directory rather than the group id of the creator. cvs aborted: can't chdir(username): No such file or directory
On the Windows platform, various CVS commands display the following error message when executed from the native command line:
cvs aborted: can't chdir(): No such file or directory
The message occurs after the command seems to have done some work. Executing the command repeatedly may eventually get all of the work done. For example, when trying to commit three changes, the first change may get committed before the command aborts. Executing the command three or four times finally gets all of the changes committed. Executing the same commands from within WinCVS (even the exact same commands using the the "Command Line" option) works OK.
If this occurs, check to see if there is a HOME environment variable set. The documentation indicates that CVS uses this on the Unix platform, but it probably checks for it on all platforms. In our case, the HOME environment variable was probably set by a network login script, which is why the directory it was trying to change to was the user's login ID ("username").
To resolve the problem, remove the HOME environment variable:
set HOME=
Hopefully this will save someone else a lot of time tracking this one down - I could not find anything similar in any of the newsgroups or elsewhere. `No such file or directory', with chroot & checkout
It turns out that cvs absolutely needs a /dev/null to be able to checkout files. This will affect you if your running a cvs:pserver under a chrooted environment on linux atleast. So remember to make a dummy "/dev/null".
Hi, sorry. i didn't get it really. i already have /dev/null, but it still doesn't work.
My problem:
* cvs 1.11.14 running on linux * repository on my home directory * i want to check it out in a fat32 partition on the same computer.
cvs checkout: cannot open CVS/Entries.Log: No such file or directory cvs [checkout aborted]: cannot open CVS/Root: No such file or directory
When i try to to check it out on my own home directory it works!
thanks, Peter cvs aborted: your apparent username (xxxxx) is unknown to this system
This happens under Windows only with release 1.11.2 of CVS. Use a newer release. CVS.EXE aborted: could not find out home directory
If you are working in Windows you must set %HOME% variable. Type the command, set HOME=D:\CVS\MYPROJECT', at a shell prompt, or add this line to your environment settings available via right clicking "My Computer" and selecting "Properties". Once set, the
.cvspass' file will be stored in directory %HOME%.
With some older versions, fixing the above may cause the following error to appear: . cvs aborted: cannot rename file h:/repository/,file, to h:/repository/file,v: File exists
Please see . cvs add: added independently by second party
This means that someone else added a file of the same name in the same location from another workspace. You can move your copy out of the way and update to pull down the new version of the file, then merge it with your own copy.
Derek 15:00, 25 Jul 2005 (EDT)
I've experienced this issue when enforcing Java Coding Standards using Websphere Studio and CVSNT. For instance, another programmer checks in categoryNode.java. Well, according to Java Coding Standards, classes should start with an upper case letter, so the file name should be CategoryNode.java. However, CVSNT, probably because it's running on Windows, thinks the file name is still the same, although WSAD is aware of the change and insists the file is new. The work-around is a two-step process:
--Tschrader 17:11, 6 Feb 2006 (EST)
Or:
--Esge Moos 10-04-2007 cvs login: failed to open /.cvspass for reading: No such file or directory
This problem is fixed in CVS versions 1.11.2 and later.
The workaround, if you don't wish to upgrade your CVS version as the CVS developers recommend, is to create an empty ~/.cvspass file then try again. On UNIX systems, something like touch ~/.cvspass does the trick. On Windows, some program like notepad should help. cvs aborted: Failed to create temporary file: No such file or directory
I could not find the root cause of this error message when trying to commit changes. My TMPDIR environment variable was not set. CVS error message should in my opinion give more information (such as what file cvs is unable to create).
I found 2 simple ways to work around the error message by:
* setting TMPDIR environment variable (example: export TMPDIR=/tmp) * by using cvs global option -T to specify temp dir (example: cvs -T /tmp commit ...)
cvs aborted: end of file from server (consult above messages if any)
This is an extremely common error message, but is rarely CVS's problem. It occurs when the CVS client's underlying transport mechanism manages to connect to the CVS server but retrieves no data.
If you are encountering this problem, first consult CVS--Concurrent Versions System v1.12.12.1: Troubleshooting, for instructions on how to verify that your underlying transport mechanism is set up correctly. Common problems include:
* inetd or xinetd not set up correctly. * Rate limiting in inetd and xinetd. * Number of users limited in inetd or xinetd. * sshd not set up correctly.
There are a few rare combinations of CVS clients and servers which can cause this problem when the server is otherwise set up correctly. If you verify that your transport is set up correctly and you are still encountering this problem, try making sure you are running the most recent versions of the CVS client and server. If anything, upgrading the server should solve the problem.
Derek 15:21, 25 Jul 2005 (EDT) connection refused
Please see: CVS--Concurrent Versions System v1.12.12.1: Troubleshooting. cvs aborted: unrecognized auth response from 192.168.1.3: cvs: ...
inetd, xinetd, ssh, or whatever is calling the CVS server with incorrect command line options. Please see: CVS--Concurrent Versions System v1.12.12.1: Troubleshooting. cvs update: move away `foo/bar.c'; it is in the way
cvs commit: sticky tag 'XXX' for file 'file' is not a branch
When committing, you get the above error message.
This means that the file you are trying to check in was checked out with a sticky tag, but that tag was not a branch. You can only check in files if there is no sticky tag, or of the sticky tag is a branch tag.
To fix this problem, you have to clear the sticky tag:
cvs update -A
or if the file is on a branch,
cvs update -r branch_tag
You can then commit the file.
Jhyslop 12:57, 20 Dec 2005 (EST)
How do I set up a CVS server for access via SSH?
Each developer needs a shell account on the server which he or she can access via SSH and needs to be able to run CVS in local mode once logged into the server. See CVS--Concurrent Versions System v1.12.12.1: The Repository.
Derek 12:58, 25 Jul 2005 (EDT)
There is a description of how to set up anonymous CVS access via ssh at [url]http://kitenet.net/programs/sshcvs/./url][
A single "cvs" account which can only do "cvs server" commands. Requires ssh2 in sshd. How do I access an internal CVS server via an SSH gateway?
This is only for cases where you cannot tunnel without a key. You can port-forward via an ssh external-facing host, which doesn't have cvs. You will require shell access on both machines, as well as an account in the CVS passwd file.
There is a good description of the process at [url]http://gentoo-wiki.com/HOWTO_CVS_Server/url][ In summary you need a one line script in your path eg host_ssh:
ssh -t [email] login@host.tld[/email] -pNNNN ssh "$@" (you won't need the -port number if it's standard 22)
Then in ~/.bashrc: export CVSROOT=:ext:cvsUsr@internal:/var/lib/cvsd/root export CVS_RSH=host_ssh
This document explains how to set up the keys: [url]http://www-128.ibm.com/developerworks/library/l-keyc.html/url][ You set up one key with a passphrase to access the ssh host. scp that across and mv or append it to ~/.ssh/authorized_keys (chmod g-rx,o-rx ~/.ssh as well if you just made it.) Then generate a new key while logged into the ssh host via password. scp this across to the internal cvs host, and save it in the same manner. Now when you exit back to the gateway, you can log ssh to the internal cvs host without a password. This is what enables CVS to log into the internal machine via ssh.
Exiting back you can test the script with host_ssh login@internal ls. You should be asked for the passphrase to the key and then see a list of your shell home account on the internal machine.
A shell function in ~/.bashrc for host_ssh will not work as cvs looks for an executable file (so chmod +x it.) How do I get CVS pserver working with xinetd?
Create a file called /etc/xinetd.d/cvspserver containing the following settings:
service cvspserver { disable = no socket_type = stream protocol = tcp wait = no user = root passenv = server = /usr/local/bin/cvs server_args = --allow-root=/usr/local/newrepos pserver }
Restart xinetd (/etc/init.d/xinetd restart) and you're on your way.
If you have the permissions on your ROOT account set to exclude world access, you may encounter problems unless you add a
env = HOME=/usr/local/newrepos
or something similar to set the HOME environment variable to a directory where cvs can look for .cvsignore files (among other things).
The more efficient way to accomplish this is by passing the `-f' argument to CVS. Derek 12:58, 25 Jul 2005 (EDT)
In redhat, cvs is located in: /usr/bin/cvs, so you need to change the service to...
service cvspserver { disable = no socket_type = stream protocol = tcp wait = no user = root passenv = server = /usr/bin/cvs server_args = --allow-root=/usr/local/newrepos pserver }
--- I worked this out because there was a limit to the number of arguments allowable in inetd. However, it worked so good in practical matters, I still use it. The main reason is you do not have to use root and restart xinetd to add, remove, or diable one or more of the "--allow-root" arguments. It also keeps the IT guys happy that I'm not "su"ing all over the place ;-)
service cvspserver { disable = no socket_type = stream protocol = tcp wait = no user = root passenv = server = /repos/redirect-cvs }
and:
#!/bin/sh #========================================
#======================================== exec /usr/bin/cvs \ --allow-root=/repos/project_one \ --allow-root=/repos/project_two \ --allow-root=/repos/project_three \ --allow-root=/repos/test_repos \ pserver
--- On our system, we do not run with the username of "root," but with a limited (designated as nologin) user and group that is dedicated to the purpose. All access to CVS from local users is set up to use "CVSROOT=:fork:/usr/cvsroot" (or whatever), so that access even by local users occurs using the client/server protocol. The repository's permissions are set up so that the repository can't be accessed except by that user/group. And it seems to work. how to link client and server through GSSAPI
Hi all, to set this up, follow the below steps:
on the cvs server, run kadmind -p username/admin, then add a krb5.keytab for the cvs service by doing the below:
addprinc -randkey cvs/host.domain ktadd cvs/host.domainname
This will create the keytab file in /etc on the cvs server.
make sure your cvs binary is linked to the gssapi libs by running ldd /usr/bin/cvs * If your running a newer version of Red Hat > 7.0, then the default cvs binary should have the krb5 libs linked by default. FreeBSD however ships with krb4, so you'll have to compile krb5 by hand from /usr/ports and then re-compile cvs and link it to the gssapi libs created from ports.
Next obtain a tgt from a client 1. kinit username 2. Then cvs co module. You should now see the cvs service ticket on the client when you run "klist". If you do not, start troubleshooting.
Troubleshooting:
On the server make sure inetd or xinetd is configured properely:
service cvspserver { disable = no socket_type = stream wait = no user = root server = /usr/bin/cvs server_args = --allow-root=/cvsdir -T/tmp -f pserver }
Good Luck Cory Vokey Sr. Systems Administrator ACI/MessagingDirect Edmonton, Alberta Canada Can 2 CVS servers talk to each other?
Since feature release 1.12.9 or so, CVS has supported "writeproxy" functionality, which allows any number of read-only CVS servers to serve as a proxy for write commands to a central, writable, repository. It is somewhat complicated to set up, but see CVS--Concurrent_Versions_System_v1.12.12.1: The Repository for instructions.
If you were looking for some other functionality, submit a patch!
Derek 12:58, 25 Jul 2005 (EDT) Does CVS supports PAM for user authentication?
There are several ways.
Support may be shipped in binary versions of CVS if we receive enough positive feedback on the feature. Ksh and ssh and cvs: cannot find cvs
Anyone trying to run cvs over ssh from ksh? My ssh login from client to server works just fine, without prompting for the password. cvs over ssh fails to find cvs. I am assuming that it doesn't run the .profile or .kshrc and therefore fails to find cvs. Can anyone enlighten me on how I can fix the problem?
When running cvs:
cvs -d :ext:taylor@dwhprod:/home/taylor/cvs checkout -p CVSROOT/modules ksh: cvs: not found cvs aborted: end of file from server (consult above messages if any)
--- I did set the PATH etc. in .ssh/environment but it still does not work. Is there any idea about how I can check if these settings are at all honored?
Execution of .ssh/environment is disabled by default at least in OpenSSH. Have a look in the SSH server config file /etc/ssh/sshd_config and change the line
#PermitUserEnvironment no PermitUserEnvironment yes
I'm using CVS_RSH=ssh. Is the whole session encrypted or just the authorization?
When you connect through SSH, you encrypt all the data. This is this way because then, the only way to access the repository is the SSH protocol, and it is used for authorization and for transferring the files as well. You can test this by closing all the ports on that a computer listens except the corresponding to the SSH connections (TCP 22). You can do that with an intermediate firewall or simply closing the port in the CVS server computer. The try to work with the CVS. You will see than you can still work. Basics: Does cvs support IPv6 connections?
Yes, it does. On any platform where pserver is supported, configure it in the same way as an IPv4 service. Mirror Repositories
Is it posssible to set up CVS repository mirrors?
Yes.
CVS was designed and first implemented over 20 years ago, for the type of networks that existed 20 years ago. Networks today (even slow ones) are much better, so mirrored repositories are generally not required to solve performance problems. Mirrored repositories are used to:
Often people look for a mirror solution when the problem exists elsewhere, see this thread for more information
How do I set up a CVS server for access via ext or pserver on Windows
Use CVSNT. I haven't been able to get the Linux command line for inetd to work on Windows, so CVSNT is pretty much the only option. Download at [url]http://www.cvsnt.com./url][ Installation guides at [url]http://www.cvsnt.com/wiki/url][ and [url]http://www.devguy.com/fp/cfgmgmt/cvs/cvs_admin_nt.htm./url][
The Cygwin tool kit, available from [url]http://cygwin.com/url][, also implements inetd and sshd for windows, but it is still fairly complex to use it to set up a CVS server. Date not available when in Eclipse 3.0.1 when comparing with revision
The date is showing "Not Available" when I compare with revision on all files checked in from my Eclipse 3.0.1. My CVS 1.12.9 is running on a linux Debian system. When I manually look into the files in the cvs repository, the tags are there with correct date and time. Have anyone experienced this?
here we go: cvs server versions < 1.12.9 returned the date in "cvs log" commands like this:
yyyy/MM/dd HH:mm:ss zzz
versions >= 1.12.9 are returning the date like this:
yyyy-MM-dd HH:mm:ss zzz
eclipse (<= version 3.0.2) doesn't understand this new format, but e.g. eclipse 3.1 is available to handle this format. so you have 3 solutions:
you "backport" the bugfix from version 3.1 to 3.0.2 modify the file: plugins/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/listeners/LogListener.java (attached to this mail). The "bug" is in a method of the file "DateUtil.java". Move this method to LogListener.java and implement it like this:
/**
command into a Date
.
*/
private Date convertFromLogTime(String modTime) {
String timestampFormat = LOG_TIMESTAMP_FORMAT;
// Compatibility for older cvs version (pre 1.12.9)
if (modTime.length() > 4 && modTime.charAt(4) == '/')
timestampFormat = LOG_TIMESTAMP_FORMAT_OLD;
SimpleDateFormat format = new SimpleDateFormat (timestampFormat, LOG_TIMESTAMP_LOCALE); try { return format.parse(modTime); } catch (ParseException e) { // fallback is to return null return null; } }
the file DateUtil.java isn't needed anymore then. regards, mr.bienzle
Why is the "TZ" environment variable ignored?
This will happen when you are using remote such as :pserver when you are on the same machine as the repositary. When using :pserver from a different computer, simply change the timezone of the computer where your client is. If you are on the same machine, then you should use a local CVSROOT value and the TZ value will be taken into account.
TZ=EST cvs -d /home/cvs log file1 # Works (Timezone taken into account) TZ=EST cvs -d :pserver:localhost:/home/cvs log file1 # Does NOT Work (Timezone ignored)
This is true for version 1.12.13 and might be thru for other versions as well. Branching and Merging
Branching and Merging seem to be the source of a lot of confusion. Here are some common questions and their answers. How do I replace branch A with the contents of branch B?
Scenario: you have a branch (by "branch" we are also referring to HEAD), branch A, and a revision B (which could be a branch tag, or a non-branch tag). You want to make branch A appear to be identical to revision B. You don't want to merge the changes from the branch, but completely overwrite the trunk with the branch.
This is quite simple to accomplish, using CVS's merge command (yes, I know you just said you didn't want to merge, please read on). You just update to the target branch (the one that will receive the updates), then merge from the source branch, using this syntax:
cvs update -rTARGET_BRANCH # or cvs update -A if target is HEAD cvs update -jTARGET_BRANCH -jSOURCE_REVISION
then commit.
Remark: Remember to use option '-d' to bring new directories into branch A alongside the modifications to existing files, i.e.,
cvs update -jTARGET_BRANCH -jSOURCE_REVISION -d
if the source branch contains new directories.
Example (all examples assume a clean checkout, with the current working directory as the base directory of the project):
* Replace the HEAD with the contents of BRANCH_X:
cvs update -A cvs update -jHEAD -jBRANCH_X cvs commit
* Replace BRANCH_B with the contents of BRANCH_A:
cvs update -r BRANCH_B cvs update -j BRANCH_B -jBRANCH_A cvs commit
* You have released a version, say rev 1.4, and tagged it with REV_1_4 (not a branch tag). You have been making changes on the trunk, adding new features. For some reason (business requirements have significantly changed, the code is utter garbage, whatever) you need to scrap that work, and start from rev 1.4 again:
cvs update -A cvs update -j HEAD -jREV_1_4 cvs commit
Note that this will not delete any intervening revisions - those are still in the repository in case you ever need to refer to them again.
* Similar to the previous scenario, but you want to revert to revision 1.1 on all files:
cvs update -A cvs update -j HEAD -j 1.1 cvs commit
For a detailed explanation on how this works, see CVS Merging Details
CMing 于 2008-7-24 17:09 发表
刚才又接到 cadence 上海那边 HR 打来的面试电话.
又聊了半个小时.是成是败还没把握.
算了不想了,没意思. [/quote] hahaha,不错的兆头 去了 cadence 一定要请客啊。等这次面试完了,写个面经上来,让我们也拜一下
zoe 于 2008-7-24 12:12 发表
忙还灌水
太假了 [/quote]
我手头上已经有 6 个 open issue 了。。。忙不过来了
Sky_pele 于 2008-7-23 23:20 发表
欢迎欢迎。
不过我是来灌水的。。 [/quote]
我排~
zoe 于 2008-7-23 13:02 发表
目前我对自动化测试有很多疑问~~~~ [/quote]
啥疑问?
zoe 于 2008-7-23 12:57 发表
这世道,谁人能信啊~~~
ms 这是少有的分了页的贴 [/quote]
信大盘鸡~~;P
re
CMing 于 2008-7-22 18:52 发表
砖家石家庄地震指数排名第一,这次要大降价了,回去捡个便宜去. [/quote]
他们就知道忽悠人
他们是为既得利益者说话的
中立专家的意见还可以考虑
测试会延续它的价值吗? 这里的争论比较复杂,所以我先给出一个大纲。
假设你的工作是要写一组测试来检测用户是否输入了正确的电话号码,那么你就需要检查是否是输入了有效地阿拉伯数字而非其它字符等等。如果你清楚其中的代码(据我了解很少人会这样)你可以设计一个规划列表将校验电话号码的代码使用高亮显示做出标记。通常称它为 the code under test。这部分代码可以更加完善你的测试任务。 在大多数时候,你不可能有机会直接运用 the code under test。例如:你不可能直接得到确认电话号码的那部分代码,因为它通常会是一个用户的一部分属性,就需要通过用户接口来测试,将与其关联的那部分代码组织起来,使这部分转变到内部程序的数据,并会按照常规将这部分数据表现出来。当然,你也不能直接对表现出来的数据进行检测,因为转变会通过其他的代码来将其转变成在用户界面可见的最后的数据(就像非法的数据会转换成错误信息)。我称这些代码为 intervening code——介于测试本身和 code under test 之间的代码。
Changes to the intervening code(对介入其间的代码进行变化) 介入其间的代码是导致测试死亡的主要因素。而且用户图形界面接口较上文提到的那个接口和一些硬件驱动接口相比更是这个样子。例如:假设用户接口要求你输入电话号码,但是现在变化为要求提供一个电话按键区的视觉表现。这时你要使用鼠标敲击号码模拟使用真实的电话。(这是个非常愚蠢的主意,但是这怪异的事情已经发生了。)尽管接口传给了 code under test 一个正确的值,但是用户界面的变化很可能破坏一次自动化测试,是因为很可能使用者再没有地方输入电话号码了。 就像另外的一个例子,一个输入的错误用户界面会用其它的方法来告诉用户。它可能会刷新主窗体使其显示红色同时发出特殊的声音来代替弹出的提示信息来告知你不能完成这次操作。但是,如果你的测试是通过测试是不是弹出提示信息来判定的,那么将视这种正常的运行为一个 bug。很显然这个测试就没有效果了。 "Off the shelf "测试自动化工具能做避免测试死亡的有限制的工作。例如:大多数的 GUI 自动化测试工具都可以忽视文本框大小、位置和颜色的改变。从而把握像上面两段所提到的那些大的改变,但是需要事先定制。这需要在你的工程中有一些人去创建 test libraries。这样就要求你,一个测试人员,在编写好测试的特殊术语,尽可能多的忽略用户接口的细节。例如,你的自动化测试可能包含这样一行定制的信息:try 217-555-1212 try 是 test library 程序,它的作用是将电话号码翻译成接口可以知道的术语。如果用户界面接受在输入框中输入字符,try 会在其中输入电话号码。如果需要通过显示在屏幕上的特定图形区域键入电话号码时,try 也会做到。
test library 可以有效地将那些不相关信息过滤掉。这样我们就可以详细的准确的测试那些与功能相关的数据。在输入上,增加这些附加信息是 intervening code 所必须的。在输出上,它们将 intervening code 中的信息全部压缩到一个很重要的模块中,其中的信息实际上可以当作是 Code Under Test 的一个延伸。这种过滤可以用左图来描述: 多数用户界面的变化不会需要对测试做更改,而只需要对 test library 做相应的修改。应为 test Code 要比 library Code 多的多,所以只修改 library Code 的代价会很低。 但是,尽管我们有更好的补偿性的代码也不可能将测试从所有的变化中隔离出来。它仅仅是尽可能的去预期所有的事情。所以其中有很多可能性,将来很可能出现一些问题破坏你的测试。你必须问自己这样一个问题: 在变化中 Intervening Code 会把测试保护到什么程度? 你需要估计 intervening Code 的改变对测试造成影响的可能性。要保证用户界面永远的不会改变是一件不可能的事情,这就使你需要不停的改变自动化测试的脚本以保证测试可以自动的执行。(我不会相信界面冻结后永远不会变化,除非 manager 答应如果以后每做一个新的修改将会给我 100 美元) 如果变化是可能的,你一定会被询问对你的 test Library 保护你的测试不受其影响正常执行有多大的信心。如果说 test Library 不能保护测试,那么起码它可以很容易的做出改动以适应变化。如果花费一个半小时的时间可以拯救 300 个测试,那么所做的一切是值得的。但是,小心:很多人往往低估了维护 test Library 的困难,特别是在变化后需要手工的对测试 test Library 进行反复的修改。不应该马上就放弃,抛弃所有的测试类和 test Library,从头开始,因为很可能只需要简单的修改就可以完成需要的测试。 如果你没有 test Library——如果你正在使用自动化 GUI 测试工具来捕获和重放模式——你不要期待会有任何保护。一次对界面的修改会让你的大部分的测试 “死亡”。往往不会有足够的时间来允许我们完成对发生变化的测试进行修改,我们不得不在少的花费和短的生命生存期之间做出选择。
Changes to the code under test(改变测试下的代码) Intervening Code 不是唯一可以变化的代码,code under test 同样可以变化。特别的是,它可以改变使其完全不同的去做某件事。 例如,假设几年前某个人写了一个关于点话号码的校验测试,为了检查那些不符合要求的电话号码,就像 1-888-343-3533。在当时,没有 888 这样的电话号码,但是现在却存在这样的号码。这样就导致了测试拒绝 888 号码给出提示,尽管现在这个号码是合法的,但是测试脚本会按照先前的规则进行测试从而拒绝它。解决这件事情可能很简单也可能很复杂。如果你了解问题所在那么这件事是一件很容易的事情:只需要将 “888” 改为 “889”。但是可能很困难对测试做足够的解释去了解测试电话号码整个的方法。或者你没有意识到 “888” 再现在来说是一个合法的号码,所以你会认为测试理所应当的测出这条 Bug。测试在你使用一些假的 “Bug” 来骚扰开发人员之前是不会固定不变的。 所以,在决定是否要进行自动化测试之前你同样需要问自己这样的几个问题: code under test 行为的稳定行如何? 注意强调的 “稳定性”——只要他们保持外部可试行为相同代码的代码就 OK! 不同类型的产品,不同类型的 code under test 有不同的稳定性。电话号码实际上还是相当稳定的。再如一个银行帐目管理系统可以说是一个相当稳定的系统,如果每次存 100 元需要收取 30 元的手续费那么记录到帐的就是 130 元,这种关系是稳定的(除非银行改变了收费的标准)。而用户的界界面是相当的不稳定的一个因素。 增加行为往往是无害的。例如,可能有这样一个检查,测试从一个帐户撤回 $100 由于 $30 生产错误导致操作失败但是帐户余款方面的没有改变。但是,现在测试被重写,增加了一个新的特性:顾客可以根据需要确定是否需要 “自动透支保护” 功能,它允许用户提取多余他帐户内存在的钱数。这种变化不会破坏现有的测试,只要默认的帐户测试保持原来的行为。(当然,新的测试必须依 * 新的行为来运行。) 我们的立足点在哪里呢? 现在我们知道了自动化测试应该跳远的障碍:必须保证自动化测试的价值要大于采用手工测试的价值。我们需要估计一个测试的生命周期,它可以有机会创造出价值的时间段。现在,我们需要询问一下它可以创造出价值的实际可能性。我们可以期待它能发现什么样的 Bug?
大的脚本拆分成小的脚本并不能解决问题,可能能解决脚本复用,但无法避免开发设计变更带来的大规模脚本重写,关键要进行自动化框架设计,使得自动化测试是分层实现的,这样底层细节封装起来,对上层屏蔽,开发设计变更的话,只要修改底层脚本实现就可以了。 另外自动化脚本中要解决的一个重要问题是恢复干净测试环境的问题。
1、其实自动化分层设计和软件分层的思想是一样的,例如在 windows 上开发的应用软件可以在不同的 PC 上运行,是因为操作系统层的 windows 把底层的硬件细节屏蔽掉了,所以上面的应用软件可以不用修改直接运行。 在自动化分层设计的时候,可以把会由于开发设计变更引起变更的部分放在底层,向上层屏蔽。 当然,由于测试是开发的下游部门,如果开发的设计完全不受控制的彻底变更,做为下游的测试部门,无论多么好的自动化框架设计都是没有办法规避这种大规模更改的风险的。
2、RESET 能够对特定的被测对象有用,但一些大的系统(如通信、航天等),RESET 系统是一个很废时间的过程,并且在这个过程中,如何判断测试台和被测系统的通信的恢复、如何判断下个用例脚本可以开始执行都是比较复杂的。 这是自动化测试中一个难点。 关于自动化测试理论方面的文章或资料,具体的名字真想不起来了。可以上 [url]www.qaforums.com 和 www.stickyminds.com[/url] 上去看看,那里有不少好文章。
-天网
CMing 于 2008-7-22 18:32 发表
我看我还是回石家庄买吧. [/quote]
嗯,石家庄倒还是不太贵
zoe 于 2008-7-22 13:32 发表
额额,几天不来,就来一个牛人哇~~~
敢问高姓大名啊 [/quote] 姓高,叫高大名:loveliness: :loveliness:
CMing 于 2008-7-22 17:51 发表
谁也想有个家,但男士比较理性一些. [/quote]
我倒是想不理性呢。。。。没有资本不理性啊.....哈哈哈哈哈哈
zoe 于 2008-7-22 13:05 发表
好有研究```
说话都是一套一套的
苗头! 我们要看苗头! [/quote]
苗头就是穷人买不起啊....上海的苗头如何?
............ sigh,这个均价就让人看了想跳楼
以前 200w 一套 现在涨了 1%,变成了 202w
还是买不起啊.现在是房价达到了一个太高的价位,即便涨的少也不管事,人们的购买力达不到那么高啊.
zoe 于 2008-7-22 12:59 发表
ms 这个是应届的 [/quote]
re
工作有经验的要比这个多很多.所以只是个参考
CMing 于 2008-7-22 10:56 发表
好啊,找个时间给我们培训一下. [/quote]
....................
培训啥哦,还是大家一起学习比较好...