Recipe 18.4. Comparing File Versions in RCS

 < Day Day Up > 

18.4.1 Problem

Your current version of a configuration file isn't working the way you want, or perhaps a text document doesn't have the content you thought you put in there, or your brilliant code has all of a sudden gone dull. You're pretty sure an older version has what you want, so you want to compare the new version with older revisions to find out where you went astray.

18.4.2 Solution

Use the rcsdiff command. This compares two revisions:

$ rcsdiff -r1.1 -r1.2 cupsd.conf

Make sure there are no spaces after the -r flags.

This compares the working file with a specific revision:

$ rcsdiff -r1.2 cupsd.conf

And this compares the current working file with the most recent revision:

$ rcsdiff cupsd.conf

Use this command to review your changes after you've edited the file, but before you check it in.

18.4.3 Discussion

If the rcsdiff output is long, you can always direct it to a file for leisurely perusal:

$ rcsdiff -r1.1 -r1.2 cupsd.conf > cupsdiff.txt

Here is an example of rcsdiff's output:

$ rcsdiff -r1.1 -r1.3 cupsd.conf =  =  =  =  =  =  =  =  =  =  =  =  =  =  =  =  =  =  =  =  =  =  =  =  =  =  =  =  =  =   =  =  =  =  =  =  =  =  =  =  =  =  =  =  =  =  =  =  =  =  =  =  =  =  =  = RCS file: RCS/cupsd.conf,v retrieving revision 1.1 retrieving revision 1.3 diff -r1.1 -r1.3 9c9,17 < BrowseAddress 192.168.1.255 \ No newline at end of file --- > BrowseAddress 192.168.1.255 > > <Location /admin> > AuthType Basic > AuthClass System > Allow From 127.0.0.1 > Order Deny,Allow > Deny From All > </Location>

It tells you right at the top what file versions you are looking at:


<

Means the line is unique to the first file.


>

Means the line is unique to the second file.


\

Prefixes comments from RCS.

18.4.4 See Also

  • rcsdiff(1)

  • Official RCS home page (http://www.cs.purdue.edu/homes/trinkle/RCS)

     < Day Day Up > 


    Linux Cookbook
    Linux Cookbook
    ISBN: 0596006403
    EAN: 2147483647
    Year: 2004
    Pages: 434

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net