599 lines
10 KiB
HTML
599 lines
10 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
|
<HTML
|
|
><HEAD
|
|
><TITLE
|
|
>Using CVS</TITLE
|
|
><META
|
|
NAME="GENERATOR"
|
|
CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK
|
|
REL="HOME"
|
|
TITLE="LDP Author Guide"
|
|
HREF="index.html"><LINK
|
|
REL="UP"
|
|
TITLE="Concurrent Version System (CVS)"
|
|
HREF="cvs.html"><LINK
|
|
REL="PREVIOUS"
|
|
TITLE=" Getting a CVS account "
|
|
HREF="getaccount.html"><LINK
|
|
REL="NEXT"
|
|
TITLE="CVS Resources"
|
|
HREF="cvs-resources.html"></HEAD
|
|
><BODY
|
|
CLASS="section"
|
|
BGCOLOR="#FFFFFF"
|
|
TEXT="#000000"
|
|
LINK="#0000FF"
|
|
VLINK="#840084"
|
|
ALINK="#0000FF"
|
|
><DIV
|
|
CLASS="NAVHEADER"
|
|
><TABLE
|
|
SUMMARY="Header navigation table"
|
|
WIDTH="100%"
|
|
BORDER="0"
|
|
CELLPADDING="0"
|
|
CELLSPACING="0"
|
|
><TR
|
|
><TH
|
|
COLSPAN="3"
|
|
ALIGN="center"
|
|
>LDP Author Guide</TH
|
|
></TR
|
|
><TR
|
|
><TD
|
|
WIDTH="10%"
|
|
ALIGN="left"
|
|
VALIGN="bottom"
|
|
><A
|
|
HREF="getaccount.html"
|
|
ACCESSKEY="P"
|
|
>Prev</A
|
|
></TD
|
|
><TD
|
|
WIDTH="80%"
|
|
ALIGN="center"
|
|
VALIGN="bottom"
|
|
>Appendix C. Concurrent Version System (CVS)</TD
|
|
><TD
|
|
WIDTH="10%"
|
|
ALIGN="right"
|
|
VALIGN="bottom"
|
|
><A
|
|
HREF="cvs-resources.html"
|
|
ACCESSKEY="N"
|
|
>Next</A
|
|
></TD
|
|
></TR
|
|
></TABLE
|
|
><HR
|
|
ALIGN="LEFT"
|
|
WIDTH="100%"></DIV
|
|
><DIV
|
|
CLASS="section"
|
|
><H1
|
|
CLASS="section"
|
|
><A
|
|
NAME="usingcvs"
|
|
></A
|
|
>C.2. Using CVS</H1
|
|
><DIV
|
|
CLASS="section"
|
|
><H2
|
|
CLASS="section"
|
|
><A
|
|
NAME="cvs-setup"
|
|
></A
|
|
>C.2.1. Setting Up Your CVS Account</H2
|
|
><P
|
|
> First you'll need to get an account at the LDP's CVS
|
|
Repository. Please see the notes above on obtaining an account. This repository houses various documents including
|
|
HOWTOs and Guides. Documents are sorted by the type of document (for
|
|
example a HOWTO or a Guide), and by the markup language the document
|
|
uses (for example DocBook or LinuxDoc).
|
|
</P
|
|
><P
|
|
>When your account is ready you can log in using one of the following commands. In all instances <TT
|
|
CLASS="replaceable"
|
|
><I
|
|
>your_userid</I
|
|
></TT
|
|
> should be replaced by the user name you were issued in the response email. You will be prompted for a password after this first step.</P
|
|
><P
|
|
></P
|
|
><DIV
|
|
CLASS="variablelist"
|
|
><P
|
|
><B
|
|
>Initializing Your CVS Account</B
|
|
></P
|
|
><DL
|
|
><DT
|
|
>Linux system</DT
|
|
><DD
|
|
><P
|
|
> <B
|
|
CLASS="command"
|
|
>cvs <TT
|
|
CLASS="parameter"
|
|
><I
|
|
>-d :pserver:<TT
|
|
CLASS="replaceable"
|
|
><I
|
|
>your_userid</I
|
|
></TT
|
|
>@cvs.tldp.org:/cvsroot</I
|
|
></TT
|
|
> login</B
|
|
>
|
|
</P
|
|
></DD
|
|
><DT
|
|
>Windows system</DT
|
|
><DD
|
|
><P
|
|
><B
|
|
CLASS="command"
|
|
>set <TT
|
|
CLASS="varname"
|
|
>CVSROOT</TT
|
|
>=":pserver:<TT
|
|
CLASS="replaceable"
|
|
><I
|
|
>your_userid</I
|
|
></TT
|
|
>@cvs.tldp.org:/cvsroot"</B
|
|
>
|
|
</P
|
|
><P
|
|
><B
|
|
CLASS="command"
|
|
>cvs <TT
|
|
CLASS="parameter"
|
|
><I
|
|
>-d %CVSROOT%</I
|
|
></TT
|
|
> login</B
|
|
></P
|
|
></DD
|
|
></DL
|
|
></DIV
|
|
><P
|
|
> Wait patiently while the system tries to log you in. It can often take more
|
|
that 10-20 seconds for the system to either accept (or reject)
|
|
your password. Once you've
|
|
used <B
|
|
CLASS="command"
|
|
>cvs login</B
|
|
> for the first time and have
|
|
been given access to the system, your password is stored in
|
|
<TT
|
|
CLASS="filename"
|
|
>.cvspass</TT
|
|
> and you will not
|
|
have to use <B
|
|
CLASS="command"
|
|
>cvs login</B
|
|
>
|
|
again. Just set the CVSROOT with the export command listed above
|
|
and continue on. If TLDP's CVS server is the only one you work with, you might also add an <B
|
|
CLASS="command"
|
|
>export <TT
|
|
CLASS="varname"
|
|
>CVSROOT</TT
|
|
></B
|
|
> line to your <TT
|
|
CLASS="filename"
|
|
>~/.bashrc</TT
|
|
> shell configuration file.</P
|
|
></DIV
|
|
><DIV
|
|
CLASS="section"
|
|
><H2
|
|
CLASS="section"
|
|
><A
|
|
NAME="get-repository"
|
|
></A
|
|
>C.2.2. Getting the Documents</H2
|
|
><P
|
|
> You can get the entire repository (about 150 MB) with: <B
|
|
CLASS="command"
|
|
>cvs checkout LDP</B
|
|
>
|
|
</P
|
|
><P
|
|
> Or you can get the source for your own document with:
|
|
<B
|
|
CLASS="command"
|
|
>cvs checkout LDP/howto/docbook/YOUR-HOWTO.xml</B
|
|
> OR
|
|
<B
|
|
CLASS="command"
|
|
>cvs checkout LDP/guide/docbook/YOURGUIDE</B
|
|
>
|
|
</P
|
|
><P
|
|
>Windows users will need to use a modified version of this command. Instead they should use:
|
|
<B
|
|
CLASS="command"
|
|
>cvs -d %CVSROOT% checkout LDP/howto/docbook/YOUR-HOWTO.xml</B
|
|
>
|
|
</P
|
|
><DIV
|
|
CLASS="note"
|
|
><P
|
|
></P
|
|
><TABLE
|
|
CLASS="note"
|
|
WIDTH="100%"
|
|
BORDER="0"
|
|
><TR
|
|
><TD
|
|
WIDTH="25"
|
|
ALIGN="CENTER"
|
|
VALIGN="TOP"
|
|
><IMG
|
|
SRC="../images/note.gif"
|
|
HSPACE="5"
|
|
ALT="Note"></TD
|
|
><TH
|
|
ALIGN="LEFT"
|
|
VALIGN="CENTER"
|
|
><B
|
|
>Keep an overview</B
|
|
></TH
|
|
></TR
|
|
><TR
|
|
><TD
|
|
> </TD
|
|
><TD
|
|
ALIGN="LEFT"
|
|
VALIGN="TOP"
|
|
><P
|
|
> <B
|
|
CLASS="command"
|
|
>checkout</B
|
|
> will add the full directory structure
|
|
from tldp.org on down. Although it doesn't really matter where
|
|
you put these files on your local file system you may not want to
|
|
bury the directories too deeply.
|
|
</P
|
|
></TD
|
|
></TR
|
|
></TABLE
|
|
></DIV
|
|
></DIV
|
|
><DIV
|
|
CLASS="section"
|
|
><H2
|
|
CLASS="section"
|
|
><A
|
|
NAME="cvs-commands"
|
|
></A
|
|
>C.2.3. CVS Commands</H2
|
|
><P
|
|
></P
|
|
><DIV
|
|
CLASS="variablelist"
|
|
><P
|
|
><B
|
|
>CVS Commands: a brief reminder</B
|
|
></P
|
|
><DL
|
|
><DT
|
|
>commit</DT
|
|
><DD
|
|
><P
|
|
> This CVS command will upload your changes to the CVS server.</P
|
|
><P
|
|
>Please be sure to include a useful description of the changes that have been made to your document.</P
|
|
><P
|
|
>If you want to bypass the editor screen you can use </P
|
|
><P
|
|
><B
|
|
CLASS="command"
|
|
> cvs <TT
|
|
CLASS="option"
|
|
>commit</TT
|
|
> <TT
|
|
CLASS="option"
|
|
>-m "A description of the work done on this version of the document."</TT
|
|
>
|
|
</B
|
|
> </P
|
|
><DIV
|
|
CLASS="note"
|
|
><P
|
|
></P
|
|
><TABLE
|
|
CLASS="note"
|
|
WIDTH="100%"
|
|
BORDER="0"
|
|
><TR
|
|
><TD
|
|
WIDTH="25"
|
|
ALIGN="CENTER"
|
|
VALIGN="TOP"
|
|
><IMG
|
|
SRC="../images/note.gif"
|
|
HSPACE="5"
|
|
ALT="Note"></TD
|
|
><TH
|
|
ALIGN="LEFT"
|
|
VALIGN="CENTER"
|
|
><B
|
|
>Ready for publication warning</B
|
|
></TH
|
|
></TR
|
|
><TR
|
|
><TD
|
|
> </TD
|
|
><TD
|
|
ALIGN="LEFT"
|
|
VALIGN="TOP"
|
|
><P
|
|
>You must still email <TT
|
|
CLASS="email"
|
|
><<A
|
|
HREF="mailto:submit@en.tldp.org"
|
|
>submit@en.tldp.org</A
|
|
>></TT
|
|
>
|
|
when you are ready to have your changes
|
|
appear on the live site. Your email should include the relative
|
|
path to the file(s) in the LDP CVS tree that you wish to
|
|
update.
|
|
</P
|
|
></TD
|
|
></TR
|
|
></TABLE
|
|
></DIV
|
|
></DD
|
|
><DT
|
|
>add</DT
|
|
><DD
|
|
><P
|
|
> You can add new files to your CVS repository. These may be image
|
|
files or additional XML files. First check that your HOWTO is in
|
|
its own directory. You may want to coordinate with the
|
|
people at <TT
|
|
CLASS="email"
|
|
><<A
|
|
HREF="mailto:submit@en.tldp.org"
|
|
>submit@en.tldp.org</A
|
|
>></TT
|
|
> to ensure you can
|
|
add graphics or other files to your HOWTO.
|
|
</P
|
|
><P
|
|
> Copy the files you want to add into your local CVS repository
|
|
(where all of your downloaded/working files are). Then:</P
|
|
><P
|
|
><B
|
|
CLASS="command"
|
|
>cvs add <TT
|
|
CLASS="replaceable"
|
|
><I
|
|
>filename</I
|
|
></TT
|
|
></B
|
|
> </P
|
|
><P
|
|
> After you've added the files, you still need to <B
|
|
CLASS="command"
|
|
>commit</B
|
|
> them to the
|
|
repository (see above).
|
|
</P
|
|
></DD
|
|
><DT
|
|
>remove</DT
|
|
><DD
|
|
><P
|
|
> </P
|
|
></DD
|
|
><DT
|
|
>$Id: cvs.xml,v 1.32 2011/01/14 16:24:52 serek Exp $</DT
|
|
><DD
|
|
><P
|
|
> While this is not a CVS <SPAN
|
|
CLASS="QUOTE"
|
|
>"command"</SPAN
|
|
> it can be used to
|
|
automatically insert information about the file including the
|
|
time and date it was last modified, the version number it was
|
|
assigned by the CVS and the filename of this particular file.
|
|
The output will look like this:
|
|
<TT
|
|
CLASS="computeroutput"
|
|
>$Id: cvs.xml,v 1.9 2002/04/21 09:44:26 serek Exp
|
|
$</TT
|
|
>
|
|
</P
|
|
></DD
|
|
></DL
|
|
></DIV
|
|
><P
|
|
> If you need to change a file name, you
|
|
still need to use the <B
|
|
CLASS="command"
|
|
>add</B
|
|
> command. First remove the copy of the
|
|
file from your local disk. Then remove it from the CVS tree with:
|
|
<B
|
|
CLASS="command"
|
|
>cvs remove <TT
|
|
CLASS="replaceable"
|
|
><I
|
|
>filename</I
|
|
></TT
|
|
></B
|
|
>.
|
|
As with the <B
|
|
CLASS="command"
|
|
>add</B
|
|
> command, you need to <B
|
|
CLASS="command"
|
|
>>commit</B
|
|
> your
|
|
removed file. Finally, now that the old file has been removed, add
|
|
your new file using the instructions above (first <B
|
|
CLASS="command"
|
|
>add</B
|
|
> and then
|
|
<B
|
|
CLASS="command"
|
|
>commit</B
|
|
> the additional file).
|
|
</P
|
|
><DIV
|
|
CLASS="section"
|
|
><H3
|
|
CLASS="section"
|
|
><A
|
|
NAME="recovery"
|
|
></A
|
|
>C.2.3.1. Recovering old versions</H3
|
|
><P
|
|
> There you are, typing away, when you screw up. Real bad.
|
|
Doesn't matter what it is, but suffice it to say that you've
|
|
toasted not only the version on your local drive, but
|
|
created a new version on the CVS server. What you need
|
|
to do is go back in time and resurrect an older
|
|
version of your file.
|
|
</P
|
|
><P
|
|
> To do this, you'll need to know the version number of the
|
|
file you want to retrieve. <B
|
|
CLASS="command"
|
|
>cvs diff</B
|
|
>
|
|
will give a list of revisions if there are differences. You
|
|
can pick the revision number, subtract one, and that is
|
|
probably the revision you want to look at.
|
|
</P
|
|
><P
|
|
> The command</P
|
|
><P
|
|
><B
|
|
CLASS="command"
|
|
>cvs -Q update -p -r <TT
|
|
CLASS="replaceable"
|
|
><I
|
|
>revision</I
|
|
></TT
|
|
>
|
|
<TT
|
|
CLASS="replaceable"
|
|
><I
|
|
>filename</I
|
|
></TT
|
|
></B
|
|
> </P
|
|
><P
|
|
>will output to stdout
|
|
the contents of the <TT
|
|
CLASS="replaceable"
|
|
><I
|
|
>revision</I
|
|
></TT
|
|
> version
|
|
of <TT
|
|
CLASS="replaceable"
|
|
><I
|
|
>filename</I
|
|
></TT
|
|
>. You can pipe it to
|
|
<B
|
|
CLASS="command"
|
|
>more</B
|
|
> or redirect the output to a file.
|
|
Conveniently, you can redirect stdout to a file called
|
|
<TT
|
|
CLASS="replaceable"
|
|
><I
|
|
>filename</I
|
|
></TT
|
|
>. Your local file
|
|
is now the revision you want, and</P
|
|
><P
|
|
><B
|
|
CLASS="command"
|
|
>cvs update</B
|
|
> </P
|
|
><P
|
|
>will update the CVS server with the new (old)
|
|
version of <TT
|
|
CLASS="replaceable"
|
|
><I
|
|
>filename</I
|
|
></TT
|
|
>.
|
|
</P
|
|
></DIV
|
|
></DIV
|
|
></DIV
|
|
><DIV
|
|
CLASS="NAVFOOTER"
|
|
><HR
|
|
ALIGN="LEFT"
|
|
WIDTH="100%"><TABLE
|
|
SUMMARY="Footer navigation table"
|
|
WIDTH="100%"
|
|
BORDER="0"
|
|
CELLPADDING="0"
|
|
CELLSPACING="0"
|
|
><TR
|
|
><TD
|
|
WIDTH="33%"
|
|
ALIGN="left"
|
|
VALIGN="top"
|
|
><A
|
|
HREF="getaccount.html"
|
|
ACCESSKEY="P"
|
|
>Prev</A
|
|
></TD
|
|
><TD
|
|
WIDTH="34%"
|
|
ALIGN="center"
|
|
VALIGN="top"
|
|
><A
|
|
HREF="index.html"
|
|
ACCESSKEY="H"
|
|
>Home</A
|
|
></TD
|
|
><TD
|
|
WIDTH="33%"
|
|
ALIGN="right"
|
|
VALIGN="top"
|
|
><A
|
|
HREF="cvs-resources.html"
|
|
ACCESSKEY="N"
|
|
>Next</A
|
|
></TD
|
|
></TR
|
|
><TR
|
|
><TD
|
|
WIDTH="33%"
|
|
ALIGN="left"
|
|
VALIGN="top"
|
|
>Getting a CVS account</TD
|
|
><TD
|
|
WIDTH="34%"
|
|
ALIGN="center"
|
|
VALIGN="top"
|
|
><A
|
|
HREF="cvs.html"
|
|
ACCESSKEY="U"
|
|
>Up</A
|
|
></TD
|
|
><TD
|
|
WIDTH="33%"
|
|
ALIGN="right"
|
|
VALIGN="top"
|
|
>CVS Resources</TD
|
|
></TR
|
|
></TABLE
|
|
></DIV
|
|
></BODY
|
|
></HTML
|
|
> |