Keeping Track of Change
RCS doesn't keep a whole new copy of the file each time you check in changes. Instead, it records only the lines with changes in them, along with the descriptions of the changes (if you choose to provide them). It does this in a separate file. Changes to the file filename are kept in the file filename,v. If you find this to be too much clutter, you can tell RCS to stash the filename,v file out of the way, in a subdirectory called RCS. Simply create the subdirectory, and RCS will automatically use it.
Remember what it looked like when the foo file was checked in, above? Let's create a bar file whose corresponding bar,v file is kept out of sight in an RCS directory:
$ mkdir RCS $ vi bar $ ci -l bar RCS/bar,v <--bar enter description, terminated with single '.' or end of file: NOTE: This is NOT the log message! > $ vi bar $ ci -l bar RCS/bar,v <-- bar new revision: 1.2; previous revision: 1.1 enter log message, terminated with single '.' or end of file: >
If you did not originally create an RCS directory, and you get tired of seeing the ,v files, you can use these commands to get them out of the way safely:
$ mkdir RCS $ mv *,v RCS
RCS will know where to search for them.
So what do you do when you screw up? You have carefully kept copies of your changes, but how do you retrieve yesterday's version, or last year's version, or the second most recent version?
RCS keeps track of versions by version numbers. The first version you check in is assigned the number 1.1, the second is assigned the number 1.2, the third 1.3, and so on.
When you find that you have made a mistake, you can compare what you currently have with previous revisions. To compare against the previous revision, use this command:
$ rcsdiff -u filename
The -u tells rcsdiff to use the “unified diff” format to show you the changes, and it compares the current version of the file filename with the most recent version that was checked in. Here's an example. The previously checked in version of the file foo, version 1.3, consisted of:
This is a test of the emergency RCS system. This is only a test.
I have since edited the current version to read:
This is a test of the emergency RCS version control system. This is only a test.
Before checking this new version in, I can check the differences between the current contents of the file and the previous version that was checked in, giving me this:
$ rcsdiff -u foo ============================================== RCS file: foo,v retrieving revision 1.3 diff -u -r1.3 foo --- foo 1996/02/01 00:34:15 1.3 +++ foo 1996/02/01 00:34:31 @@ -1,2 +1,3 @@ This is a test of the emergency -RCS system. This is only a test. +RCS version control system. +This is only a test.
After showing what versions are being compared, the differences are shown. Lines that have not been changed are printed with a single space in front of them. Lines that have been removed in the newer version have a - in front of them, and lines that have been added have a + in front of them. As you can see, lines that are changed are considered to be deleted from the older version, and changed replacements added to the new version. Around any section with changed line, up to 3 lines of unchanged “context” will be shown to help you understand where in the file the change has been made.
This mechanism can be used to compare any two versions. After making a few more changes to the file, I can compare revision 1.6 to revision 1.3:
$ rcsdiff -u -r1.3 -r1.6 foo ============================================== RCS file: foo,v retrieving revision 1.3 retrieving revision 1.6 diff -u -r1.3 -r1.6 -- foo 1996/02/01 00:34:15 1.3 +++ foo 1996/02/01 01:05:28 1.6 @@ -1,2 +1,6 @@ This is a test of the emergency -RCS system. This is only a test. +RCS version control system. +This is only a test. + +I'm now adding a few lines for +the next version.
Note that it is good to list the earlier revision first. Otherwise, the sense of + and - are reversed.
Your changes are likely to be much more significant than these examples, and may take up more than a screen listing. This is not a problem; use a pager to view your output one screenful at a time:
$ rcsdiff -u -r1.3 -r1.6 foo | less
Once you see the changes you have made, you can usually figure out where you made your mistake and fix it by hand. Sometimes you might have accidentally done damage that is large and confusing, but more often you have changed a phrase or a paragraph, are dissatisfied with your change, and simply can't remember exactly what it used to look like.
If you want to, you can store a copy of the changes in a file with a command like:
$ rcsdiff -u -r1.3 -r1.6 foo > filename
or print the changes like:
$ rcsdiff -u -r1.3 -r1.6 foo | lpr
Realizing the promise of Apache® Hadoop® requires the effective deployment of compute, memory, storage and networking to achieve optimal results. With its flexibility and multitude of options, it is easy to over or under provision the server infrastructure, resulting in poor performance and high TCO. Join us for an in depth, technical discussion with industry experts from leading Hadoop and server companies who will provide insights into the key considerations for designing and deploying an optimal Hadoop cluster.
Sponsored by AMD
Built-in forensics, incident response, and security with Red Hat Enterprise Linux 6
Every security policy provides guidance and requirements for ensuring adequate protection of information and data, as well as high-level technical and administrative security requirements for a system in a given environment. Traditionally, providing security for a system focuses on the confidentiality of the information on it. However, protecting the data integrity and system and data availability is just as important. For example, when processing United States intelligence information, there are three attributes that require protection: confidentiality, integrity, and availability.
Learn more about catching the bad guy in this free white paper.
Sponsored by DLT Solutions
Free Webinar: Hadoop
How to Build an Optimal Hadoop Cluster to Store and Maintain Unlimited Amounts of Data Using Microservers
Realizing the promise of Apache® Hadoop® requires the effective deployment of compute, memory, storage and networking to achieve optimal results. With its flexibility and multitude of options, it is easy to over or under provision the server infrastructure, resulting in poor performance and high TCO. Join us for an in depth, technical discussion with industry experts from leading Hadoop and server companies who will provide insights into the key considerations for designing and deploying an optimal Hadoop cluster.
Some of key questions to be discussed are:
- What is the “typical” Hadoop cluster and what should be installed on the different machine types?
- Why should you consider the typical workload patterns when making your hardware decisions?
- Are all microservers created equal for Hadoop deployments?
- How do I plan for expansion if I require more compute, memory, storage or networking?
| Designing Electronics with Linux | May 22, 2013 |
| Dynamic DNS—an Object Lesson in Problem Solving | May 21, 2013 |
| Using Salt Stack and Vagrant for Drupal Development | May 20, 2013 |
| Making Linux and Android Get Along (It's Not as Hard as It Sounds) | May 16, 2013 |
| Drupal Is a Framework: Why Everyone Needs to Understand This | May 15, 2013 |
| Home, My Backup Data Center | May 13, 2013 |
- Linux Systems Administrator
- New Products
- Senior Perl Developer
- Technical Support Rep
- UX Designer
- Web & UI Developer (JavaScript & j Query)
- Designing Electronics with Linux
- Dynamic DNS—an Object Lesson in Problem Solving
- Using Salt Stack and Vagrant for Drupal Development
- Making Linux and Android Get Along (It's Not as Hard as It Sounds)




21 min 27 sec ago
4 hours 53 min ago
4 hours 53 min ago
6 hours 53 min ago
15 hours 39 min ago
16 hours 13 min ago
17 hours 11 min ago
18 hours 2 min ago
22 hours 3 min ago
1 day 1 hour ago