Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are RCS Keywords?

Tags:

svn

cvs

rcs

I keep seeing RCS and RCS Keywords while looking at svn and cvs. I don't know what RCS is and what the RCS Keywords are. They seem to be a feature but with no real explanation as to what they do.

like image 245
nelaaro Avatar asked Mar 10 '11 09:03

nelaaro


2 Answers

This feature is a way to replace certains tokens in a file with meta information like user, date, revision number and similar. These keywords came from RCS (Revision Control System), a single-user file based version control system, which presumably nowadays nobody uses anymore.

Subversion (svn) and Concurrent Versioning System (CVS) are centralized version control systems, not distributed ones (DVCS).

  • CVS supports about the same keywords as RCS (since CVS was originally based on RCS and uses the same backend file format), and automatically replaces them if the file is not specially marked at checkin.

  • Subversion (the self-declared CVS-successor) has a similar set of keywords which can be replaced, but does not replace them automatically, only if you set some file property saying which keywords you want to be replaced. (For some keywords the syntax is a bit different than the one of the corresponding CVS keywords.)

The famous distributed VCS-es are Git, Mercurial, Bazaar - I know only Git, the information about Bazaar and Mercurial are googled. In general, as these usually use a hash of the current tree as a version identifier, they can't insert this identifier on commit, but do this on checkout, if at all, and only when configured to do so.

  • Git has a limited keyword replacement (only $Id$ => $Id: object-id$ when given the right attribute for the file), but you can write and plug in a pair of filter scripts which are executed on commit and checkout, which then do similar things.
  • Mercurial similarily has no build-in replacement, but supports extensions, and I just found one which claims to do this.
  • Bazaar has a plugin in experimental state doing such things.
like image 198
Paŭlo Ebermann Avatar answered Oct 13 '22 00:10

Paŭlo Ebermann


The Revision Control System is a version control system which is based on files and not on projects etc. The Keywords are used to replace the contents of the Keywords with information of the Revision Control system for example in your source code the revision. Take a look into the docs of RCS. See for Identifiers (examples are excerpt from the manual).

   $Id$

will be replaced by:

  $Id: filename revision number date time author state locker $

Here you can find the CVS Documentation.

like image 24
khmarbaise Avatar answered Oct 13 '22 00:10

khmarbaise