/* cvsclone.l */

/*
 * Copyright (C) 2006  Peter Backes <rtc@gmx.de>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 * 
 * BUILDING
 *
 * flex cvsclone.l && gcc -Wall -O2 lex.yy.c -o cvsclone
 *
 * EXAMPLE
 *
 * *-------------------------------------------------------------------*
 * | Applying this tool to sourceforge.net or savannah.gnu.org is      |
 * | neither necessary nor recommended: With $1 being the project, you |
 * | can simply                                                        |
 * |      rsync -av rsync://$1.cvs.sourceforge.net/cvsroot/$1/ $1      |
 * | or                                                                |
 * |           rsync -av rsync://cvs.sv.gnu.org/sources/$1 $1          |
 * | respectively (try also 'web' instead of 'sources').               |
 * *-------------------------------------------------------------------*
 *
 * cvsclone -d :pserver:anonymous@cvs.example.org:/var/lib/cvs module
 *
 * DESCRIPTION
 * 
 * Utility to clone cvs repositories over the cvspserver interface.  Works
 * for anonymous access.
 * 
 * FEATURES
 *
 * - reads $HOME/.cvspass
 *
 * - can clone corrupt repositories: writes ,v files directly, does not
 *   need rcs.  (For example, ccvs module has archives that go backwards
 *   in time.)
 *
 * PROBLEMS
 *
 * - can't enable compression.
 *
 * - reading cvs password from $HOME/.cvspass uses CVSROOT in a 
 *   case sensitive way.
 *
 * - rlog format is ambiguous.  If the separators it uses are found inside 
 *   log messages, possibly followed by lines similar to what rlog
 *   outputs, things can go wrong horribly.
 *
 * - rcs 5.x rlog format does not contain the comment leader.  It is 
 *   guessed according to the extension as rcs and CVS do.
 *
 * - uses normal diff format since this is the easiest one that works.
 *   diff --rcs is problematic, since files without newline at the
 *   last line are not output correctly.  The major drawback about this
 *   is that deleted lines are transfered while they don't need to be.
 *   even rdiff has major problems with lines that contain \0, because
 *   of a bug in cvs.
 * 
 * - does not work incrementally.  That would be much more work if
 *   updating the trunk since the most recent revision had to be 
 *   reconstructed.  Also, the whole history probably had to be transfered 
 *   again, with all log messages.
 * 
 * - Horrible complexity.  A file with n deltas takes O(n^2) to transfer.
 *
 * - Makes the cvs server really work hard, taking up all processor time.
 *   It should really not be used on public cvs servers, especially
 *   not on a regular basis.  Perhaps it is useful for salvaging 
 *   archive files from projects where only access to anonymous cvs 
 *   is available.
 *
 *
 * Patches and comments are welcome.
 *
 */
